Compare commits

...
1532 Commits
Author SHA1 Message Date
Marek Safar 54e3eccc5d [build] Bump bootstrap mcs dependency for mcs builds to catch up with e6fb82b2c7 2018-03-22 16:37:17 +01:00
Bernhard Urban 99d31278e3 [interp] always set old_frame in interp_entry (#7757)
fixup for https://github.com/mono/mono/pull/7747
2018-03-22 10:34:23 -04:00
Zoltan Varga c2698519b0 [interp] Allocate ThreadContext structures on the heap instead of on the stack, the latter doesn't work in mixed mode if the native frame gets unwound during exception handling, so the set_context (NULL) call is never executed, leaving a dangling ref in the tls variable. (#7747) 2018-03-21 21:25:21 -04:00
Filip Navara 678576f5a8 [System.Windows.Forms] Reset check state of item when removing it. (#7744)
* Reset checked state when removing an item from CheckedListBox.

* Bump API snapshot submodule
2018-03-22 02:11:54 +01:00
Zoltan Varga 87fd071412 Revert "Swap Close/Dispose calls so that the receiver_thread_main loop will be properly interrupted (#7390)" (#7745)
This reverts commit e7ba41d14c.
2018-03-21 17:23:57 -04:00
monojenkins 9b702e8052 Bump API snapshot submodule 2018-03-21 22:17:44 +01:00
Marek Safar e6fb82b2c7 Bump bootstrap dependency 2018-03-21 22:17:44 +01:00
Marek Safar 7a9f8405d4 [corlib] String from CoreFX/CoreRT 2018-03-21 22:17:44 +01:00
Marek Safar 20ba08543e [corlib] Use UTF8 bytes convertor directly 2018-03-21 22:17:44 +01:00
Ludovic Henry d9e3d7c407 Remove dead code (#7738) 2018-03-21 16:29:59 -04:00
brianradunity c732bd4758 This fixes an issue we are seeing with VSTU debgugging in Unity. (#7634)
process_breakpoint() will process breakpoint, stepping, and method
exit/entry events all at the same time when checking a sequence point.
So, if there is is a breakpoint and a stepping event at the same time,
the debugger agent will suspend the current thread twice, which means
you have to click the step button in the debugger client twice on that
line.  Considering only one of these events at a time seems to fix
the issue without breaking any current unit tests or showing any other
noticeable issues in testing.
2018-03-21 16:01:13 -04:00
Katelyn Gadd 7faa462046 Fix bug #60843 and add test (#7640)
* Fix bug #60843 and add test:
If an enum was nested inside a generic class, using it as an argument to a custom attribute would cause a runtime error in the custom attribute decoder. Update the decoder to forward this special case through the normal primitive loading path.

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

* Update based on PR feedback

* Don't use caller info attributes since FullAOT does not have them

* Revert "Don't use caller info attributes since FullAOT does not have them"

This reverts commit 316afb686363ef0e46c15d5858bbc1b85ffd5264.

* Fix embarassing bug in test case

* Update outdated test category name

* Disable bug 60843 test in interpreter
2018-03-21 16:00:17 -04:00
Jonathan Chambers d26fb8a3eb Forward mono_string_new_wrapper to mono_string_new for error handling. (#7718)
In commit 8ba48b5a41
mono_string_new was adjusted to only assert for
out of memory rather than all errors to preserve
previous behavior for invalid strings. This
change preserves behavior for mono_string_new_wrapper.
2018-03-21 15:56:56 -04:00
Alexander Köplinger d5d1fb290d Bump roslyn-binaries to include missing file 2018-03-21 20:45:15 +01:00
Marek Safar dd09fa9982 [mcs] Adds cloning for TupleLiteralElement expressions (#7746)
Fixes #7729
2018-03-21 13:32:00 -04:00
pascalhaakmat 3fa3592376 Uncomment and fix ServiceHost creation via ServiceFactory in SvcHttpHandler.cs (#3465)
This commit allows customization of WCF service creation via the Factory attribute in an .svc file:

`<%@ ServiceHost Language="C#" Service="CustomService" Factory="CustomServiceHostFactory" %>`

All the patch does is uncomment a few lines that were already there and fix a small error. I am not sure why these lines were commented. Possibly the code is not sufficiently robust or it was just never given another look. But this works for me and it seems better than no support at all. For example, a custom ServiceHostFactory appears to be the only way to create a WCF service in a managed host which customizes EndpointDispatcher.AddressFilter and EndpointDispatcher.ContractFilter. This in turn is useful for proxied WCF services.

See also http://mono.1490590.n4.nabble.com/Mono-WCF-ServiceHost-Factory-option-td4251992.html (from 2012; never posted on the mailing list for some reason).
2018-03-21 18:09:45 +01:00
Marek Safar f42fdeca61 [mcs] Fixes codegen for null fixed string statement 2018-03-21 17:37:22 +01:00
Marek Safar 9e4eb1ca69 Bumps roslyn to 2.7.0 2018-03-21 17:15:37 +01:00
Bernhard Urban dc0cf83b3a [arm] fix stack alignment for structs (#7691)
fixes https://github.com/mono/mono/issues/7449
2018-03-21 11:49:11 -04:00
Vlad Brezae 0dec8fda18 [sgen] Fix scanning of large arrays (#7672)
The previous code was handling only objects residing in 2 32bit card protected address spaces. This means card table scanning for objects larger than 4GB was potentially broken, while card scanning of objects larger than 8GB was completely broken.

Fixes https://github.com/mono/mono/issues/7537
2018-03-21 11:48:25 -04:00
Alexis Christoforides 39c9f9d935 Merge pull request #7724 from lewurm/wildcardconnect-watchos
[HttpClientTest] remove WildcardConnect () on WatchOS
2018-03-21 11:15:31 -04:00
Aleksey Kliger (λgeek) e40c97e771 [interp] Disable pinvoke3.exe test on x64 (#7739) 2018-03-21 10:59:27 -04:00
jaykrell 06463f4ca2 [Tailcall] Add interface tailcall tests, and generics thereof. (#7703)
These all fail on Mono (the conservestack tests).
All but one succeeds on desktop.
2018-03-21 10:49:38 -04:00
Filip Navara 9914517a12 Remove obsolete code for getting TLS values from other threads. (#7714)
* Remove obsolete code for getting TLS values from other threads.

* Remove more unused mono_mach_* functions.
2018-03-21 10:17:22 -04:00
Bernhard Urban 9fe7008d97 [HttpClientTest] remove WildcardConnect () on WatchOS 2018-03-20 23:33:16 +01:00
Alexis Christoforides 7dea71ce64 Touchup for https://github.com/mono/mono/pull/7599/ 2018-03-20 18:27:28 -04:00
monojenkins 3766089898 Merge pull request #7599 from lambdageek/abort-cctor-no-protection
[threads] Delay abort via handler block guard when in abort protected block.

`mono_install_handler_block_guard` is called when we want to signal an async
abort to another thread.  In case the other thread is executing native code
while in a `finally` block, the handler block guard sets a byte in the finally
block that used to trigger a self abort (`mono_thread_self_abort`).

This PR renames `mono_thread_self_abort` to
`ves_icall_thread_finish_async_abort`.  It also changes the code from
immediately executing a synchronous abort, to checking whether we are in an
abort protected block (most commonly - whether we were called from a cctor) and
in that case merely toggling the "async interrupt"
MonoInternalThread:thread_state bit.  If we're not in an abort-protected block,
trigger a self interrupt (which will turn into an abort exception in the
icall wrapper of `ves_icall_thread_finish_async_abort`).

Fixes #7588
2018-03-20 18:16:05 -04:00
Alexis Christoforides f617929e9e [runtime] Don't use clock_gettime on WatchOS and tvOS. 2018-03-20 17:25:17 -04:00
Alexander Köplinger 081c79e687 Add csc-dim script to .gitignore 2018-03-20 21:40:36 +01:00
Alexis Christoforides 7cc78d08b0 Merge pull request #7707 from mono/fix-boottime-osx-10.7
[runtime] Don't use clock_gettime in MacOS.
2018-03-20 16:11:25 -04:00
Filip Navara 9cf2550ba2 Update man page, MONO_DISABLE_AIO is now MONO_ENABLE_AIO. (#7715) 2018-03-20 15:35:19 -04:00
Vlad Brezae 16e6e7df70 [sgen] Finish thread pool work before shutting down threads (#7647) 2018-03-20 15:08:28 -04:00
Martin Baulig e480620040 [System]: Fix a race condition that was exposed by #7358 (see #7668).
The latest `WebCompletionSource<T>` changes (PR #7358) exposed and
intensified the side-effects of a race condition between `WebOperation`
and `ServicePointScheduler`.

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

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

* The ServicePointScheduler's main-loop is still woken up by completion of
  `WebOperation.Finished.Task`, but we use the new `CurrentResult` property
  to check state in a non-blocking way.  This ensures the the clean-up and
  bookkeeping work that's necessary after `WebCompletion.Finish()` always
  happens prior to starting new connections.
2018-03-20 16:55:25 +01:00
Zoltan Varga 120aa248fa [sdks] Fix building the ios device tests. (#7706) 2018-03-20 11:54:28 -04:00
Bernhard Urban a5c6f5c5ca [w32file] do not discard sub-second resolution for access- and writetime if possible (#7650)
* [w32file] remove unused mono_w32file_get_times ()

* [w32file-unix] replace SECMULT with TICKS_PER_SECOND

* [w32file-unix] use CONVERT_BASE in more places

* [w32file-unix] factor setfiletime

* [w32file-unix] use utimes if available in order to set subsecond information on access and write time

* [FileTest] add regression test for github issue 7646

* [w32file-unix] reduce compiler warnings

* [w32file-unix] 1000ns = 1us and 1us = 10ticks

* [w32file-unix] add LL suffix to constant in order to prevent overflowing on 32bit systems
2018-03-20 11:34:46 -04:00
Alexander Kyte b37166882d [runtime] Fix file handle leak with dedup+aot (#7694) 2018-03-20 11:29:06 -04:00
Alex Rønne Petersen feb8b568ba [mprof-report] Fix reading of TYPE_JITHELPER events in v13 files. (#7677)
This is the same fix as in 76d7ab281d.

Fixes #7613.
2018-03-20 11:27:53 -04:00
Aleksey Kliger (λgeek) b77313855c [loader] Don't load framework Facade assemblies that are older than expected. (#7663)
* [loader] Don't load framework Facade assemblies that are older than expected.

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

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

Fixes https://github.com/mono/mono/issues/7624
2018-03-20 10:33:44 -04:00
Alexis Christoforides 62921c8a62 [runtime] Don't use clock_gettime in MacOS.
Even though it's found during configure when targetting 10.7, it's not "really" available before versions 10.12 and it would crash with "lazy symbol binding failed".
2018-03-20 10:17:07 -04:00
Ankit Jain 7528656820 [msbuild] Bump msbuild to pick up fix for issue #7184 (#7665)
MSBuild always recompiles project if it has a resx with a windows path.
https://github.com/mono/mono/issues/7184
2018-03-20 13:57:43 +01:00
Zoltan Varga 53a59ccf76 [sdks] Fix building the ios tests. (#7701) 2018-03-20 08:04:05 -04:00
Alexander Köplinger 1c8b460b4c [version.h] Support .git being a submodule (#7689)
When mono is used as a submodule then .git will be a file instead of a
directory. Adjusted the version.h generation code to support that.

Also newer git version started to use `(HEAD detached at <git sha>)`
in `git branch` output instead of `(detached from <git sha>)`,
fixed the regex to support that pattern too.
2018-03-20 11:30:42 +01:00
Marek Safar e99ac890e6 Add csc-dim as a prototype if default interface implementation 2018-03-20 09:13:15 +01:00
Zoltan Varga 7aeaafd281 [runtime] Fix mono_msec_boottime () so it compiles on older ios versions, clock_gettime () is only available from ios 10. (#7671) 2018-03-19 21:05:45 -04:00
Rolf Bjarne Kvinge 8ae317a1e8 [arm64] Add a known TLS offset. (#7530) 2018-03-19 18:15:57 -04:00
jaykrell b6f56a115f [Tailcall] Cleanup, handle varargs, cleanup varargs handling, be sure not to use unsupported tailcall_membase, pass r11 through, align patches. (#7600)
* [Tailcall] Cleanup is_supported_tail_call to only check virtual_, not opcode == CALLVIRT.

* [Tailcall] Generate tailcall address earlier to honor NT ABI.
Let R11 through tailcall.
Assert alignment when patching.

* [Tailcall] Factor out two copies of SysV varargs handling to a helper function and remove for NT.
Tailcall needs a third instance, and it likely gets in the way of NT tailcall, where it is not needed.

* [Tailcall] Teach amd64_patch how to patch jmp rip+32 and jmp [rip + 32]
very similar to call rip+32 and call [rip + 32]. This might be useful.

* [Tailcall] Fix varargs handling of tailcalls.

* Remove new asserts and just leave comments.

* [Tailcall] No need to free RAX on non-reg calls.
2018-03-19 14:13:03 -07:00
Marek Safar 249a02d936 Updates codeowners (#7679) 2018-03-19 12:10:42 -04:00
Alexis Christoforides 5232bef282 Disable a flaky FileSystemWatcher test (#7578) 2018-03-19 15:42:23 +01:00
Brian Raderman 540ef385fa If a bad header is received from the client or the connection is broken,
send an internal VM_DISPOSE command to shut down the debugger thread
properly.  This prevents runtime hangs that occur during profile
events after the debugger shuts down.
2018-03-19 13:39:55 +01:00
davidlsharp1 68a9bbe69f Update Server.py to run on both python 2 and 3
just a small adjustment so users with both python 2 and 3 should be able to use the server.py
2018-03-19 10:25:52 +01:00
Alexis Christoforides 2f21177019 Merge pull request #7584 from alexischr/fix-gh-6940
[System.Net] Replace use of obsolete `SupportsIPv6` property.
2018-03-16 19:14:42 -04:00
Miguel de Icaza fe3c5134bf Implement C#7 binary literals (#7659)
* C# 7.0 binary literal support

* [mcs] Add another negative error test
2018-03-16 23:10:23 +01:00
Filip Navara 421e017479 [System.Windows.Forms] Fix bounds manipulation in Control.DrawToBitmap (#7629)
* Fix bounds manipulation in Control.DrawToBitmap and dispose objects properly.

* Add test for DrawToBitmap and fix one more bug in the implementation.

Fixes #7620
2018-03-16 23:05:27 +01:00
Ludovic Henry d3e2518fb6 [sdks] Fix concurrent building of MonoAotOffsetsDumper.exe + Simplify building of support library (#7652)
* [sdks] Simply building of support library

* [sdks] Fix concurrent building of MonoAotOffsetsDumper.exe

* [sdks] Cleanup of some targets
2018-03-16 14:26:15 -04:00
Vlad Brezae e36148dbd2 [tests] Prevent starvation by thread doing GCs (#7651)
On macOS the stopwatch's elapsed time was regularly getting skewed by 200-800ms. On average, yielding decreases the number of GCs by only 25%, while the elapsed time error is always less than 15ms.

Fixes #6999
2018-03-16 18:41:03 +01:00
Alexis Christoforides ec4c990af3 [System.Net] Replace use of obsolete SupportsIPv6 property.
The obsolete property was always set to false. Fixes https://github.com/mono/mono/issues/6940
2018-03-16 12:23:45 -04:00
Aleksey Kliger 43415f5f2b [threads] Add mono_uninstall_current_handler_block_guard
When a thread has a handler block guard installed (a `finally` block
that checks the exvar to see if it should issue abort the thread because
another thread called Abort on it), ves_icall_thread_finish_async_abort
is called.  It must clear the handler block guard for the current thread
in case the abort landed while we're in an abort protected block (a
cctor, most commonly).  In that case we must resume the interruption
when we leave all the abort protected blocks, not just at the end of an
intermitent catch clause.
2018-03-16 12:05:40 -04:00
Aleksey Kliger 92042c9732 [threads] Delay abort via handler block guard when in abort protected block.
mono_install_handler_block_guard is called when we want to signal an async
abort to another thread.  In case the other thread is executing native code
while in a `finally` block, the handler block guard sets a byte in the finally
block that used to trigger a self abort (`mono_thread_self_abort`).

This PR renames `mono_thread_self_abort` to
`ves_icall_thread_finish_async_abort`.  It also changes the code from
immediately executing a synchronous abort, to checking whether we are in an
abort protected block (most commonly - whether we were called from a cctor) and
in that case merely toggling the "async interrupt"
MonoInternalThread:thread_state bit.  If we're not in an abort-protected block,
trigger a self interrupt (which will turn into an abort exception in the
icall wrapper of `ves_icall_thread_finish_async_abort`).
2018-03-16 11:54:45 -04:00
Aleksey Kliger b0734593de [tests] Run abort-cctor.exe on the coop Jenkins job 2018-03-16 11:54:44 -04:00
Ludovic Henry ea4274f2eb Revert "[Tailcall] Proper fix for F# regression." (#7656)
This breaks ARM, I merged the previous PR too soon.

* Revert "[Tailcall] Proper fix for F# regression. (#7621)"

This reverts commit b2271853c3.
2018-03-16 11:54:05 -04:00
monojenkins fdbf51184a [msvc] Update csproj files (#7654) 2018-03-16 16:47:42 +01:00
jaykrell b2271853c3 [Tailcall] Proper fix for F# regression. (#7621)
* Revert "[Tailcall] Quick fix for building F#. Do not tailcall any method with a vtable_arg. (#7609)"

This reverts commit 8ceead93e3.

* [Tailcall] Correct fix for regression from change b4ee86154f.
Regression test not yet available.

* extra brace

* [jit] Incorrect code under mono --trace.

* [Tailcall] call_opcode == CEE_CALLVIRT does not matter for tailcall_membase, only virtual_ does.

* [Tailcall] Add FIXME for tail. not followed by ret. Correct behavior is to raise an exception, not fail an assert.

* [Tailcall] Add disabled debug code to break when compile a tailcall and/or execute a tailcall.

* [Tailcall] Add disabled debug code to try to tailcall any call followed by a ret.
This might be reasonable in the future, as well as a little data flow
analysis skipping nops and branches, as csc w/o -optimize outputs.

* [Tailcall] Add more tailcall tests, i.e. that would
have caught recent regression.

* [Tailcall] Replace #if 0 with MONO_DEBUG=tailcall_break_compile,tailcall_break_run,tailcall_try_all,tailcall_log,
tailcall_all. Consider MONO_TAILCALL_DEBUG instead.

* Revert "[Tailcall] Replace #if 0 with MONO_DEBUG=tailcall_break_compile,tailcall_break_run,tailcall_try_all,tailcall_log,"

This reverts commit 796d9490f672625189dfac47ff24b05f3fb65cbe.

* [Tailcall] Replace #if 0 with ifdefs:
define DEBUG_TAILCALL_BREAK_COMPILE   breakpoint in method-to-ir
define DEBUG_TAILCALL_BREAK_RUN 1     codegen outputs breakpoint
define DEBUG_TAILCALL_TRY_ALL 1       consider any call followed by ret, can expand later
define DEBUG_TAILCALL 1               low volume logging under -v instead of -v -v

* [Tailcall] Dial back tailcalls on ARM32, where there is no
volatile non-parameter register in the ABI, in which to pass
an extra parameter. (Why not just pass as a regular first/last parameter?)

* [Tailcall] Dial back untested architectures MIPS S390x PowerPC SPARC.

* [Tailcall] Copy tailcall-generic-cast-il.il to tailcall-generic-cast-nocrash-il.il and tailcall-generic-cast-conservestack-il.il

All platforms should be able to run it without crash,
but only some can run it and conserve stack.

* [Tailcall] Finish splitting tailcall-generic-cast into nocrash and conservestack variations.
All platforms can run nocrash, only some conservestack.
2018-03-16 11:27:57 -04:00
Aleksey Kliger 9b3893f84a [tests] Class should be viable even if cctor is aborted in in nested finally clause 2018-03-16 11:27:10 -04:00
Filip Navara 247a13b081 [System.Windows.Forms] Improve logic for closing complex ToolStripDropDown layouts. (#7630)
* Change the logic for closing ToolStrip drop-downs to work for more complex nesting.
* Implement SetOwner/GetParent(with_owner=true) behavior for X11 and Carbon backends.

Fixes the logic for closing ToolStripDropDowns for the following cases:

* ComboBox embedded in ToolStripDropDown as seen in KeePass when the window is resized to be small enough for the toolbar to overflow.
* ToolStripDropDown containing controls that open other ToolStripDropDowns and the user clicks on the top-level ToolStripDropDown. The child ToolStripDropDown, and only that child, should be closed in that case.
2018-03-16 15:32:52 +01:00
Filip Navara 5d23a12446 [System.Windows.Forms] Unify layout engines for Controls and ToolStripItems (#7612)
* Update AnchorLayoutEvents to match Windows behavior, make Bug82762 test platform independent.

* Cache affected layout control and property across SuspendLayout/ResumeLayout.

* Extend AnchorLayoutEvents test.

* Update for little nuances in the layout code.

* Unify flow layout for ToolStrips and FlowLayoutPanel by using the IArrangedContainer and IArrangedElement abstractions.

* Implement basic table layout support for ToolStrips.

* Clean up handling of FlowLayoutSettings.

* Fixes for default values of LayoutSettings in tool strips.

* Remove more of the duct tape holding the ToolStrip layouts together and replace it with calls into the LayoutEngine. Fix other small bugs that prevented ToolStrip overflows from being displayed correctly. Tested with KeePass.

* Fix indentation.

* Address code style issues.

* Remove unnecessary override.

* Fix indentation.

* Bump API snapshot submodule
2018-03-16 12:42:43 +01:00
jaykrell 6bdeea1503 [jit] Incorrect code under mono --trace. (#7627) 2018-03-16 03:06:02 +01:00
Johan Lorensson 395b37c286 Fix issue #7596 on Windows x64. (#7625)
* Fix error in vcxproj filter causing load error in Visual Studio.

* Fixes issue #7596 on Windows x64.

Passing value types in Windows x64 not fitting into register will be passed
by reference (ArgValuetypeAddrInIReg or ArgValuetypeAddrOnStack )
using a local variable allocated in caller’s frame.

Current implementation sized and marshaled the native struct correctly when
using pinvoke, but it sized the final local passed as reference to the native method
using the managed stack size instead of the native. This caused the final copy
into the local to overwrite other locals on stack if managed and native struct stack
sizes differed.

The fix is to flag the local variable used as stack parameter with its pinvoke state.
This makes sure the stack allocation size will be correct when using value types
passed on the stacks in pinvokes.

When running other unit tests with sequence points I hit a similar issue with
empty structs as return parameters (using [StructLayout (LayoutKind.Sequential, Size = 0)].
This commit includes a fix to ignore the return value if it’s an empty struct on Windows x64.
2018-03-15 20:02:06 -04:00
Vlad Brezae 5820d1fc66 [sgen] Use current nursery size when computing allowance (#7601)
* [sgen] Use current nursery size when computing allowance

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

* [sgen] Account for soft heap limit in allowance calculation

This is relevant in cases where the nursery size and soft heap limit are comparable in size.
2018-03-15 19:32:58 -04:00
Alex Rønne Petersen 52429673dc [mini] Don't inline methods if they're going to be instrumented for coverage. (#7554)
* [profiler] Fix wrong docs for mono_profiler_set_call_instrumentation_filter_callback ().

* [mini] Don't inline methods if they're going to be instrumented for coverage.

This handles coverage instrumentation in a similar fashion to call
instrumentation.

Fixes #6186.
2018-03-15 19:30:52 -04:00
Rodrigo Kumpera 851b36ecb2 [mini] Improve error reporting by using MonoError around more places. (#7607)
* [mini] Add MonoError to mini_get_shared_method_full and replace bucket of booleans with a flags enum.

* [mini] Eliminate mini_get_shared_method in favor of the variant that takes a MonoError.

* [mini] Rename GetSharedMethodFlags members to follow our coding conventions.

* [mini] Remove reduntant arguments in get_shared_inst.

* [mini] Inline partial in mini_get_shared_method_full.

* [mini] In mini_get_shared_method_full, rename gsharedvt to use_gsharedvt_inst and move it's value to depend on all_vt.

* [mini] Eliminate SHARE_MODE_ALL_VALUETYPES as its semantically equivalent to SHARE_MODE_GSHAREDVT.
2018-03-15 19:30:04 -04:00
Vlad Brezae 6906c9dc40 [interp] Don't crash when freeing delegate ftnptr (#7586)
* [interp] Don't crash when freeing delegate ftnptr

Leak it for now instead.

* [interp] Enable a few pinvoke tests
2018-03-15 19:13:22 -04:00
Joshua Peterson 2883e562e2 Fix platform-specific build issues (#7342)
* Fix platform-specific build issues

These changes allow some of the Mono code used by the debugger to build
on a few additional platforms. Specifically, this includes platforms:

* That don't have access to the full Win32 API
* That don't have access to the full Posix API
* That don't support IPv6

* Wrap `access` and `_access` in `g_access`

* Convert indentation to tabs

* Wrap `mktemp` and `_mktemp` in `g_mktemp`

* Wrap `open` and `_open` in `g_open`

* Wrap `write` and `_write` in `g_write`

* Fix indentation

* Use proper asserts

* Add a configure check for `access`

* Remove the use of HAVE_XBOXONE_WINAPI_SUPPORT

* Replace the previous definition of `g_open`

I missed that it was here in my earlier commit, and ended up redefining
it.

* Use `g_error` instead of `g_assert(0)`
2018-03-15 19:01:30 -04:00
Zoltan Varga 2d0eee9ae3 [jit] Fix partially shared constrained calls in llvmonly mode. (#7561)
* [tests] Avoid aot-ing the bcl libs twice in make fullaotcheck/llvmonlycheck.

* [jit] Fix partially shared constrained calls in llvmonly mode.

Fixes https://github.com/mono/mono/issues/7535.
2018-03-15 18:47:29 -04:00
Zoltan Varga ec319e6de7 [aot] Increase the buffer size in emit_exception_debug_info (). (#7638)
Fixes https://github.com/mono/mono/issues/7637.
2018-03-15 18:30:51 -04:00
Marek Safar ff61c7751a [build] Fixes mcs only dist build 2018-03-15 22:02:29 +01:00
Martin Baulig 4b88e2a0e2 [System]: Introduce WebCompletionSource<T> and use it in WebOperation. (#7358) 2018-03-15 21:50:32 +01:00
Alexis Christoforides 29c2ba9387 Merge pull request #7520 from alexischr/use-coreclr-GetTickCount
[mono-time] Replace mono_msec_boottime() with CoreCLR implementation.
2018-03-15 08:37:18 -04:00
Marek Safar 7e3a1ddaa0 [mcs] Fixes parsing ref-struct with partial keyword 2018-03-15 13:17:55 +01:00
Zoltan Varga 8728280550 [sdks] IOS fixes. (#7617)
* [sdks] Fix ios build.

* [sdks] Pass -DMONOTOUCH to the ios cross compiler builds. Compile monotouch/tvos/watchos profiles for the bcl build.
2018-03-15 09:07:29 +01:00
Rodrigo Kumpera 40b53bd2e0 [corlib] Handle multiple segments in IsolatedStored::GetFileNames. Fixes bxc #11771 2018-03-15 09:03:01 +01:00
jaykrell 8ceead93e3 [Tailcall] Quick fix for building F#. Do not tailcall any method with a vtable_arg. (#7609)
* [Tailcall] Quick fix for building F#.
Do not tailcall any thing with a vtable_arg.
This does often work, but not in F#, along with unbox in the call target.
The problem is being further reduced and debugged, but this will serve for now.

Regression is from change b4ee86154f.

* [Tailcall] Temporarily disable tests that depend on tailcall.
2018-03-14 19:22:03 -07:00
jaykrell 1c88a11545 [Coop thread threadpool mmap] Convert more functions to coop/handle. (#7097)
* [Coop] ves_icall_System_Threading_Thread_GetDomainID convert to coop/handle.

* [Coop] Convert ves_icall_System_Threading_Thread_ConstructInternalThread to coop/handle.

* [Coop] Convert ves_icall_System_Threading_Thread_Thread_internal to coop/handle.

* [Coop] Convert mono_threads_get_max_stack_size ves_icall_System_Threading_Thread_SystemMaxStackSize/typo SystemMaxStackStize to coop/handle.

* [Coop] Convert ves_icall_System_Threading_Thread_Suspend to coop/handle.

* [Coop] Convert ves_icall_System_Threading_Thread_Sleep_internal to coop/handle.

* [Coop] Convert ves_icall_System_Threading_Thread_SpinWait_nop to coop/handle.

* [Coop] Convert threadpool.c to handles -- no pointers, just MonoError.

* [Coop] Convert ves_icall_System_Threading_InternalThread_Thread_free_internal to coop/handle.

* [Coop] Convert mmap to coop/handle -- where there aren't pointers, just unused errors.

* [Coop] Rename some error to ioerror or win32error.

* [Coop] Convert ves_icall_System_Threading_Thread_current_lcid to coop/handle -- no pointers.

* [Coop] Convert mono_mmap_open_file, mono_mmap_open_handle to coop/handle.

* [Coop] Convert ves_icall_System_Threading_Thread_Yield to coop/handle (no pointers).

* [Coop] Layer ves_icall_System_Threading_Thread_ConstructInternalThread over new mono_thread_construct_internal.

* Ignore out of memory.

* Favor mono_error_set_generic_error over small factories (loss of breakpoint?).

* Restore accidentally lost barrier.

* [Coop] Mostly undo commit d7bdbcc9a2e76913861b69ff106f0bf9573e7ea6
Convert ves_icall_System_Threading_Thread_Sleep_internal to coop/handle.
for now.
It duplicates mono_thread_execute_interruption to mono_thread_execute_interruption_handle
which we want to ensure does not last long.
This should be achieved better by pull
  https://github.com/mono/mono/pull/6639
which removes all but one pointer user and leaves
that pointer user layered over handle instead of duplicating.

* [Coop] Fix Windows build.

* [Tailcall][Windows] Add missing error parameter.
2018-03-14 13:50:10 -07:00
monojenkins 239aad5265 [msvc] Update csproj files 2018-03-14 21:47:30 +01:00
Alex Rønne Petersen 34b4d35fb7 [runtime] Clean up symbol names to not pollute the global namespace.
Offending symbols found with:

    nm -D --defined-only libmonosgen-2.0.so | cut -d ' ' -f 3 | grep -v '^eg_\|mono_\|monoeg_\|wapi_\|ves_icall_\|sgen_\|mini_\|__jit_debug.*$' | sort

Fixes #7565.
2018-03-14 18:50:36 +01:00
Alex Rønne Petersen 1d70b62770 [profiler] Increment ref count of an image's method while we're keeping around pointers to it.
Fixes #6211.
2018-03-14 18:34:50 +01:00
Bernhard Urban 6b116cca18 [merp] only target macOS, HOST_DARWIN includes iOS etc. as well 2018-03-14 09:13:53 +01:00
Marek Safar 40924c47ba [Mono.Data.Sqlite] Throw better exception for missing mobile support 2018-03-14 07:44:47 +01:00
jaykrell a856f8d8e4 [Tailcall] Cleanup is_supported_tail_call, put more logic in it, and be sure not to tailcall_mem_base if not supported (i.e. virtual_ not just CALLVIRT) (#7608)
* [Tailcall] Cleanup is_supported_tail_call to use language-base short circuit.

* [Tailcall] Move more of the logic into is_supported_tail_call.

* [Tailcall] Be sure not to use TAILCALL_MEM_BASE if not supported.
i.e. not if virtual_, besides CALLVIRT -- they are not quite the same.
2018-03-13 22:19:20 -07:00
Alexander Köplinger 7e7d8a3b4f [Facades] Make System.Net.Http.Rtc.dll a net_4_x only facade (#7590)
* [Facades] Make System.Net.Http.Rtc.dll a net_4_x only facade

It doesn't make sense on mobile (see https://github.com/mono/mono/pull/7541#issuecomment-372434424) but we'd like to keep it in net_4_x to match Desktop .NET

* Bump API snapshot submodule
2018-03-13 18:30:09 +01:00
monojenkins 5f572ff7a6 [msvc] Update csproj files 2018-03-13 17:36:22 +01:00
Alexander Köplinger 6e246cf613 [Facades] Move types from Facades into class libraries (#7574)
We implemented them in the facades until now but in .NET 4.7.1
they were promoted into the regular class libraries.

Use PLATFORM_DEBUG_FLAGS for IL-less assemblies

Also replace some files with corefx that were identical.
2018-03-13 12:28:43 +01:00
Marek Safar 4e3389667f [System.Xml] Update source file location from commit d4816ef1ab 2018-03-13 08:49:00 +01:00
Filip Navara 8c3d7c81af [System.Windows.Forms] Fix custom test targets in makefile. (#7571)
* Fix test builds to include mscorlib.

* Disable PrintPreviewControlTest on machines without an installed printer.

* Fix test ignore condition.
2018-03-12 20:33:47 +01:00
Filip Navara 9dbd080c29 [System.Windows.Forms] Update code for top-level windows (#7570)
* Fix the test for OnCreateControl.

* Do not create child controls until the parent is created.

* Fix showing menus after CreateControl behavior change.

* Make all top-level controls call SetTopLevel.

* Fix TopLevelControl property to actually return top-level controls, not just Forms.
2018-03-12 17:18:36 +01:00
Alexis Christoforides e85dbca0f2 Disable TestBug8592BasicOperations test
https://github.com/mono/mono/issues/7343
2018-03-12 11:57:39 -04:00
Filip Navara b1d2b85825 Make Form scaling tests platform independent. 2018-03-12 16:09:18 +01:00
Yauheni Pakala cdb9b90baa Correcting typos for ISSUE_TEMPLATE.md (#7575) 2018-03-12 15:52:53 +01:00
monojenkins 99198da52b [msvc] Update csproj files (#7559) 2018-03-12 13:23:03 +01:00
Alexis Christoforides 16b3884854 Disable bug-80307.exe
https://github.com/mono/mono/issues/7568
2018-03-12 01:28:01 -04:00
Zoltan Varga a601516ca1 [tests] Disable delegate-15.exe in the full-aot profile. (#7529)
* [jit] Avoid calling mono_class_vtable () for open constructed types.

* [tests] Disable delegate-15.exe in the full-aot profile.
2018-03-11 11:05:04 -04:00
Zoltan Varga 8f926ed464 [ppdb] Set the column number in mono_ppdb_lookup_location ().
Fixes https://github.com/mono/mono/issues/6812.
2018-03-11 09:47:14 +01:00
Jonathan Chambers 78de671964 Swap bytes for port number as Win32 API returns in network order. 2018-03-11 09:44:32 +01:00
Calvin 3b0c0bd1cf Build system tweaks for AIX (#7542)
* use this version of libintl because that's what GNU uses

	* tweak BTLS CFLAGs to make it work and be coonsistent
2018-03-10 14:47:48 +01:00
jaykrell 486036b696 Revert "[Tailcall] Do not create never-executed trampoline for tail.call self. (#7331)" (#7550)
This reverts commit 8e4f0d8ff4.
2018-03-10 13:03:22 +01:00
Alexis Christoforides 06a4273d73 [mono-time] Replace mono_msec_boottime() with CoreCLR implementation. Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58413 2018-03-10 00:30:42 -05:00
Alexander Köplinger e456f91053 Bump api-snapshot 2018-03-10 04:16:18 +01:00
Alexander Köplinger 9a2b5324ee [Facades] Add missing Facades that exist in .NET 4.7.1 (#7541)
Some of them we had on mobile only, others were missing completely.

Fixes https://github.com/mono/mono/issues/7536
2018-03-10 04:08:53 +01:00
Aleksey Kliger (λgeek) b6be2e11a7 [threads] Fix race between abort socket syscall and thread shutdown (#7507)
* [threads] Fix race between abort socket syscall and thread shutdown

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

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

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

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

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

* [threads] Simplify mono_thread_info_abort_socket_syscall_for_close

Call mono_thread_info_lookup while holding the thread info suspend lock.
We no longer need to check for STATE_DETACHED because removing MonoThreadInfo on
detach is done while holding the suspend lock.
2018-03-09 17:53:59 -05:00
Alexis Christoforides 4ae98fb31b Merge pull request #7515 from kumpera/le_debugger_cleanup
[WASM] Initial code drop for debugger
2018-03-09 16:28:02 -05:00
Bernhard Urban 868a402137 [metadata] split IL generation code into seperate compilation units. (#7487)
* [metadata] split IL generation code into seperate compilation units.

* [metadata] move ENABLE_ILGEN definition to configure

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

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

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

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

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

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

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

* [fixup!] fix windows build

* [fixup!] resolve merge conflicts with class getter commits

* marshal.c: b8da973620
* sgen-mono.c: 8ba4947f7a

at some point I gave up to resolve merge conflicts and worked through
errors/warnings by compiling with
> `CFLAGS=-DENABLE_CHECKED_BUILD_PRIVATE_TYPES=1`
so the result is likely a bit different

* redo lost changes from 57f3f34e60

* redo lost changes from 52514effbf

* [fixup!] fix array marshal

* [method-builder] use eglib types

review comment by Ludovic,
https://github.com/mono/mono/pull/7375#discussion_r171876337

* [marshal] remove stelem strings from header

review comment by Rodrigo,
https://github.com/mono/mono/pull/7375#discussion_r171921029
2018-03-09 14:19:04 -05:00
Vlad Brezae 826f15a509 [interp] Fix return of value type from interp to native (#7519)
Fixes test_0_marshal_struct_delegate
2018-03-09 14:13:26 -05:00
jaykrell f24a6d622b gboolean g_is_usermode_native_debugger_present (void). (#7488)
* gboolean g_is_usermode_native_debugger_present (void).
i.e. Win32 IsDebuggerPresent which is just call mov mov ret.
Other slower methods on other systems if possible and unintrusive (OSX).
This is very useful as in:
   if (g_is_usermode_native_debugger_present ()) G_BREAKPOINT
"native" meaning "not managed"
"usermode" meaning "not kernel"
Both other kinds exist and are detected differently.

* Move new debugging utility from glib to mono/utils.

* Redo it with CoreCLR as basis. https://github.com/dotnet/coreclr/blob/master/src/pal/src/init/pal.cpp

* Link to a specific stable revision, not master.
https://raw.githubusercontent.com/dotnet/coreclr/f1c9dac3e2db2397e01cd2da3e8aaa4f81a80013/src/pal/src/init/pal.cpp

* Use a clearer form of boolean normalization.

* Update Visual Studio project files.

* Fix include path, remove unnecessary boolean canonicalization, spell out words, swap int/boolean.

* Header got missed in the move from glib.
2018-03-09 14:12:27 -05:00
Alexander Kyte 03914603a3 [runtime] Add MS telemetry reporter for unmanaged exceptions (#7451)
* [runtime] Add optional Microsoft Telemetry unmanaged dumper

* [runtime] Add icall to configure MERP options / enable it
2018-03-09 11:07:33 -05:00
Alexis Christoforides d3a4e19f3c Merge pull request #7533 from akoeplinger/disable-test
[System] Disable SocketTest.AcceptBlockingStatus
2018-03-09 10:33:55 -05:00
Alexander Köplinger 63e5e80d3a [bcl] Fix test build with mcs (#7512)
It'd fail with the following errors since e6de24c2d1:

```
MCS     [net_4_x-darwin] net_4_x_System.Data.OracleClient_test.dll
Test/System.Data.OracleClient.jvm/MonoTests.System.Data.Utils/ADONetTesterClass.cs(337,71): error CS0012: The type `System.Xml.Serialization.IXmlSerializable' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

...

MCS     [net_4_x-darwin] net_4_x_System.Json.Microsoft_test.dll
Test/System.Json/JsonValueTest.cs(23,12): error CS0012: The type `System.Dynamic.IDynamicMetaObjectProvider' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

...

MCS     [net_4_x-darwin] DummyAssembly.dll
error CS0518: The predefined type `System.Object' is not defined or imported
error CS0518: The predefined type `System.ValueType' is not defined or imported
```

* [ci] Add compiling class lib tests to mcs job
2018-03-09 14:41:24 +01:00
Filip Navara 14485be705 [System.Windows.Forms] Fix lifetime of Graphics objects in TextBox controls (#7491)
* Avoid recalculating Document on TextBox controls without handles. Properly dispose graphic contexts.

* Make sure all CreateGraphics calls are wrapped in using block.

* Avoid a couple more no-op calls in RichTextBox.
2018-03-09 14:24:57 +01:00
Alexander Köplinger b9d52fc4f1 [System] Disable SocketTest.AcceptBlockingStatus
It frequently fails on ARM: https://github.com/mono/mono/issues/6513
2018-03-09 14:12:39 +01:00
Filip Navara 91b64b4560 [System.Windows.Forms] Fix bugs in PrintPreviewControl. (#7493)
* Fix default values and the StartPage property in PrintPreviewControl.

* Do not cache resized bitmaps in PrintPreviewControl if the source data are scalable metafiles.
2018-03-09 14:12:19 +01:00
Jonathan Chambers ee30689c18 Implement native ValueType Equals and GetHashCode support for pointer fields 2018-03-09 14:11:26 +01:00
Vlad Brezae 4532cf5fd5 [interp] Fix stack usage after throw (#7461)
* [interp] Use jit's dead basic block detection

Using generating_code doesn't cover all cases since it doesn't do basic block liveness calculation.

* [interp] Throw instructions clear the stack

* [interp] Add stack check at return
2018-03-09 14:39:58 +02:00
Zoltan Varga 523ba159c2 [sgen] Fix the clearing of bits in the gc descriptor bitmap when using weak fields.
Fixes https://github.com/mono/mono/issues/7378.
2018-03-09 13:30:57 +01:00
Ludovic Henry 660e166c7b [eglib] Fix typo in g_assertf (#7458) 2018-03-08 19:15:00 -05:00
Zoltan Varga c745a9575d [jit] Move the check for open constructed types later in mono_jit_compile_method_with_opt (), this function can receive (#7494)
gshared methods in llvmonly mode.

Fixes https://github.com/mono/mono/issues/7364.
2018-03-08 19:10:12 -05:00
Rodrigo Kumpera 25f4ef2789 [wasm] Make switching between debug/release builds easy. Build pdb files. 2018-03-08 15:12:29 -08:00
Rodrigo Kumpera eba41fd88a [wasm] Update SDK driver to handle debugging. 2018-03-08 15:11:56 -08:00
Rodrigo Kumpera 334ddbd3ef [wasm] Initial support for debugging. 2018-03-08 15:09:09 -08:00
Rodrigo Kumpera 1a56fe6a15 [wasm] Fix unwinding to work with the general unwinder. 2018-03-08 15:03:59 -08:00
Vlad Brezae ccbb873498 [interp] Fix pinvoke from dynamic methods
Fixes test_0_calli_dynamic
2018-03-09 00:36:33 +02:00
Vlad Brezae 4ad92ef05f [interp] Fix detection of pinvoke call 2018-03-09 00:36:33 +02:00
Vlad Brezae 940f2d1a9f [interp] Fix runtime invoke of pinvoke method 2018-03-09 00:36:33 +02:00
monojenkins e0f8597e9c Fix generated file when passing --bundled-header (#6736)
There would be a compilation error in the XA build as follow:

```
obj/Release/bundles/armeabi-v7a/temp.c: In function 'install_aot_modules':
obj/Release/bundles/armeabi-v7a/temp.c:49:25: error: 'MONO_AOT_MODE_NORMAL' undeclared (first use in this function)
  mono_jit_set_aot_mode (MONO_AOT_MODE_NORMAL);
                         ^
obj/Release/bundles/armeabi-v7a/temp.c:49:25: note: each undeclared identifier is reported only once for each function it appears in
```
2018-03-08 17:20:29 -05:00
jaykrell b4ee86154f [Tailcall] tail.callvirt support for AMD64 JIT (#7426)
* [Tailcall] Fix the F# code; let rec functiona ()= printfn "%d" 1; functionb ()
	and functionb ()= functiona ()
	let ()= functiona ()

The test case and the fix are from https://bugzilla.xamarin.com/show_bug.cgi?id=25224.

Just bringing in change ca0dd5c0bb:
	commit ca0dd5c0bb
	Author: Zoltan Varga <[email protected]>
	Date:   Thu Dec 11 15:37:29 2014 -0500
	[jit] Enable tail calls from gshared code. Fixes #25224.

Previously it was reverted due to performance regression, which has been fixed.
The problem was that use vs. patch of jmps was using inflated vs. non-inflated code.
Fixed here: https://github.com/mono/mono/commit/fe95e4b34b00caa8073dfa3b4473a43182abcbbb

The IL is:
  .method public static !!a  functiona<a>() cil managed
  {
.
.
.
    IL_001d:  tail.
    IL_001f:  call       !!0 '1'::functionb<!!0>()
    IL_0024:  ret
  }

  .method public static !!a  functionb<a>() cil managed
  {
    IL_0000:  tail.
    IL_0002:  call       !!0 '1'::functiona<!!0>()
    IL_0007:  ret
  }

* [Tailcall] Add tail.callvirt support to AMD64 JIT. Not yet
any other architecture (arm, x86, etc.) or scenario (AOT, LLVM,
interpreter, etc.)

This is based on F# that stack overflows to report failure:
    type A() =
        member this.f2 (a) = if a > 0 then this.f1(a - 1)
                             else 1
        member this.f1 (a) = if a > 0 then this.f2(a - 1)
                             else 2

    let a = A()
    printfn "%d" (a.f1(1000 * 1000 * 10))

and in turn C#, self checking instead of stack overflowing:

    using System;
    using System.Runtime.CompilerServices;
    using static System.Runtime.CompilerServices.MethodImplOptions;

    unsafe class A
    {
        static int check (long stack1, long stack2)
        {
            return (stack1 == stack2) ? 0 : 1;
        }

        [MethodImpl (NoInlining)]
        public virtual int f1 (int counter, long initial_stack, long current_stack)
        {
            int local;
            if (counter > 0)
                return f2 (counter - 1, initial_stack, (long)&local);
            return check ((long)&local, current_stack);
        }

        [MethodImpl (NoInlining)]
        public virtual int f2 (int counter, long initial_stack, long current_stack)
        {
            int local;
            if (counter > 0)
                return f1 (counter - 1, initial_stack, (long)&local);
            return check ((long)&local, current_stack);
        }

        [MethodImpl (NoInlining)]
        public static void Main ()
        {
            int stack;
            Environment.Exit (new A().f1 (100, (long)&stack, 0));
        }
    }

And then IL, inserting tail prefixes and cleaning up a little:

    .assembly extern mscorlib { }

    .assembly b { }

    .class A
    {
    .method static int32 check(int64 stack1, int64 stack2)
    {
            ldarg.0
            ldarg.1
            beq.s IL_0006
            ldc.i4.1
            ret

    IL_0006:
            ldc.i4.0
            ret
    }

    .method newslot virtual instance int32 f1 (int32 counter, int64 initial_stack, int64 current_stack) noinlining
    {
	    .locals init (int32 V_0)
	    ldarg.1
	    ldc.i4.0
	    ble.s IL_0013

	    ldarg.0
	    ldarg.1
	    ldc.i4.1
	    sub
	    ldarg.2
	    ldloca.s V_0
	    conv.u
	    conv.u8
	    tail. callvirt instance int32 A::f2 (int32, int64, int64)
	    ret

    IL_0013:
	    ldloca.s V_0
	    conv.u
	    conv.u8
	    ldarg.3
	    tail. call int32 A::check (int64, int64)
	    ret
    }

    .method newslot virtual instance int32 f2 (int32 counter, int64 initial_stack, int64 current_stack) noinlining
    {
	    .locals init (int32 V_0)
	    ldarg.1
	    ldc.i4.0
	    ble.s IL_0013

	    ldarg.0
	    ldarg.1
	    ldc.i4.1
	    sub
	    ldarg.2
	    ldloca.s V_0
	    conv.u
	    conv.u8
	    tail. callvirt instance int32 A::f1 (int32, int64, int64)
	    ret

    IL_0013:
	    ldloca.s V_0
	    conv.u
	    conv.u8
	    ldarg.3
	    tail. call int32 A::check (int64, int64)
	    ret
    }

    .method static int32 Main () noinlining
    {
	    .entrypoint
	    .locals init (int32 V_0)
	    newobj instance void A::.ctor()
	    ldc.i4 0x100
	    ldloca.s V_0
	    conv.u
	    conv.u8
	    ldc.i4.0
	    conv.i8
	    tail. callvirt instance int32 A::f1 (int32, int64, int64)
	    ret
    }

    .method instance void .ctor ()
    {
	    ldarg.0
	    tail. call instance void [mscorlib]System.Object::.ctor ()
	    ret
    }

    }

* Allow comments anywhere in .md line, not just the start.

* [Tailcall] Avoid changing ins->sreg1 in OP_TAILCALL_MEMBASE.
This was likely based on OP_CALL_REG which has more reason to do
it but still not a good example.

* [Tailcall] Rollback x86/arm/ppc/llvm until changes are actually
complete/working.

* [Tailcall] Fix code formating: default at end, open brace at right on
previous line.

* [Tailcall] Consolidate comments out of tailcall-virt.cs and tailcall-virt.fs and into tailcall-virt.il.
Make IL less unreadable with whitespace.
Disable instead of enable tailcall-virt test.

* [Tailcall] Combine assert and default that it made unreachable and make assert more informative.

* [Tailcall] Remove a newline.

* [Tailcall] Add additional verbose output.
Add 3 tests that would seem focused on this change and would
seem to be fixed -- all three pass on desktop, all three fail
on previous mono, two are fixed now -- one needs more debugging --
generic value types.

Problem is probably:
is_supported_tail_call:
	if (fsig->hasthis && cmethod->klass->valuetype)
		/* this might point to the current method's stack */
		supported_tail_call = FALSE;

* [Tailcall] Allow tail.callvirt on AMD64 AOT now, having tested it.

* [Tailcall] LLVM support for tail.callvirt/OP_TAILCALL_MEMBASE, now having tested it.

* [Tailcall] Disable new tests for interpreter as I had intended.

* [Tailcall] Consolide interpreter disabling of tailcall tests.
2018-03-08 16:39:12 -05:00
Martin Baulig c2bf82fb98 [System]: WebRequestStream now throws correct exception on cancellation (#7074). 2018-03-08 20:03:22 +01:00
jaykrell 8e4f0d8ff4 [Tailcall] Do not create never-executed trampoline for tail.call self. (#7331)
https://github.com/mono/mono/issues/7328

test case:
```
.assembly extern mscorlib { }

.assembly a { }

.class b
{

.method static void f3<f3>() noinlining
{
tail. call void b::f3<!!0>()
ret
}

.method static void main()
{
.entrypoint
call void b::f3<int32>()
ret
}

}
```

ends up on NT/amd64 as:

```
0:000> uf .
0000016c`3c951420 55              push    rbp
0000016c`3c951421 488bec          mov     rbp,rsp
0000016c`3c951424 4883ec20        sub     rsp,20h
0000016c`3c951428 488b0424        mov     rax,qword ptr [rsp]
0000016c`3c95142c 48894510        mov     qword ptr [rbp+10h],rax
0000016c`3c951430 488b442408      mov     rax,qword ptr [rsp+8]
0000016c`3c951435 48894518        mov     qword ptr [rbp+18h],rax
0000016c`3c951439 488b442410      mov     rax,qword ptr [rsp+10h]
0000016c`3c95143e 48894520        mov     qword ptr [rbp+20h],rax
0000016c`3c951442 488b442418      mov     rax,qword ptr [rsp+18h]
0000016c`3c951447 48894528        mov     qword ptr [rbp+28h],rax
0000016c`3c95144b 488d6500        lea     rsp,[rbp]
0000016c`3c95144f 5d              pop     rbp
0000016c`3c951450 49bb2014953c6c010000 mov r11,16C3C951420h
0000016c`3c95145a 41ffe3          jmp     r11
```

w/ or w/o change, but skipping some steps w/ change.
The move to r11 is initially to a trampoline w/o change, but gets
patched out before it is executed, as compiling the function finishes.

Notice that the next case is similar, method vs. jmp.
2018-03-08 13:40:14 -05:00
jaykrell ab67bcfd0b Provide compile-tests-parallel that honors the command line so e.g. (#7479)
make -j9 compile-tests-parallel is faster than make compile-tests.
2018-03-08 13:38:06 -05:00
monojenkins 3e8f4f7db8 [msvc] Update csproj files (#7497) 2018-03-08 17:14:32 +01:00
Vlad Brezae a5f980dc00 [interp] Let the backend deal with thiscall cconv
This cconv is special only on x86 anyway.
2018-03-08 16:59:45 +02:00
Vlad Brezae 8b2ca1344f [interp] Fix EH with exception thrown from icall 2018-03-08 16:59:45 +02:00
monojenkins da7650d3d9 Bump API snapshot submodule 2018-03-08 11:12:53 +01:00
EgorBo 03b030d921 TaskAwaiter from CoreFX 2018-03-08 11:12:53 +01:00
Aleksey Kliger 12557bec39 [metadata] An array is not an IEnumerator`1
Address https://github.com/mono/mono/issues/7093 in kind of an adhoc way.

The correct fix is to make
```
    ((IEnumerable<U>) (new T[] {...})).GetEnumerator()
```
return an `IEnumerator<U>` (like .NET does) instead of `IEnumerator<T>`
and to stop marking IEnumerator as an array special interface.
2018-03-08 10:50:53 +01:00
Aleksey Kliger 1140ec5394 [test] An array is not an IEnumerator`1
regression test for Regression test for https://github.com/mono/mono/issues/7093
2018-03-08 10:50:53 +01:00
Aleksey Kliger c0a5753b02 [metadata] Add IEnumerator`1 to MonoDefaults struct 2018-03-08 10:50:53 +01:00
Marek Safar 36a471f14e [System] Remove compiler config sections for types which cannot be instantiated
Fixes #7389
2018-03-08 10:20:47 +01:00
Konstantin Khitrykh 32d06fd803 [corlib] Fix Type.GetInterface() to find implemented interface when "ignoreCase: true" is used (#7464)
Fixes #6579
2018-03-07 23:58:59 +01:00
Ludovic Henry 1181815eed [w32handle] Lower minimum memory usage (#7465)
Fixes https://github.com/mono/mono/issues/7460
2018-03-07 16:48:32 -05:00
Marek Safar e6de24c2d1 [build] Unify DEFAULT_REFERENCE handling so I can override it with TARGET_NET_REFERENCE for individual tools 2018-03-07 22:48:05 +01:00
monojenkins 73859e3df2 [msvc] Update csproj files 2018-03-07 17:04:06 +01:00
Aleksey Kliger e64cd8cc8d [profiler] Use accessor functions for MonoClass fields 2018-03-07 10:49:53 -05:00
Ankit Jain 4e6f5f10fd nuget-hash-extractor: Add msbuild extensions nuget version from vs15.6 msbuild branch
Version `2.1.100-preview-62617-01` from:

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

Also, update the list in the runtime and deniedAssembliesList.txt
installed for use by msbuild.
2018-03-07 16:38:18 +01:00
Ankit Jain 45f30c307b nuget-hash-extractor: Change the nuget repo name to use for
fetching Microsoft.NET.Build.Extensions nuget from `cli-deps` to
`dotnet-core`. Both of these should have the same nugets but sometimes
seem to be off by one.
2018-03-07 16:38:18 +01:00
Egor Bogatov 695acd0a0b System.Text.RegularExpressions from CoreFX (#7363)
* Regex from corefx.
2018-03-07 14:47:57 +01:00
Alexander Köplinger 85b605042b [acceptance-tests] Actually disable gcsuppressfinalize.exe test
d1ed53624b wasn't enough, it needs to be removed from the CORECLR_COREMANGLIB_TEST_CS_SRC list.
2018-03-07 11:20:09 +01:00
Alex Rønne Petersen c89abe5467 Bump boringssl submodule.
To pick up:

commit 345755cb49ee1979df280399f03178aae0b4029a
Author: Alex Rønne Petersen <[email protected]>
Date:   Tue Mar 6 13:40:16 2018 +0100

    Add build support for RISC-V. (#6)
2018-03-07 07:08:08 +01:00
Bernhard Urban 47df243579 [mini] unpack function pointers for jump patching 2018-03-06 22:15:11 -05:00
Bernhard Urban 095519c899 [ppc] update define usages for creating/unpacking function descriptors 2018-03-06 22:15:11 -05:00
Bernhard Urban 4fea7fb745 [ppc] use new patching machinery 2018-03-06 22:15:11 -05:00
Bernhard Urban ffaf5ffe0f [mini-runtime] unbreak platforms where MONO_ARCH_HAVE_PATCH_CODE_NEW isn't defined 2018-03-06 22:15:11 -05:00
Aleksey Kliger (λgeek) 8ba4947f7a [metadata] Use MonoClass getters in the rest of metadata/ (#7354)
Use `MonoClass` getters in the rest of the code in `mono/metadata/`
1. Add `mono_class_contextbound_bit_offset()` which returns the bit offset of `MonoClass:contextbound` which is needed by `remoting.c`
2. Add `mono_class_create_array_fill_type` which is used by sgen to write over unused nursery fragments.
3. Alllow `metadata-cross-helpers.c` to access `MonoClass` fields directly. Rationale: it needs to compute field offsets.
4. Everything else shouldn't have any functional changes.

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

---

* [metadata] Fix warnings in class-accessors.c

Fix warnings about missing prototypes for class-abi-details.h functions.

* [cominterop] Use MonoClass getters in cominterop.c

* [loader] Use MonoClass getters in loader.c

* [runtime] Use MonoClass getters in icall.c

* [metadata] Add mono_class_contextbound_bit_offset() accessor

Compute the bit offset of MonoClass:countextbound

* [remoting] Use MonoClass getters for remoting.c

* [boehm] Use MonoClass getters in boehm-gc.c

* [callspec] Use MonoClass getters in callspec.c

* [sre] Use MonoClass getters in dynamic-image.c

* [w32] Use MonoClass getters in w32process.c

* [debug] Use MonoClass getters in mono-debug.c

* [runtime] Use MonoClass getters in method-builder.c

* [runtime] Use MonoClass getters in security-manager.c

* [coop] Use MonoClass getters in handle.c

* [reflection] Use MonoClass getters in reflection.c

* [sgen] Add mono_class_create_array_fill_type

Used by sgen to fill nursery fragments before a collection

* [sgen] Use MonoClass getters in sgen-mono.c and the GC bridges

* [verify] Use MonoClass getters in the verifier

* [sre] Use MonoClass getters in SRE

* [custom_attr] Use MonoClass getters in custom-attrs.c

* [metadata] Use MonoClass getters in gc.c

* [security-core-clr] Use MonoClass getters in security-core-clr.c

* [metadata] Use MonoClass getters in metadata.c

* [metadata] Allow metadata-cross-helpers to access MonoClass fields

* [coop handle] Use MonoClass getter in mono_handle_unbox_unsafe
2018-03-07 01:27:03 +01:00
Filip Navara 6f225e6176 [System.Windows.Forms] Fix inconsistent state of Document object (#7422)
* Update Document selection before resuming layout operations that can access it, such as recalculation of scrollbars.

* Add test case for bug #6357.
2018-03-06 17:52:16 +01:00
jaykrell 9e1ba501ff Fix for gcc 4.4; nominal support for older. (#7419)
attribute(deprecated(message)) was introduced in gcc 4.5.
attribute(deprecated) was introduced in gcc 4.0?
pragma GCC diagnostic 4.2?
https://github.com/mono/mono/issues/7408
2018-03-06 10:13:38 -05:00
jaykrell 56263d4a75 [mini] Virtual call target is never known, remove dead code. (#7424) 2018-03-06 09:56:48 -05:00
Marek Safar 62c8557a7a [System.Security] Fixes decoding of CMS/PKCS #7 messages with an explicit cryptographic object identifier 2018-03-06 15:45:59 +01:00
Rolf Bjarne Kvinge 02abf28216 [corlib] Ignore TimeZoneTest.TestCtors on iOS under certain conditions due to an Apple bug. (#7429)
Fixes https://github.com/xamarin/maccore/issues/629.
2018-03-06 14:31:53 +01:00
Alexander Köplinger d1ed53624b [acceptance-tests] Disable gcsuppressfinalize.exe test that started failing
See https://github.com/mono/mono/issues/7432
2018-03-06 13:55:21 +01:00
Filip Navara b664dfe79f [System.Windows.Forms] Updated unit tests (#7405)
* Update many of the unit tests to pass on Windows.

* Update the TextBox default colors.

* Update ToolStripManager.RevertMerge error handling.

* Update menu item cloning to pass unit tests.

* Update PreviewKeyDownEventArgs.KeyValue behavior.

* Update return value of AccessibleObject.State.

* Update TextBoxBase.IsInputKey to treat backspace as input key.

* Update constructors of BindingCompleteEventArgs to properly set the Cancel property.

* Fix and cache ToolStrip[Item] default font.

* Run fixed layout unit tests.

* Silence the warnings and debug prints in unit tests.

* Update the default colors for ComboBox to match the TextBox.

* Remove superfluous debug prints that are already checked by Assert anyway.

* Make sure HandleCreated event is called for MDI children.

* Do not return zombie handles from CreateWindow, it causes invalid window handles to be sent to X11 functions and lot of noise in the unit test output.

* Do not return zombie handles from CreateWindow, it causes invalid window handles to be sent to X11 functions.
2018-03-06 09:08:14 +01:00
Bernhard Urban 30ad219533 [mixed mode] skip gsharedvt_out_sig_wrapper frames and improve regression test 2018-03-05 18:15:34 -05:00
Bernhard Urban dab1ffc081 [interp] use mini infrastructure for stack walking
this was left over code from times where mini didn't understand
interpreter frames.
2018-03-05 18:15:34 -05:00
Alexander Köplinger a785bd16e9 Merge pull request #7401 from filipnavara/swf-layout
[System.Windows.Forms] Layout fixes

This is accumulation of layout related fixes from https://github.com/filipnavara/mac-playground. Some of the patches were rewritten, small bugs were fixed and it passes the unit tests now.

All the changes are listed in the commits, but the main ones are listed here:
- Rewritten TableLayout, which handles many quirks and unifies the code for GetPreferredSize and the actual layout.
- Fixed FlowLayoutPanel.GetPreferredSize to respect flow breaks.
- Many of the GetPreferredSize implementations fixed to return sensible values. For container controls with default layout the implementation is moved to DefaultLayout and shared.
- Implemented cache for GetPreferredSize that greatly improves the performance for complex layouts.
- Cleaned up implementations of SetBounds, SetBoundsCore and UpdateBounds that improve the performance by reducing the number of re-computations of the same values.
- Moved the calculation of dist_right and dist_bottom for anchor layouts to DefaultLayout.InitLayout.
2018-03-05 23:43:41 +01:00
Calvin Buckley d2bf59dd3f PPC support for BoringTLS
Doesn't seem to be completely working: AIX triggers the trampoline
bug in the ctor for contexts, and Linux inits fine but seems to be
using SSLv3?
2018-03-05 22:22:11 +01:00
Alex Rønne Petersen ee4ed72695 [acceptance-tests] Add an env var to turn on some Mono debugging options. (#7386) 2018-03-05 15:23:08 -05:00
jaykrell 4af9e3a511 [Coop] Convert System.Enum to coop/handle. (#7131)
* [Coop] Add mono_exception_new_argument.

* [Coop] Add mono_set_pending_exception_handle.

* [Coop] Convert System.Enum.InternalBoxEnum / ves_icall_System_Enum_ToObject to coop/handle.

* [Coop] Add mono_handle_unbox_unsafe.

* [Coop] Convert System.Enum.InternalCompareTo / ves_icall_System_Enum_compare_value_to to coop/handle.

* [Coop] Convert System.Enum.get_hashcode / ves_icall_System_Enum_get_hashcode to coop/handle.

* [Coop] Convert System.Enum.InternalGetUnderlyingType / ves_icall_System_Enum_get_underlying_type to coop/handle.

* [Coop] Convert System.Enum.InternalHasFlag / ves_icall_System_Enum_InternalHasFlag to coop/handle.

* [Coop] Convert System.Enum.get_value / ves_icall_System_Enum_get_value to coop/handle.
2018-03-05 12:13:13 -08:00
Alexander Köplinger 7c34f0c746 [packaging] Support setting the FULL_VERSION number via env vars (#7414)
The Linux build currently just displays "tarball" since we don't
have the .git directory when building the Linux packages.

This allows us to pass environment variables that contain the
branch+commit to the build for generating version.h so we can
show the more detailed info like on OSX.
2018-03-05 20:16:51 +01:00
Alexander Köplinger f546b95edf [runtime] Increase the BCL trampoline count (#7409)
Same as in https://github.com/mono/mono/pull/6033 to fix the following error on the FullAOT armel/armhf builds:

```
Ran out of trampolines of type 0 in '/home/builder/jenkins/workspace/test-mono-mainline-fullaot/label/debian-9-armhf/mcs/class/lib/testing_aot_full/mscorlib.dll' (limit 9000)
```
2018-03-05 19:19:31 +01:00
Zoltan Varga fe95e4b34b [jit] Fix the patching of tail calls for gshared methods, the caller and the caller were using different instantiations to search the jump_target_hash. 2018-03-05 19:17:32 +01:00
monojenkins 56bf6d3a73 Bump API snapshot submodule 2018-03-05 19:10:11 +01:00
Filip Navara ff60734df4 Add unit test for TextBox.PreferredSize property and fix updating the preferred size cache on Text change. 2018-03-05 19:10:10 +01:00
Filip Navara 58f25ff1f0 Add makefile rule to build and run the notepad sample. 2018-03-05 19:10:10 +01:00
Filip Navara 7b6b607567 Remove obsolete code from FlowLayoutPanel that is no longer necessary with the corrected nested layouts. 2018-03-05 19:10:10 +01:00
Filip Navara ae972579de When Form is set to AutoSize enforce it also as the minimum size for the window manager. 2018-03-05 19:10:09 +01:00
Filip Navara f1de56d31c Update XplatUI backends to properly send WM_WINDOWPOSCHANGED for zero-sized windows. 2018-03-05 19:10:09 +01:00
Filip Navara e563776f62 Avoid couple of size recalculations by streamlining the SetBounds, SetBoundsInternal and SetBoundsCore methods.
Now explicit bounds are only updated in SetBoundsCore, no more all the updating and restoring with UpdateBounds calls.
Rely on the WM_WINDOWSPOSCHANGED message to be sent from XplatUI.SetWindowPos to call UpdateBounds. This avoids an explicit call to XplatUI.GetWindowPos and UpdateBounds in SetBoundsCore.
2018-03-05 19:10:09 +01:00
Filip Navara ff38080cc0 Fix for bug_82326 unit test. 2018-03-05 19:10:09 +01:00
Filip Navara af26d754ae Fix couple of relayouts causing incorrectly cached control preferred size.
Fix events triggered in incorrect order when Control.Controls.Remove is called.
Update Dispose behavior with events and exceptions to match the reference implementation more closely.
2018-03-05 19:10:09 +01:00
Filip Navara 5feb428acd Update DisposeTest to work on latest version of .NET Framework. 2018-03-05 19:10:08 +01:00
Filip Navara 4f3adb750d Add test for label self-sizing behavior. 2018-03-05 19:10:08 +01:00
Filip NavaraandJiri Volejnik 376002afb4 Call LayoutEngine.InitLayout when appropriate and move the dist_right and dist_bottom calculation there.
Co-authored-by: Jiri Volejnik <[email protected]>
2018-03-05 19:10:08 +01:00
Filip Navara a859588486 Add cache for PreferredSize value. 2018-03-05 19:10:08 +01:00
Filip Navara 016a5a8679 Fix propagating layout to parents and then back to children when PreferredSize changes. 2018-03-05 19:10:08 +01:00
Filip Navara 71931189fa Remove obsolete code for layout of AutoSize forms. 2018-03-05 19:10:07 +01:00
Filip Navara 622ad5480d Unify the code for layout of anchored controls to avoid setting the bounds twice for controls with AutoSize set to true. 2018-03-05 19:10:07 +01:00
Filip Navara 78ad684762 Fix the default layout engine and its quirks enough to pass all unit tests again. 2018-03-05 19:10:07 +01:00
Filip NavaraandJiri Volejnik cbb07605df Move GetPreferredSize implementations from container classes to respective LayoutEngine implementations.
Rework the layout engines to use AutoSizeInternal property since TextBoxBase has its own AutoSize that should not be respected by layout engines.
Rework automatic sizing behavior of TextBoxBase to return correct values.
Rework TableLayout completely to use same code for layout and calculation of preferred size.

Co-authored-by: Jiri Volejnik <[email protected]>
2018-03-05 19:10:07 +01:00
Filip Navara d758a6d65f Fix updating panel references when assigning TableLayoutSettings to TableLayoutPanel. 2018-03-05 19:10:06 +01:00
Jiri Volejnik 71989c037e Ignore invisible controls in FlowLayout. 2018-03-05 19:10:06 +01:00
Filip Navara ca957c45b4 Apply size constrains to control sizes when calculating flow layout. 2018-03-05 19:10:06 +01:00
Filip Navara 4b093a9d2d Apply size constrains to control sizes when calculating flow layout preferred size. 2018-03-05 19:10:06 +01:00
Jiri Volejnik 6943077ab9 Added missing support for flow breaks in FlowLayoutPanel's preferred size calculation. 2018-03-05 19:10:06 +01:00
Filip Navara eed14424e5 Add tests for FlowLayoutPanel.PreferredSize. 2018-03-05 19:10:05 +01:00
Filip Navara a369011555 Apply the constraints when setting MinimumSize/MaximumSize and update the unit test to demonstrate it. 2018-03-05 19:10:05 +01:00
Filip Navara 78f4b60e6c Reduce memory pressure by reusing the LayoutEngine objects. 2018-03-05 19:10:05 +01:00
Jiri Volejnik f56b710942 Added missing PerformLayout() calls to Control.MinimumSize and MaximumSize setters. 2018-03-05 19:10:05 +01:00
Filip Navara 18001b61a3 Apply Maximum/MinimumSize constraints when calculating the preferred size. 2018-03-05 19:10:05 +01:00
Filip Navara 1417a68137 Update Label.InternalGetPreferredSize to take the proposed size into account. 2018-03-05 19:10:04 +01:00
Filip Navara 73c8e1f615 Fix Label automatic sizing code.
The Label control has special sizing behaviour that predates the introduction of layout engines in .NET Framework 2.0. In earlier versions of the framework it used to auto-size itself. Now it does it only if it's contained in the default layout engine, otherwise it lets the layout engine do its magic.
2018-03-05 19:10:04 +01:00
Aleksey Kliger baf431b393 [metadata] Use mono_atomic_store_release to initialize gparam cache
Fixup for
https://github.com/mono/mono/commit/dabdacd99b40d144d93e46fb89e0bb27b7e82931

Use a fence to ensure another thread won't see a partially initialized hash table.
2018-03-05 10:16:44 -05:00
Alexander Köplinger 486be78f8a Update README.md with current directory structure 2018-03-05 15:56:31 +01:00
monojenkins 965a813f51 [msvc] Update csproj files (#7404) 2018-03-05 15:28:10 +01:00
Bernhard Urban 0c6f7fa7c5 [mcs tests] fix runtime arguments passing to test harness (#7400)
* [mcs tests] fix runtime arguments passing to test harness

This fixes a regression introduced by
https://github.com/mono/mono/pull/5484/files#diff-d4a99dd2b7df29f027dae0b3eec6c8e6R193

The change it subtle: Variables are moved into another one, but one
variable got changed from `TEST_RUNTIME_FLAGS` to `RUNTIME_FLAGS`, which
causes the harness not picking up `--interpreter` if set.

* [interp] disable System.Threading.ThreadTest.Test_Interrupt
2018-03-04 12:27:38 -05:00
Aleksey Kliger (λgeek) 9725d50c87 [sre] Use MonoClass getters in sre-save.c (#7352)
* [sre-save] Emit a warning if overwriting a MonoClass token with unequal value

It's not clear to me how we could ever have a class without a type_token set
even with a TypeBuilder.

* [sre-save] Use MonoClass getters in sre-save.c

* [sre-save] Change g_warning to g_error in mono_image_fill_export_table

We think this case should not happen.
2018-03-04 12:23:50 -05:00
Marek Safar 15578eab17 Bump corert 2018-03-04 10:29:11 +01:00
Ludovic Henry 43ac34b36e [sdks] Unify targets to build runtimes (#7394)
* [sdks] Move common targets

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

* [sdks] Create common runtime compilation template

* [sdks] Use runtime template for Android

* [sdks] Use runtime template for iOS
2018-03-03 10:21:38 -05:00
Sebastien Lebreton e7ba41d14c Swap Close/Dispose calls so that the receiver_thread_main loop will be properly interrupted (#7390) 2018-03-02 19:03:03 -05:00
Johan Lorensson 24c52e28c0 Use VSCMD_ARG_TGT_ARCH env in mkbundle on Windows when trying to autoetect target architecture. (#7281)
* Use VSCMD_ARG_TGT_ARCH env in mkbundle on Windows when trying to autodetect target architecture.

Using mkbundle on Windows with VS toolchain, mkbundle will detect target
architecture (x86/x64) by looking at the architecture of executing .NET runtime.
This could lead to some surprises when run from a VS development command propmt setup
to target x86 or x64 but running a mono binary using opposite architecture.

To mitigate this issue mkbundle will look now at the VSCMD_ARG_TGT_ARCH
set in VS development command prompts and use target architecture based
on this env variable. If not defined, current behavior will be used, picking the target
architecture based on executed .NET runtime architecture.

* Updated mkbundle documentation.
2018-03-02 23:32:26 +01:00
Alexander Köplinger 4874e18fd2 [corlib] Remove IVT for S.R.I.RuntimeInformation facade (#7385)
* [corlib] Remove IVT for S.R.I.RuntimeInformation facade

The types live in corlib now so we don't need the IVT anymore.

Also removed leftover SR.cs file.

* Bump API snapshot submodule
2018-03-02 16:44:16 +01:00
Zoltan Varga a9c37afaa4 [sdks] Fix the ios build. 2018-03-02 16:03:13 +01:00
Bernhard Urban 16e5f04960 [interp] remove method field from InterpFrame
`MonoMethod *` can be accessed via `imethod->method` instead.
2018-03-02 03:45:05 -05:00
Aleksey Kliger 182a748586 [runtime] Use MonoClass getters in object.c 2018-03-01 18:39:09 -05:00
Aleksey Kliger 2713dfc577 [metadata] Move MonoClass:gc_descr and runtime_info initialization to class-init.c
- Move mono_class_compute_gc_descriptor to class-init.c
- Extract mono_class_setup_runtime_info from mono_class_create_runtime_vtable
2018-03-01 18:39:09 -05:00
Aleksey Kliger 9abe6ebf59 [appdomain] Fix path clobbering when trying to shadow copy siblings
The original version of this code overwrote the same string over and over
again.  Because of the order of operations, when looking for siblings of
Test.dll, we would probe for Test.dll.mdb, then Test.pdb, then Test.pdb.config
(note the last one - should be Test.dll.config).

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

Fixes https://github.com/mono/mono/issues/7262
2018-03-02 00:01:35 +01:00
Manuel de la Pena 76d5a16447 [Test] Reenable HttpRequestIgnoreBadCookies in monotouch. (#7330)
The test was ran in the current xamarin-macions and works as expected.
2018-03-01 19:28:50 +01:00
Zoltan Varga bbb882b018 [sdks] Add watch device build. 2018-03-01 19:25:56 +01:00
Zoltan Varga b4d53f4d7c [sdks] Add watch simulator build. 2018-03-01 19:25:56 +01:00
Zoltan Varga dd5e5c8239 [sdks] Add tv simulator build. 2018-03-01 19:25:56 +01:00
Zoltan Varga 6cc113a4b3 Ios sdk changes (#7258)
* [sdks] Add armv7s device build.

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

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

* [sdks] Add a configure-mono target.

* [sdks] Put back the call to CheckXcodeDir.

* [sdks] Enable ccache if possible.

* [sdks] Generalize iosDeviceTemplate so it can build the tvos runtime as well. Add tvos device build.
2018-03-01 19:25:56 +01:00
Jo Shields d8e49b1c27 Fix build from tarballs due to missing corefx.unix.sources 2018-03-01 12:26:13 -05:00
jaykrell 076557c37f Use attribute(deprecated) instead of attribute(error). (#7362)
- This is independent of optimization, which is seemingly what we want.
- This does not have bug under optimization that `error` has, that
 currently breaks FullAOT builds.

This is an alternative to https://github.com/mono/mono/pull/7353.

Use ifdef GNUC || clang to indicate we know clang is compatible,
and not just depend on clang defining GNUC and being very compatible.

See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84628.
2018-03-01 17:18:15 +01:00
monojenkins 68376f1f9b [msvc] Update csproj files (#7367) 2018-03-01 16:51:20 +01:00
Martin Baulig 319749c314 Make it build.
(cherry picked from commit 5f3fd819a0b450febbe1754f1e5d368e1dcfebd8)
2018-03-01 15:29:21 +01:00
Martin Baulig d51e55d4a3 Bump linker to its latest master. 2018-03-01 15:29:21 +01:00
Ludovic Henry a838b6fb39 [interp] Enable more tests (#7315)
* [interp] Enable more runtime tests

* [interp] Enable more mcs tests
2018-03-01 09:08:57 -05:00
Alex Rønne Petersen 8ddcea2956 [profiler] A few low-hanging enhancements. (#7314)
* [runtime] Export mono_runtime_get_aotid () for use in the profiler.

* [profiler] Add nanoseconds startup time to file header.

Fixes #6178.

* [profiler] Add a TYPE_AOT_ID event containing the current runtime's AOT ID, if available.

Fixes #6181.

* [profiler] Add Mvid to image load events.

Fixes #6180.

* [profiler] Add generation field to heap object events.

Fixes #6174.

* [profiler] Remove TYPE_SAMPLE_UBIN and some more dead ELF code.
2018-03-01 07:22:18 -05:00
Alexander Köplinger ddf4e7be31 Update ppc badge to correct URL in README 2018-02-28 22:49:18 +01:00
Alexis Christoforides db63561143 Merge pull request #7341 from akoeplinger/dont-throw-in-dispose
Don't throw NotImplementedException in Dispose()
2018-02-28 14:35:44 -05:00
Alexander Köplinger fa21013d7f Don't throw NotImplementedException in Dispose()
We had a few stubs that threw not implemented exceptions in Dispose()
which causes the finalizer thread to abort.

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

Fixes https://github.com/mono/mono/issues/7338
2018-02-28 17:28:51 +01:00
monojenkins 2c2fac29eb [msvc] Update csproj files (#7337) 2018-02-28 17:06:30 +01:00
Egor Bogatov 4f9b89adc1 CoreFX System.Runtime.CompilerServices (#7118)
* Initial System.Runtime.CompilerServices port to corefx

* Bump API snapshot submodule
2018-02-28 16:27:03 +01:00
Alexander Köplinger cb956b58a6 Revert "Revert "[System.IO] Integrate FileSystemWatchers from CoreFX The FSEvent CoreFX watcher becomes the new default for MacOS.""
This reverts commit 2174a521a3.
2018-02-28 13:42:15 +01:00
Alexander Köplinger fdefcf1f25 Fix build 2018-02-28 13:30:35 +01:00
Marek Safar 2174a521a3 Revert "[System.IO] Integrate FileSystemWatchers from CoreFX The FSEvent CoreFX watcher becomes the new default for MacOS."
This reverts commit f5b10f34a9.
2018-02-28 12:46:53 +01:00
Alexis Christoforides f5b10f34a9 [System.IO] Integrate FileSystemWatchers from CoreFX
The FSEvent CoreFX watcher becomes the new default for MacOS.
2018-02-28 10:47:01 +01:00
Rodrigo Kumpera 872c048830 [wasm] Add a missing dependency in wasm. 2018-02-28 10:05:16 +01:00
Martin Baulig 8facc4afb2 [System]: Use new WebCompletionSource instead of TaskCompletionSource. (#7293)
This new helper class uses `TaskCompletionSource<>` internally, but instead
of using TrySetException(), it sets a result containing an `ExceptionDispatchInfo`.

The problem with using TrySetException() is that it wraps the exception
object in an `AggregateException`, that would be unobserved if the caller
throws the original exception.
2018-02-28 09:37:24 +01:00
Alexis Christoforides dfe6e2d4a2 Merge pull request #7321 from mono/fix-linuxarm-native-stacktrace
Fix gdb not being used for native stacktraces in some cases
2018-02-28 00:08:16 -05:00
Martin Baulig 9648645fb3 [System]: Enable some System.Net.Requests tests from CoreFX. (#7080)
* [System]: Enable some System.Net.Requests tests from CoreFX.

* tests.make: add `$(XTEST_HARNESS_PATH)` to `TEST_MONO_PATH`,
  so we can find xunit.assert.

* corefx/SR.cs: add `System.Net.Requests` resources from corefx.

* HttpWebRequest: See below for detailed summary.

* Match parameter names of overridden base class members.

* Fixed order of some argument / state checks to match the
  tested behavior.

* Most async methods now throw exceptions instead of returning
  faulted tasks when called with incorrect arguments.

* HttpWebResponse.ContentType: use `string.empty` as default.

* WebConnectionStream.FlushAsync: override to return a finished task.

* HttpWebRequestTest.AllowReadStreamBuffering: removed this test.

* test-helpers/RemoteExecutorConsoleApp: silently ignore compiler-
  generated helper methods.

Enabled tests from CoreFX:
--------------------------

Added the following tests from external/corefx/src/System.Net.Requests/tests:

* AuthorizationTest, FileWebRequestTest, GlobalProxySelectionTest,
  HttpRequestCachePolicyTest, HttpWebRequestTest, HttpWebResponseHeaderTest,
  HttpWebResponseTest, LoggingTest, RequestStreamTest, WebRequestTest

Not working yet:

* AuthenticationManagerTest, FtpWebRequestTest

We are currently using
../../../external/corefx/src/System.Net.Requests/tests/*.cs:AuthenticationManagerTest.cs,FtpWebRequestTest.cs

Summary of HttpWebRequest changes:
----------------------------------

* Host - we are now using the implementation from corefx.

* DefaultMaxResponseHeadersLength (unused) - fix default value.

* AllowReadStreamBuffering (unused) - allow this property to
  be read/written.

* ContinueTimeout - likewise.

* DefaultCachePolicy (unused) - allow this property to be
  read/written and set default value.

* DefaultMaximumErrorResponseLength (unused) - likewise.

* Connection - use implementation from corefx.

* Method - use implementation from corefx, which has additional
  error checks.

* MaximumResponseHeadersLength - use implementation from corefx,
  adding error checks.

* ReadWriteTimeout - likewise.

* ProtocolVersion - include parameter name in ArgumentException.

* TransferEncoding - use implementation from corefx.

* BeginGetRequestStream / GetRequestStreamAsync / GetRequestStream:
  throw exceptions when called with incorrect arguments rather than
  returning faulted tasks.

* Disable the corefx tests for the moment.

* Bump API snapshot submodule

* Update tests.make
2018-02-28 00:32:06 +01:00
Alexis Christoforides ce2584911f Fix gdb not being used for native stacktraces in some cases 2018-02-27 17:24:43 -05:00
Ludovic Henry 096147d428 [tests] Add --repeat parameter to enable runtime tests to run multiple times (#7291) 2018-02-27 17:09:56 -05:00
Alex Rønne Petersen a5da7b21f4 [runtime] Implement thread info flags and get rid of tools threads. (#7226)
* [acceptance-tests] Revert part of 1216780e83.

This didn't work as well as I'd hoped.

* [libgc] Export GC_start_blocking () and GC_end_blocking ().

* [libgc] Allow GC_start_blocking ()/GC_end_blocking () to be called unbalanced.

This makes things a bit easier in Mono.

* [libgc] Implement GC_start_blocking ()/GC_end_blocking () for Windows.

* [utils/event] Export the MonoOSEvent APIs for use in the profiler.

* [runtime] Implement thread info flags and get rid of tools threads.

The concept of a tools thread was originally a good solution to the problem of
some internal threads needing to be exempt from stop-the-world. Since they were
introduced, however, we've added more code in the profiler's internal threads
which require certain properties that don't hold true for tools threads. In
particular, we call into some APIs in the metadata layer that, while not
needing the managed heap, do need a domain to be set under certain conditions
(see #6188).

To avoid further complicating the semantics of tools thread by trying to set a
domain for them in a way that doesn't break things horribly, we'll instead do
away with the concept entirely. We already had mono_gc_set_skip_thread () to
flag a thread as being exempt from stop-the-world, which we used in thread pool
threads. This means we already have the infrastructure that is necessary for a
thread to be fully attached to the runtime as a managed thread while still
being exempt from stop-the-world.

So, we do the following:

1. Introduce a set of flags that can be set on a MonoThreadInfo at arbitrary
   points (although not in async context). These can indicate that the thread
   doesn't want to participate in stop-the-world, doesn't want to receive
   sampling signals, etc.
2. Change the thread iteration macros to allow skipping threads with specific
   flags set and use this where appropriate (e.g. SGen stop-the-world code).
3. Get rid of mono_gc_set_skip_thread () and make runtime code use the new
   mono_thread_info_set_flags () instead.
4. Switch all internal profiler threads to using mono_thread_attach () and
   mono_thread_detach (). Use mono_thread_info_set_flags () to disable
   stop-the-world and sampling signals for these threads immediately after they
   start.

With these changes, internal profiler threads are now fully attached threads
and can call any APIs in the runtime as long as they don't touch the managed
heap.

* [libgc] Add a note about how GC_start_blocking ()/GC_end_blocking () differ from upstream.
2018-02-27 12:36:26 -05:00
Zoltan Varga e8141fc31d [sdb] Fix VirtualMachine.CreateEnumMirror () so it works with types from non-root domains.
Fixes https://github.com/mono/mono/issues/7289.
2018-02-27 17:58:13 +01:00
Aleksey Kliger (λgeek) b8da973620 [marshal] Use MonoClass getters in marshal.c (#7253)
* [runtime] Use getters in IS_MONOTYPE()

* [metadata] Add m_class_offsetof_fieldName accessors

These look like:
```c
intptr_t
m_class_offsetof_someField (void) {
  return MONO_STRUCT_OFFSET (MonoClass, someField);
}
```

When Mono is compiled with the definition of MonoClass
hidden (--enable-checked-build=private_types),
only the function prototypes are available via
mono/metadata/class-abi-details.h
When Mono is compiled without the checked build flag,
the functions are inlined into that header.

* [metadata] Add accessor function mono_class_set_nonblittable

This is needed by mono_marshal_load_type_info ()

* [marshal] Use m_class_get_ getters to access MonoClass fields
2018-02-27 10:55:16 -05:00
monojenkins 2f9b9142cd [msvc] Update csproj files (#7310) 2018-02-27 16:32:45 +01:00
Calvin 6ca674ed68 Update the random checking code in autoconf to this decade (#7250)
* OpenBSD hasn't have /dev/srandom anymore. See:
	  https://mastodon.social/@_xhr_/99389358375291806

	* Crichton hasn't touched Mono since 2004, per logs. I
	  doubt they're who to consult about this issue anymore, if
	  someone somehow does.
2018-02-27 14:34:42 +01:00
Calvin b1801b7804 Always enable explicit null checks for AIX (#7300)
* Always enable explicit null checks for AIX

AIX has a "null page" that allows reads (but not W|X) to occur on
*0; allegedly legacy crap for old stupid C programs that poorly
managed string handling. Because of this, we can't catch SIGSEGVs
to give out NREs with - we have to do null checks ourselves. As
such, turn this debug option on all the time; it's seemingly what
other managed runtimes have done, at least according to with what
one contact says.

* Make explicit null checking definable by architecture headers

Turns out other OSes do this too; so best to keep it generic.

To the poor souls on HP-UX and IRIX, good luck!

* Make arch-specific explicit null checks a backend option instead

Don't put ifdefs into JIT code except in that init_backend func;
also make ifdef name consistent with the debug flag name
2018-02-27 11:39:03 +01:00
Filip Navara 31c03a9cbe [System.Windows.Forms] Remove dependency on Hwnd objects outside of XplatUI code. (#7243)
* Rework the Win32 drag and drop bridge not to depend on Hwnd object.

* Avoid using Hwnd.GetBorderWidth directly.

* Unify GetParent calls to make same sense out of them. They should either consider form owners or not, which wasn't consistent across the XplatUI backends and uses.

Reimplement Control.FromChildHandle using XplatUI instead of relying on Hwnd class.

* Update GetParent parameters.

* Remove direct accesses to Hwnd objects from Control.

* Don't create the Hwnd object in the XplatUIWin32 backend.

* Split handling of Hwnd.GetNextStackedFormLocation for MDI windows into MdiClient to remove dependency on Hwnd objects.
2018-02-27 09:19:01 +01:00
Bernhard Urban 6ac2003417 bump nunitlite
Commit list for mono/NUnitLite:

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

Diff: https://github.com/mono/NUnitLite/compare/b7776829bb7b2f9c58db045a6f40be40bcd96761...70bb70b0ffd0109aadaa6e4ea178972d4fb63ea3
2018-02-27 07:37:55 +01:00
Alexis Christoforides 216b5c5db8 Merge pull request #7286 from lambdageek/fix-gh-7095
[runtime] Don't assert in mono_class_is_assignable_from on iface gtd
2018-02-26 21:32:53 -05:00
Rodrigo Kumpera 909b30b5ba [wasm] Fix v8 provisioning. (#7244) 2018-02-27 00:23:00 +01:00
Vlad Brezae cfaa28e1d8 [threads] Reduce race window with async abort (#7274)
We were previously passing to EH the address to the context that is being set up by the suspend mechanism. This context could get modified while we unwind, confusing EH (could raise `cfa_reg != -1` assertion)

This commit significantly reduces the race window and should mostly avoid crashes (if we get the wrong context we should just fail to invoke clauses from managed)
2018-02-26 16:56:26 -05:00
Aleksey Kliger f901c70548 [runtime] Don't assert in mono_class_is_assignable_from on iface gtd
Don't assert when comparing if an "array special interface" is assignable from
an array.

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

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

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

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

So we can return FALSE here.

Fixes https://github.com/mono/mono/issues/7095
2018-02-26 16:31:54 -05:00
Aleksey Kliger (λgeek) 8d37ddbf1d [runtime] Use MonoClass getters in a few small files (#7254)
* [metadata] Fix m_classdef_get_next_class_cache getter to be byref

Apparently the way this field is used is to internally chain cached classes, so
we need its address.

* [metadata] Use MonoClass getters in image.c

* [metadata] Allow debug-helpers to access MonoClass fields directly.

* [metadata] Use MonoClass getters in mono-error.c

* [sgen] Use MonoClass getters in sgen-debug.c

* [sgen] Use MonoClass getters in sgen-client-mono.h

* [metadta] Use MonoClass getters in appdomain.c

* [metadata] Use MonoClass getters in exceptions.c
2018-02-26 16:26:42 -05:00
Aleksey Kliger 375304d501 [test] System.Type.IsAssignableFrom of gtd array special interfaces.
Regression test for https://github.com/mono/mono/issues/7095
2018-02-26 16:18:59 -05:00
Marek Safar d63e8b6f5a [corlib] CompareInfo from CoreFX (#7272) 2018-02-26 21:06:44 +01:00
Alexis Christoforides c152f67574 Merge pull request #7263 from filipnavara/swf-carbontests
[System.Windows.Forms] Fix test freezes with Carbon driver.
2018-02-26 14:47:41 -05:00
Alexis Christoforides de8dc8311d Merge branch 'master' into swf-carbontests 2018-02-26 12:28:31 -05:00
Alexis Christoforides ffbb3d90ae Merge pull request #7234 from filipnavara/swf-painteventend
[System.Windows.Forms] Simplify XplatUI code by adding PaintEventArgs parameter.
2018-02-26 12:13:12 -05:00
Ludovic Henry 5705b3d207 Update CODEOWNERS 2018-02-26 11:46:06 -05:00
lateralusX 905077f90f Add zlib.lib/zlibstatic.lib in Windows VS mkbundle build when using -z argument.
The mkbundle VS toolchain build has never supported zlib and the -z argument.
Commit adds zlib.lib or zlibstaticlib (depending on use of --static) to the
linker command line when using -z argument.

NOTE, user still needs to make sure zlib.h, zconf.h, zlib.lib or zlibstatic.lib
is visible to cl.exe and link.exe when running mkbundle using VS toolchain.
2018-02-26 17:42:29 +01:00
Filip Navara d69c1568f6 Remove mention of MONO_THEME from man page. (#7282) 2018-02-26 17:18:40 +01:00
Aleksey Kliger (λgeek) dabdacd99b [metadata] Cache GenericParamInfo for anonymous gparams in MonoImage (#7155)
* [metadata] Create transient ginst during parsing.

Allocate the instantiation types transiently so that they can be freed if
we're going to ultimately discard this MonoGenericInst candidate.

* [metadata] Store GenericParamInfo for anonymous generic params in a cache in MonoImage

The issue is that mono_metadata_parse_generic_param can be called from
mono_metadata_parse_method_signature_full without a MonoGenericContainer which
means we will image_alloc0 temporary MonoGenericParamInfo every time.

This happens, for example in method_from_methodspec in loader.c when we
parse a generic instantiation without having a generic container on hand.

* [metadata] Use MonoGenericParamFull for all generic params

We used to allocate a smaller MonoGenericParam for anonymous generic
parameters.  Instead always allocate a MonoGenericParamFull now (which has the
extra MonoGenericParamInfo fields).

As a result, update call sites that checked whether mono_generic_param_info
returned non-NULL to check gparam->owner->is_anonymous instead.

As a fesult of that, update mono_metadata_load_generic_params to create
non-anonymous parameters right away if we know the class or method that will
eventually own them.

* [metadata] Remove anon gparam MonoClass caches from MonoImage

Now that all generic parameters are MonoGenericParamFull and have a pklass
field, cache the class corresponding to a generic param in the struct itself
instead of an external cache.

* [metadata] Remove gshared constraint gparam caches from MonoImage

Now that every gparam is a MonoGenericParamFull, we can always cache the
MonoClass for a gparam in MonoGenericParamFull:pklass.
2018-02-26 10:58:21 -05:00
Rodrigo Kumpera 94f8dcf102 [wasm] Add LTO release configuration. Saves 15% of binary size. (#7221)
* [wasm] Enable LTO in release builds. Change packaging to include both debug and release builds.

* [wasm/sgen] Make it possible to disable debug helpers and do so under wasm. Saves 2% on a release build.
2018-02-26 10:57:36 -05:00
Alexis Christoforides ba40177a44 Merge pull request #7269 from filipnavara/swf-theme-obsolete
[System.Windows.Forms] Remove obsolete theme code.
2018-02-26 09:58:31 -05:00
jaykrell 8ebc608feb [Tailcall] Add 11 tests that are all runnable, never crash, are self checking. (#7232)
* [Tailcall] Add 11 tests. They all run w/o exception or stack overflow, on all platforms.
They are self-checking and report if they were tail called.
All 11 pass on Windows .NET.
2 pass with Mono on Windows or Mac.
CoreCLR not tested as it is a difficult/unknown command line environment.

Mono has problems with at least:
	virtual
	non-managed pointers
	generics
	calli
	managed references even if not to current frame

Tests originally written in C# and then run through ildasm and perl.
See https://github.com/jaykrell/mono/commits/tailcalltest2.gen.

* [Tailcall] Interpreter fails all tailcall tests.
2018-02-26 09:53:54 -05:00
Filip Navara 120be0fa4e Remove obsolete Nice theme code. 2018-02-26 13:42:53 +01:00
Paul Fertser e2e66cb4f8 [wcf] use ConcurrentDictionary for wait handles (#7265)
SvcHttpHandler is supposed to be thread-safe so it shouldn't use plain
Dictionary without additional locking.

The problem is apparent when running test app from issue #7134 with
hyperfastcgi as the following exception sometimes surfaces:

```
[System.NullReferenceException]: Object reference not set to an instance of an object
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x00111] in .../mono/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs:441
  at System.Collections.Generic.Dictionary`2[TKey,TValue].set_Item (TKey key, TValue value) [0x00000] in .../mono/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs:223
  at System.ServiceModel.Channels.SvcHttpHandler.ProcessRequest (System.Web.HttpContext context) [0x00048] in .../mono/mcs/class/System.ServiceModel/System.ServiceModel.Channels/SvcHttpHandler.cs:82
  at System.Web.HttpApplication+<Pipeline>d__225.MoveNext () [0x008fd] in .../mono/mcs/class/System.Web/System.Web/HttpApplication.cs:1338
  at System.Web.HttpApplication.Tick () [0x00000] in .../mono/mcs/class/System.Web/System.Web/HttpApplication.cs:927
```
2018-02-26 12:59:15 +01:00
Alexander Köplinger 8739c9b05a Bump api-snapshot 2018-02-26 12:55:27 +01:00
Filip Navara 5aafe83bbd Activate MDI child windows after showing them (fixes 7 unit tests failures). 2018-02-26 12:52:02 +01:00
Filip Navara cb48d78dc6 Return dummy value in XplatUICarbon.IconSize to let System.Windows.Forms.SystemInformationTest.IconSizeTest pass. 2018-02-26 12:52:02 +01:00
Filip Navara 091595f3d8 Fix the default font value in test. 2018-02-26 12:52:02 +01:00
Filip Navara 0d524452c5 Make XplatUICarbon.SetFocus send messages synchronously, fixes 9 unit tests. 2018-02-26 12:52:02 +01:00
Filip Navara bb99dcade2 Fix windows creating, destroying and message processing in Carbon driver to be stable enough not to freeze the test suite. 2018-02-26 12:52:02 +01:00
Filip Navara cde44408a4 Spit out the name of a test along with the error about undisposed forms. 2018-02-26 12:52:01 +01:00
Filip Navara 0a2d57ed67 Call XplatUI.PaintEventEnd when an exception happens in OnPaint. 2018-02-26 12:52:01 +01:00
Filip Navara 931380017f Unregister thread exception handler at the end of test. 2018-02-26 12:52:01 +01:00
Marek Safar 0129c25e43 [tests] Use RemoteExecutor from corefx 2018-02-26 11:52:12 +01:00
Zoltan Varga 335ca28eaf [llvm] Pass only the imt argument if both imt and rgctx arguments are required.
Fixes https://github.com/mono/mono/issues/7240
2018-02-26 11:47:46 +01:00
Filip Navara c99ac6a87e Add missing XplatUI.EndLoop call. 2018-02-26 11:29:00 +01:00
Ludovic Henry a974057d92 [sdks] Merge mxe-Win32 and mxe-Win64 targets since we are building both in XA anyway 2018-02-26 11:18:43 +01:00
Filip Navara 1af9291294 Fix layout of ColorDialog on systems with different window border sizes. 2018-02-26 11:13:51 +01:00
Filip Navara 657c7637fb Fix typo in implementation of Disposing property. 2018-02-26 11:13:09 +01:00
Filip Navara 67e557fa2e Handle more special keys in KeysConverter to ensure compatibility with designer generated resource files. 2018-02-26 11:11:38 +01:00
Filip Navara 6d889314b2 Remove obsolete theme code (disabled by commits 910c669 and 93724d2) and the last remaining usage of MONO_THEME environment variable. 2018-02-25 17:05:47 +01:00
Jonathan Chambers 67c1708677 Add PointerValue.Value to dereference and access pointer value. (#6840) 2018-02-25 01:14:11 -05:00
monojenkins 9bbe5e5e5f Bump API snapshot submodule 2018-02-23 21:18:18 +01:00
Marek Safar 392d3452f2 [System.Net.Http] Better exception message for invalid header value 2018-02-23 21:18:18 +01:00
Katelyn Gadd 798c5efa52 Fix bug 18941: Marshal.OffsetOf and Marshal.SizeOf return incorrect results (#7142)
* Add test for bug 18941

* Expand and update bug 18941 test because there are more problems with our handling of empty structs

* Remove array offset calculation from test because it uses unmanaged sizes. Fix calculation of struct sizes used in marshal struct layout (fixes SizeOf(TestOffsets))

* Correct Marshal.SizeOf implementation to use mono_marshal_type_size instead of returning native sizes

* Remove commented out code
2018-02-23 11:49:21 -05:00
Filip Navara bfdbc1e676 Update the method signatures in the new X11 backend. 2018-02-23 17:48:12 +01:00
Vlad Brezae 1f0fc93de4 [sgen] Check if we are exceeding the worker count limit (#7180) 2018-02-23 11:28:56 -05:00
monojenkins 12cbe9a7bd [msvc] Update csproj files (#7238) 2018-02-23 17:00:46 +01:00
Katelyn Gadd d45fb4e882 Fix xamarin-android issue 1130 and add test (#6326) 2018-02-23 15:32:43 +01:00
Vlad Brezae a32ca3e2c2 [tests] Avoid false pinning in weak-fields test 2018-02-23 15:29:58 +01:00
Vlad Brezae 1e9816a10e [tests] Avoid false pinning in tests
When object is allocated at start of tlab.
2018-02-23 15:29:58 +01:00
Ben Lubar 38846ee754 Properly handle non-quoted multipart content dispositions
Fixes #6801
2018-02-23 15:28:55 +01:00
Filip Navara bf12b6318a Simplify System.Windows.Forms XplatUI code by adding PaintEventArgs parameter to PaintEventEnd. 2018-02-23 15:27:12 +01:00
Bernhard Urban 9c55770f3f [icall table] add ldflags for bitcode 2018-02-23 15:26:18 +01:00
Rodrigo Kumpera a9aa188ab2 Make field tokens sequential in SRE. (#7055)
* [sre] Remove S.R.E.FieldBuilder:table_idx field

The field was used in two ways:
  1. as the temporary token returned by MemberInfo.MetadataToken
     property
  2. as a way for sre-save to record the field index in the dynamic assembly.

For (1) we now use the value returned by
  ModuleBuilder.GetToken(MemberInfo) (ie a pseudotoken).

For (2) we lookup the field index in the dynamic assembly hash that maps
MonoClassField pointers to indices.

* [sre] Assign consecutive tokens to all fields in a class.

Ensure that a token and a Module are enough to uniquely identify every
MonoClassField.

Because of how metadata is represented in Mono, the fields defined in a
class must have consecutive tokens (because the MonoClass:field.first
and and MonoClass:field.count are used to index into the
MonoClass:fields array).

When the class is created we bump the "next available field token" value
in the ModuleBuilder.  Any FieldBuilder objects that are still alive
after the type is created will use RuntimeResolve() to map from their
pseudotoken to the real token.

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

* [sre] Change S.R.E.ModuleBuilder.get_next_table_index to take a count

Allow us to reserve more than one consecutive token.

(For now all the callers just have count == 1)

* [sre] Access S.R.E.ModuleBuilder:table_indexes from typebuilder_setup_fields

Use the ModuleBuidler:table_indexes array for assigning tokens to fields
when a TypeBuilder is constructing a type.  Also register those tokens
with the runtime so that ResolveMember calls work.

* [test] System.Reflection.Emit.ModuleBuilder field tokens in a module should be distinct

Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=33208

* [runtime] Relax assertions in mono_class_{get,set}_first_field_idx

Removed the !klass->image->dynamic check.  Classes created by SRE are
of kind MONO_CLASS_DEF and have a first field index.

* Fix issues due to API changes.

* Bump mscorlib version
2018-02-23 15:25:05 +01:00
monojenkins 1804219600 [xbuild] add property that is available in msbuild (#7223)
* add property that is available in msbuild

They fsharp team decided to remove a `#if MONO` with the assumption that
`xbuild` is dead and everything has switched over to `msbuild`:
https://github.com/Microsoft/visualfsharp/pull/3969/files#diff-bcb4028a918d13bbab2d0c1c15c97e6aL181
https://github.com/Microsoft/visualfsharp/pull/3969/commits/5e17e3111f88b1a1f025ac54c8147052e12f347f#r151844561

which, alas, is not true yet.

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

* Bump API snapshot submodule
2018-02-23 13:28:30 +01:00
jaykrell 03371921a1 Problem building on Arch linux #7200 (#7230)
https://github.com/mono/mono/issues/7200
Three styles:
1. LIBS="$LIBS -lfoo"   -- common and probably works
2. LIBS+="-lfoo"        -- was here and does not work
3. LIBS+=" -lfoo"       -- should work
2018-02-23 03:56:08 -08:00
Rolf Bjarne Kvinge 481827b6af [runtime] Don't prepend '0x' to %p-formatted numbers.
%p-formatted numbers already include '0x'

Fixes this output when dumping threads:

    "Threadpool worker" tid=0x0x7000105cc000 this=0x0x10bc18508 , thread handle : 0x7fbb9e6c6c90, state : not waiting

to become:

    "Threadpool worker" tid=0x7000105cc000 this=0x10bc18508 , thread handle : 0x7fbb9e6c6c90, state : not waiting
2018-02-23 05:15:19 -05:00
Marek Safar 5eb4191943 [build] Remove multi stage build from Mono.Security (#7171) 2018-02-22 22:47:58 -05:00
Alexis Christoforides 218ffb9883 Merge pull request #7225 from alexischr/bump-bockbuild
[bockbuild] Detect HTTP errors  when using curl
2018-02-22 22:43:04 -05:00
Rodrigo Kumpera 2b068cb5a4 Fix some enable minimal. (#7195)
* [configure] Remove sgen_copying. It's dead.

* [configure] Add sgen_gc_bridge and sgen_split_nursery to the configure flags.

* [configure] Remove more dead configure flags.

* [configure] Par is now just a feature of conc, remove that too

* [sgen] Fix enable minimal for concurrent configuration.

* [sgen] Fix enable minimal for the split nursery.

* [sgen] Use the new enable minimal to compile the bridge code out.

* [wasm] Switch to the new enable minimal flagd and add mono-opt.js build. The new flags save 300k out of 2.8m.
2018-02-22 22:39:59 -05:00
Calvin ca47362a92 Fix mono_arch_setup_async_callback and add mono_arch_setup_resume_sighandler_ctx on PPC (#7159)
* Fix *setup_async_callback and add *resume_sighandler_ctx on PPC

mono_arch_setup_async_callback didn't work on systems that use
function pointers. For consistency with other backends with
exception support, also add mono_arch_setup_resume_sighandler_ctx,
which we can use to support mono_arch_setup_async_callback, like
those other backends.

Also enable async callbacks on AIX, then enable
*resume_sighandler_ctx on PPC Linux (untested) and AIX. With this,
I can now ^C in the REPL with AIX and have it work; whereas before
it bombed out, with or without async callbacks enabled or disabled.

* Don't configure func descriptors twice, set args reg with user data

	* No sense configuring configuring function descriptors if
	  the restore sigcontext call already set them up. (If Mac
	  OS supports is verified and added to the ifdef maze, it'd
	  be safe to remove this whole ifdef, and let the call in
	  `exceptions-ppc` handle it all, as all supported OSes
	  would have that call...)

	* Set user_data in an arguments register, like what amd64
	  and z do.

These don't seem to cause any regressions, like the first patch.

* Remove unnecessary case for PPC

* mono_ppc_set_func_into_sigctx is unused now, remove it

* Everyone has MONO_ARCH_HAVE_SETUP_RESUME_FROM_SIGNAL_HANDLER_CTX on PPC now

* Everyone has MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX on PPC too
2018-02-22 21:49:12 -05:00
Bernhard Urban 6e0c91f053 [interp] add another signature for interp_in wrappers 2018-02-22 20:45:08 -05:00
Ludovic Henry c382b03fd5 [coop] Rename mono_threads_is_coop_enabled to convay better its semantic (#7178)
mono_threads_is_safepoints_enabled is used to check if cooperative suspend safepoints are enabled, while mono_threads_is_blocking_transition_enabled is used to check if GC safe/unsafe transition are enabled.
2018-02-22 18:53:20 -05:00
Alex Rønne Petersen 8900231c8b [mini] More minor JIT cleanups. (#7130)
* [mini] Change mono_arch_is_inst_imm () to receive the non-imm and imm opcode.

* [mini] Provide a stub for mono_arch_exceptions_init ().

* [mini] No need to define MONO_ARCH_FPSTACK_SIZE on platforms that don't use it.

* [mini] Remove some dead defines from backend headers.

* [mini] Remove the unused dummy_store opcode.

* [mini] Handle dummy init instructions in all backends.

* [mini] Implement live range instructions in all backends.

* [mini] Allocate trampolines from the domain code manager where appropriate.
2018-02-22 18:32:42 -05:00
Alexis Christoforides 983966c7ca [bockbuild] Detect HTTP errors when using curl 2018-02-22 18:31:24 -05:00
Rodrigo Kumpera 0a8126c209 [WASM] Implement timers. (#7193)
* [wasm] Add server.py for those that want to experiment with streaming compilation.

* [wasm] Implement System.Threading.Timer.

Timer implementation is done in a somewhat convoluted way.

First, we change Timer to not depend on a scheduler thread.
What we do is call for the runtime to schedule a timed callback to be executed.

Next step, the runtime. We add enough plumbing to get this call to JS.

Finally, in JS we either call setTimeout or schedule it to be run on the next tick.

Oh, wait, timeouts are ignored on non-web environments? Yes, right now its only use case
is offline testing, so ain't no time to wait for all this timeouting.
2018-02-22 18:24:01 -05:00
Katelyn Gadd f0b7825189 Updates to support building the BCL using Visual Studio 2017 on windows (#6877) 2018-02-22 23:48:37 +01:00
Alexis Christoforides 123d086e27 Merge pull request #6892 from lambdageek/use-getters
[metadata] Use getters for MonoClass fields in class.c
2018-02-22 16:36:08 -05:00
Alexis Christoforides c1cbe060f6 Merge pull request #7218 from mono/revert-6018-fix_10087
Revert "Run the ProcessExit events in the threadpool and enforce a 3 seconds limit. Fixes #10087"
2018-02-22 15:25:05 -05:00
Alexis Christoforides 49a1c8423c Disable a flaky test on Windows
https://github.com/mono/mono/issues/7199
2018-02-22 14:49:06 -05:00
Rodrigo Kumpera 199dad7e84 Revert "Run the ProcessExit events in the threadpool and enforce a 3 seconds limit. Fixes #10087" 2018-02-22 10:06:18 -08:00
monojenkins 72e5ca60b8 [msvc] Update csproj files 2018-02-22 19:03:29 +01:00
Ben Lubar c6f91eaa58 Fix unknown-length requests being treated as if they are fully preloaded. (#6822) 2018-02-22 14:56:02 +01:00
Zoltan Varga 119cf5259e [aot] Emit the same instances in hybrid aot mode as in full aot mode.
Fixes https://github.com/mono/mono/issues/7086.
2018-02-22 14:54:28 +01:00
Zoltan Varga f90612e047 [bcl] Comment/stub out some unused icalls to prevent problems with AOT. (#7183) 2018-02-22 14:49:30 +01:00
Alexis Christoforides 3addbfe627 Merge pull request #7181 from mono/bockbuild-download-using-curl
Bump bockbuild for https://github.com/mono/bockbuild/pull/62
2018-02-22 08:42:43 -05:00
Alexis Christoforides 8a52f590fc Bump bockbuild for https://github.com/mono/bockbuild/pull/62 2018-02-22 08:02:58 -05:00
Marek Safar d4816ef1ab [System.Xml] Remove reflection calls for value has to be set 2018-02-22 08:39:29 +01:00
Zoltan Varga 8ce0775a03 [jit] Disable partial sharing during JITting, its only been tested in full aot mode, and doesn't seem to work with JITted methods. (#7161)
* [aot] Add hybrid aot tests.

* [jit] Disable partial sharing during JITting, its only been tested in full aot mode, and doesn't seem to work with JITted methods. Fixes https://github.com/mono/mono/issues/7085.
2018-02-21 21:11:47 -05:00
Jonathan Chambers 2d2033e440 Use proper sized integer for ioctlsocket on Win32. (#7153)
Windows expects a 32-bit unsigned long in this API.
Previously we passed a 64-bit value and the actual amount
was stored in the wrong bits.
2018-02-22 01:33:13 +01:00
Jonathan Pryor 89804e62bb [mono-api-html] Expand "ignore" functionality (#7154) (#7175)
Context: https://github.com/xamarin/xamarin-android/pull/1078

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

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

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

and property type changes:

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

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

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

        Example: Removed type

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

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

Additionally, allow `mono-api-html` to take a
`Mono.Options.ResponseFileSource`, which allows `@response-files` to
be used as command-line options.
2018-02-22 01:31:10 +01:00
Rodrigo Kumpera df273181b5 Merge pull request #6018 from kumpera/fix_10087
Run the ProcessExit events in the threadpool and enforce a 3 seconds limit. Fixes #10087
2018-02-21 15:48:38 -08:00
Rodrigo Kumpera 03b6095e3e [runtime] Magic interfaces requires the complex stelemref to handle arrays. Fixes gh #6266 (#7038) 2018-02-21 23:17:43 +01:00
Marek Safar 761ddc60f9 [corlib] Make MissingMember exceptions working again after #6123 2018-02-21 22:50:04 +01:00
Aleksey Kliger 735337d5e6 [metadata] Implement MONO_CLASS_IS_INTERFACE(c) in terms of public API
Althought it was previously defined in a public API header, the macro was not
usable for the last several years since it was implemented in terms of
the MonoClass definition which was not visible in the public API.

There is a subtle semantic change here: mono_type_is_generic_parameter will
return FALSE if it's given a byref type parameter, the previous definition of
the macro would return TRUE.  (E.g. if you had "class F<T>" then
IS_INTERFACE("T&") used to return TRUE but will now return FALSE. )
2018-02-21 15:05:18 -05:00
Aleksey Kliger bae5cd2d6e [metadata] (class.c) Use MonoClass getters
Also
- Move mono_class_set_failure definition to class-accessors.c
- Move a few functions that set up specific MonoClass fields to class-init.c:
  - mono_class_setup_has_finalizer
  - mono_class_setup_nested_types
  - mono_class_setup_supertypes
2018-02-21 15:05:18 -05:00
Brian Luczkiewicz f636486045 [metadata] add missing MONO_ENTER/EXIT_GC_SAFE guards around access(2) in is_file_writable (#7126) 2018-02-21 12:16:24 -05:00
Kai Ruhnau d2383c037d [corlib] Support terminals without color support
Some terminals like vt220 don't have a format string for setting foreground
or background colors. In that case, the set*color members of the
TermInfoDriver are set to null and trying to set the background color throws.

Signed-off-by: Kai Ruhnau <[email protected]>
2018-02-21 17:57:19 +01:00
Vlad Brezae 705223f6d5 [interp] Use frame_addr as base pointer in more places (#7128)
When unwinding with the interpreter, we don't make use at all of the MonoContext's SP pointer.
2018-02-21 11:33:39 -05:00
Alex Rønne Petersen 5b0503a5b3 [profiler] Some minor housekeeping. (#7123)
* [profiler] Document addition of MONO_ROOT_SOURCE_EPHEMERON.

* [profiler] Remove dead ELF traversal code.

This was buggy and hasn't been enabled for a long time.
2018-02-21 11:31:36 -05:00
Rodrigo Kumpera ec2faf0388 [wasm] Fix master and add sample. (#7160)
* [wasm] Fix wasm compilation due to recent master regression.

* [wasm] Add Readme and sample to the package.
2018-02-21 11:20:17 -05:00
monojenkins ad03afd96e [msvc] Update csproj files (#7173) 2018-02-21 16:33:38 +01:00
Alexis Christoforides a85911f480 Merge pull request #6034 from alexischr/bug-59400
[class] Fix resolution of interface implementation for 'special inter…
2018-02-21 10:16:26 -05:00
Marek Safar 8658bb6048 [build] Don't add specific support file to all xunit test builds (#7163) 2018-02-21 12:28:48 +01:00
Alexis Christoforides a19fad65f3 Fix copyright 2018-02-20 21:15:56 -05:00
Alexis Christoforides 7de96dd412 Merge pull request #7150 from alexischr/bug-46473
[remoting] Synchronize serializer/deserializer usage for call data. F…
2018-02-20 21:05:42 -05:00
Martin Baulig 5fabb059cf Add Mono-specific System.Net.Test.Common.Configuration.Http. (#7156)
This is the Mono part for corefx commit
https://github.com/mono/corefx/commit/a46b8d9a2c960d0cb882831ef4e6a665e5d9b8e2.
2018-02-21 01:31:16 +01:00
Alexander Köplinger d7551cc9bf [metadata] Improve error message for loading unresolved types (#7147) 2018-02-21 00:21:19 +01:00
Alexander Köplinger 2837f433d9 [corlib] Fix RuntimeFeatureTest.NoNewFeaturesAdded on mobile (#7149)
The code uses reflection to access all the fields in the RuntimeFeatures
class. When running the linker we strip out these fields since
they're `const` and the test fails because it can't find the expected values.

Since the linker always removes all constant fields we can't simply
"use" the field in the test and instead we just bail out when encountering this case.

Also used Dictionary instead of tuples for the test since it renders
better in the nunit output.

Fixes https://github.com/mono/mono/issues/7145
2018-02-21 00:13:06 +01:00
Alexis Christoforides 1426d6a8da [remoting] Synchronize serializer/deserializer usage for call data. Fixes #46473 2018-02-20 17:05:05 -05:00
Alexander Köplinger 18e274b14b Bump corefx submodule
For some reason it got bumped to a commit that is no longer in master.
2018-02-20 22:33:44 +01:00
Zoltan Varga 045acb8f19 [jit] Handle more cases for gsharedvt constrained calls. (#7081)
Hopefully fixes https://github.com/mono/mono/issues/7016.
2018-02-20 15:41:10 -05:00
Rodrigo Kumpera 3b8ec9e97b [wasm] Fix the port to work with the latest version of emcc. (#7091) 2018-02-20 15:39:02 -05:00
Calvin eef0801f3e Assorted fixes for AIX and i (#6934)
* Assorted fixes for AIX and i

	* Fix a bug I introduced when changing the MonoArray vector
	  type; array lengths wouldn't match up to what they
	  actually were on AIX/i.

	* Use a custom mkdtemp implementation on Unices without
	  mkdtemp - and ones that do but don't necessarily have it,
	  like i 7.1, which lacks mkdtemp in its libc. We can't
	  determine this at runtime, so AIX will have to suffer
	  with i.

	* Enhance PowerPC hwcap on AIX to detect features like
	  Linux does.

	* Don't use clock_getres on AIX, because i 7.1 doesn't have
	  that syscall - it's in libc, but it'll bomb out with a
	  SIGILL; the way unimplemented opcodes are handled on i.

* Don't use PROT_NONE for hazard pointer alloc when on AIX

AIX and i 7.2 are OK with doing this, but i 7.1 is not and will
SIGSEGV because we violate access privleges; not even mprotect will
change this. As such, change to r/w protection for AIX/i.

* Fix Environment.OSVersion on AIX/i

Before, it would report "Unix 1.0.0.0" due to the fact AIX only
puts the minor version number where other Unices would put the
whole version in uname. Set up an ifdef for AIX and deal with this
semantic difference with a sprintf.

* Disable mffgpr on AIX

Reports of it not working on i 7.1 on POWER7; tester reports
disabling this in hwcap makes it run. This requires further
investigation.

* Fix threadpool errno delivering bogus values with _THREAD_SAFE

We didn't set this, and we need it so that errno is thread-local on
AIX/i. Oops!

* Make suggested changed to AIX branch

	* use sizeof (utsname) for sanity's sake

	* use a variable for hazard table protection

	* match defines for CPPFLAGS -> libmono_cflags
2018-02-20 15:38:22 -05:00
jaykrell 38989b012f [Coop] Convert many simple mono_object_new_checked to mono_object_new_handle. (#7129) 2018-02-20 15:24:21 -05:00
Paul Fertser dd4dbd8d4b [System.ServiceModel] Prevent crash in Dispatcher.ListenerLoopManager… (#7136)
In certain cases of having concurrent WCF requests
HttpReplyChannel.TryReceiveRequest can return true with the context
being null ("at closing phase").

This patch prevents crashing the whole application with a
NullReferenceException as reported in issue #7134.

Whether this is just covering the issue over or a real fix is yet to be
determined.

Fixes https://github.com/mono/mono/issues/7134
2018-02-20 14:05:05 -05:00
Alexis Christoforides 1791e50b56 [class] Fix resolution of interfaces in classes implementing IEnumerator. Fixes #59400
Assume a class implementing multiple generic I`1 interfaces. If a virtual call invocation is trying to resolve the correct interface using object O implementing I`1 also , the interface is resolved using a set of rules (not fully implemented in Mono), but a requirement is that the chosen interface is "variant-compatible" with object O, that is its generic parameters are set to the same types.

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

Resolution of classes implementing IEnumerator should still attempt to select a compatible interface using the standard rules before attempting to apply this special rule.
2018-02-20 12:13:16 -05:00
monojenkins 7b120ae2d4 [msvc] Update csproj files (#7140) 2018-02-20 17:01:19 +01:00
Bernhard Urban 98cadff5f6 bump nunit-lite
Commit list for mono/NUnitLite:

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

Diff: https://github.com/mono/NUnitLite/compare/0dc7716771023274074160d1816c2fa610e23d2f...b7776829bb7b2f9c58db045a6f40be40bcd96761
2018-02-20 14:59:24 +01:00
Rodrigo Kumpera ecadc6cf31 [wasm] Make .stamp-depot-tools more reliable. (#7078) 2018-02-20 14:34:03 +01:00
Marek Safar 9b1e845740 [corlib] order sources content 2018-02-20 07:52:45 +01:00
Alexander Köplinger bf3ed7115b [corlib] Add System.Runtime.ProfileOptimization APIs (#7120)
They are starting to be used by Roslyn (https://github.com/dotnet/roslyn/commit/eed147d330e92a55cb2daa26acb28fcde1776f04)
and without them we crash because we can't load the type.

Making the APIs no-ops is explicitly allowed by the docs (e.g. on single-core machine):
https://docs.microsoft.com/en-us/dotnet/api/system.runtime.profileoptimization.startprofile?view=netframework-4.7.1#Remarks

* Bump corlib version otherwise monolite won't work with recent csc
2018-02-20 02:35:08 +01:00
Miguel de Icaza 6a01a0b314 WinForms: Enable external CocoaDriver external driver (#7100) 2018-02-20 02:29:52 +01:00
Alexander Köplinger a65c354f7b Bump api-snapshot submodule 2018-02-19 20:15:46 +01:00
Alex Rønne Petersen 4d52a10ca0 [mini] Move some arch-specific interpreter logic into backends and provide stubs. 2018-02-19 18:02:12 +01:00
Alex Rønne Petersen 4358581865 [mini] Don't use arch_target to point to arch/ subdirs.
This is unnecessary and doesn't really make sense semantically in general as
some targets might define a different arch_target depending on bitness, while
still using the same arch/ subdir.
2018-02-19 18:02:12 +01:00
Alex Rønne Petersen e9c51fa3e5 [mini] Use a MONO_ARCH_INTERPRETER_SUPPORTED define instead of checking archs in driver.c. 2018-02-19 18:02:12 +01:00
Ludovic Henry 23acd0f78b Fix for XA integration 2018-02-19 16:59:45 +01:00
monojenkins 7da8b503c6 [msvc] Update csproj files 2018-02-19 16:50:41 +01:00
Egor Bogatov f6a6779ff5 [corlib] CoreRT System.Threading.Tasks (#6672) 2018-02-19 15:59:33 +01:00
jaykrell ed95106965 Coop/handle conversion of ByteArrayToCurrentDomain and ByteArrayToRootDomain. (#6692) 2018-02-18 20:08:46 -08:00
monojenkins c4d1da6ef3 [master] [sdks] Fix for XA integration (#7103) 2018-02-18 21:13:09 -05:00
jaykrell a7ed34f4db Centralize handle-based post-object creation code. (#7096)
i.e. merge 20e69fa199 and d7626e8217.

Remove some redundant error_init calls.
2018-02-18 00:58:44 -08:00
jaykrell 79ef9d5105 Fix race condition in mono_thread_execute_interruption. (#6833)
* Fix race condition in mono_thread_execute_interruption.

* Cleanup mono_thread_execute_interruption w/o semantic change.
2018-02-17 15:01:00 -08:00
jaykrell d7626e8217 [coop] Add handle-based object create functions. (#6876)
* Change first parameter of mono_nullable_box from guint8* to gpointer to avoid casts.

* [Coop] Provide object creation functions that return handles
and related. Existing functions are left unchanged
instead of layering over new to allay performance concerns.

Note that there are several variations new_object:
	alloc vs. non-alloc
	fast vs. regular -- fast does not handle finalization or weak fields and is external only
	specific vs. non-specific -- specific is "vtable" and "non-specific" is "class"

"_handle" implies "_checked" if we can get away with it, as conversion continues

mono_gc_alloc_handle_array
mono_gc_alloc_handle_mature
mono_gc_alloc_handle_obj
mono_gc_alloc_handle_pinned_obj
mono_gc_alloc_handle_string
mono_gc_alloc_handle_vector
mono_gc_register_object_with_weak_fields(MonoObjectHandle) (raw "obj" vs. handle "object")
mono_gc_wbarrier_object_copy_handle
mono_nullable_box_handle
mono_object_clone_handle
mono_object_new_by_vtable               "_by_vtable" instead of "_specific", and implies handle
mono_object_new_handle                  "_by_class" implied
mono_object_new_handle_mature           "_by_class" implied
mono_object_new_pinned_handle           "_by_class" implied
mono_object_register_finalizer_handle
mono_value_box_handle

* Combine mono_object_new_fast and mono_object_new_fast_checked.
2018-02-17 01:43:02 -05:00
Alexander Köplinger aec2773e1d Revert "[System.Drawing] Disable tests except on ARM64 (#6909)"
(reverted from commit 5e7483f354)

dcda4c77bc is a better approach.
2018-02-16 21:16:16 +01:00
jaykrell 83ed33ba2c [Coop] Convert Console to Coop/Handles. (#7060) 2018-02-16 10:09:42 -08:00
Zoltan Varga b043ff5f74 [aot] Bump aot file format version because of 7cac757e60. (#7079) 2018-02-16 00:59:04 -05:00
jaykrell ded74c0b12 Use the preallocated domain->out_of_memory_ex instead of allocating. (#6819) 2018-02-15 18:23:58 -08:00
Aleksey Kliger 52514effbf [marshal] For generic method icalls, handle generic param arguments when using coop handles
Suppose we wanted to use coop handles to implement the following icall:

   [MethodImpl (InternalCall)]
   extern void GetGenericValueImpl<T> (int idx, T out value);

The question is: how should we pass the argument "value" to the C code?

If it was a reference type like "string" , we would use a coop handle:
    void ves_icall_GetGenericValueImpl_string (gint32 idx, MonoStringHandleOut value, MonoError *error);

But if it was a valuetype, we would instead pin the memory with an interior
handle and pass the raw address:
    void ves_icall_GetGenericValueImpl_int32 (gint32 idx, gint32 *value, MonoError *error);

But we don't have two different implementation on the C side - there's just one
icall - we have to choose a single mechanism.

So the mechanism we choose is to treat all the args like valuetypes - pin the
memory in the wrapper and pass a raw pointer to the C side.

The other troubling possibility is if someone writes:
   [MethodImpl (InternalCall)]
   extern void BadInternalCall<T> (Something s, T bad);

Now we really don't have any options.  So we just assert that noone ever writes
such a call.
2018-02-15 18:50:02 -05:00
jaykrell e01355eead [Cplusplus] Fix possible race condition and add casts between void* and function pointers. (#6871) 2018-02-15 13:12:27 -08:00
Alexis Christoforides 9209ea0629 Merge pull request #7073 from mono/disable-test-sleep
Disable a flaky test on PRs (https://github.com/mono/mono/issues/6999)
2018-02-15 14:53:50 -05:00
Zoltan Varga cfa087bfd7 [aot] Rename mono_aot_get_method_checked () to mono_aot_get_method (), there is no non-checked version anymore. (#7071) 2018-02-15 14:12:13 -05:00
Vlad Brezae e2419dee78 [interp] Add missing exception checkpoints (#6917)
On interp we can't async abort since we cannot unwind from an ip in the interp, so the interpreter does explicit checks as part of branch instructions.

Note this can lead to increased stack usage when compiling with -O0.
2018-02-15 20:27:32 +02:00
Alexis Christoforides 1028994a88 Disable a flaky test on PRs (https://github.com/mono/mono/issues/6999) 2018-02-15 12:29:38 -05:00
monojenkins cf644472f9 [msvc] Update csproj files (#7070) 2018-02-15 16:43:51 +01:00
Zoltan Varga 23e6f6f4b5 Revert "[jit] Make some JIT regression test files compile in the mobile profile (#7059)" (#7069)
This reverts commit e2874db522.

Revert this as it breaks the SDK tests.
2018-02-15 16:43:30 +01:00
Zoltan Varga b7385ba797 [sdks] Add targets for the watch cross compiler. (#7061)
* [offsets-tool] Add an '--output' argument to specify the output file directly instead of generating it from the target triple.

* [sdks] Add targets for the watch cross compiler.
2018-02-15 10:07:37 -05:00
Jay Krell fc7bda62d3 [coop] Convert some mono_exception_* functions
Reduce managed exposure in utils a little.

[coop] install object-forward.h
2018-02-15 10:06:17 -05:00
Zoltan Varga e2874db522 [jit] Make some JIT regression test files compile in the mobile profile (#7059)
Remove tests from Mono.Runtime.Tests which depend on assemblies not in the mobile profile.
2018-02-15 15:07:44 +01:00
jaykrell ea1fac3d89 [coop] Remove unnecessary write barriers against thread locals and cleanup a little. (#6874)
Restore scope for Centrinel, because the array macros
are not expressions, so MONO_HANDLE_SUPPRESS does not work.
2018-02-15 03:00:26 -08:00
Miguel de Icaza 3bd630eba7 [mkbundle] Automatically bundle config files and machine.config files (#7002)
* [mkbundle] Automatically bundle config files and machine.config files for the simple/cross compiler scenario, fixes one of the missing issues for #6230
2018-02-15 10:07:16 +01:00
jaykrell b90d8ec387 Remove GetNLSocket which is unused and produces a warning because it is unprototyped. (#6691) 2018-02-14 19:25:27 -08:00
jaykrell 4a83009a03 WSL does not nul terminate uname.release. memset(0) it first. (#7023) 2018-02-15 01:11:27 +01:00
Alexis Christoforides 8d82699736 Merge pull request #7057 from lewurm/interp-disable-flaky-pinvoke-test
[interp] disable flaky pinvoke test
2018-02-14 19:09:23 -05:00
Marek Safar 62bf8bd4d5 [System.ServiceModel.Activation] Move ServiceHostFactory.cs where it's used (#7044) 2018-02-15 00:55:45 +01:00
Bernhard Urban 2322177e6a [interp] disable flaky pinvoke test 2018-02-15 00:51:24 +01:00
jaykrell 8ad191dfbb mono_get_exception_runtime_wrapped_checked contains an unnecessary 16 (#6659)
element array that can be just 1 element, or completely absent.
It is a rare path, but stack use should always be minimized.
2018-02-14 14:59:26 -08:00
jaykrell 20e69fa199 Centralize post-object creation code in mono_object_new_common_tail. (#6903)
This resolves inconsistency around support of weak fields (bug?)
and is smaller and easier to maintain.
2018-02-14 14:56:09 -08:00
Vlad Brezae a33cbb873c [interp] Fix native to interp transition (#6868)
When using the interp_wrapper to enter interp from native we don't need to save the lmf since it doesn't make sense to unwind to native. Also make sure we have the interp context set up if we weren't attached at interp transition time.
2018-02-14 23:09:59 +02:00
Zoltan Varga 7cac757e60 [aot] Emit the weak field indexes table using the MONO_AOT_TABLE code, so it works with separate aot data files/bitcode.
Fixes https://github.com/mono/mono/issues/6948.
2018-02-14 22:02:38 +01:00
Ankit Jain 8c90350d11 Add denied assembly versions from previous ms extensions nugets
Extracted from Microsoft.NET.Build.Extensions

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

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

A future commit will sort and de-dedup the lists, but this one avoids
removing any existing duplicates, to make review easier.
2018-02-14 18:59:11 +01:00
Miguel de Icaza 47187bbc9b [Mono.Posix] .NET Core compatibility - Use [In,Out] for arrays of structures
While Mono does copy the values of arrays back when they are marshaled
to unmanaged code, .NET does not seem to be doing this, and manifests
as the Syscall.poll invocation in Mono.Posix with .NET Core does not update
the values in the provided array.

The following example should print "Got 1 and 1" with the following command:

```
echo foo | dotnet run
```

But instead prints 0 and 1 on .NET Core, but the correct result with Mono.

This patch is going here for the sake of the Mono.Posix.NetCore package that
we publish.

Sample:

```
using System;
using System.Runtime.InteropServices;

class X {
        private struct _pollfd {
                public int fd;
                public short events;
                public short revents;
        }

        [DllImport("libc")]
        static extern int poll ([In,Out]_pollfd[] ufds, uint nfds, int timeout);

        static void Main ()
        {
                var p2 = new _pollfd [1] { new _pollfd () { fd = 0, events = 1 } };
                var m = poll (p2, 1, -1);

                Console.WriteLine ("Got: {0} and {1}", n, pollmap [0].revents);
                Console.ReadLine ();
        }
}
```
2018-02-14 18:53:08 +01:00
Ludovic Henry 57f3f34e60 Revert "[coop] Remove support for invoke thunk wrapper" (#6927)
We still want to be able to invoke thunk wrappers. The transition to MonoHandle will be a separate change.

This reverts commit 150d896d19.
2018-02-14 12:03:23 -05:00
Rodrigo Kumpera 8d19e5a1c5 [runtime] Unboxing of nullable enums should throw for boxed ints. (#6958)
* [runtime] Unboxing of nullable enums should throw for boxed ints. Fixes gh #6666.

For some reason, one can't unbox the underlying type of an enum into a nullable.

This is counter intuitive to the unboxing rules of enums, but it's what dotnet does.

* [interp] Unboxing of nullable enmus should throw for boxed ints

fixes https://github.com/mono/mono/issues/6666 for the interpreter
2018-02-14 17:58:15 +01:00
Bernhard Urban 8f35227b88 [debugger] disable StepOutAsync test because it's flaky 2018-02-14 15:33:22 +01:00
Ludovic Henry 545191f773 Pass null-terminated string for logging 2018-02-14 11:54:06 +01:00
Bernhard Urban 2c1f45f379 [TermInfo] support new file format terminfo2 introduced with ncurses6.1 (#6960)
See also https://github.com/mirror/ncurses/commit/1501ae2a13db0ffd2db8404c24aa5010a88ea91b#diff-2c0786db969084ba9e087d82f8275e0b

Fixes https://github.com/mono/mono/issues/6752
2018-02-14 05:35:11 +01:00
Don Syme 3012ce06e4 Update F# to 4.1.33
Next update to F# to include regression fix Microsoft/visualfsharp#4348
2018-02-14 02:31:23 +01:00
Zoltan Varga ff98989579 [runtime] Avoid recreating the icall table in lookup_icall_symbol (). (#6988) 2018-02-13 19:42:37 -05:00
Zoltan Varga 17b4b28f05 [sdk] Fix the invocation of run-step.sh, the --timeout argument is mandatory. (#7013) 2018-02-13 18:04:49 -05:00
Zoltan Varga 3fdbbe5e44 [sdks] Fix the tar command since the llvm binaries are in different directories now. (#7010) 2018-02-13 23:01:41 +01:00
Rodrigo Kumpera f4d3da6d4a [runtime] Fix merge conflict and Move code to its right place. 2018-02-13 14:00:29 -08:00
Rodrigo Kumpera c3c6e6c9cd [runtime] Ignore FireProcessExit if the method is missing on corlib. 2018-02-13 12:30:18 -08:00
Rodrigo Kumpera b9b08c0d02 [runtime] Implement a domain resistant version of mono_domain_foreach and switch the unloading code to use it.
Ensure that the callback to mono_domain_foreach_safe can actually do stuff with the domain argument like running code.

This new function make it possible to do so safely, unlikely the previous one.

This ensures that the process exit callback has a shot of correctly executing on domains racily being unloaded.
2018-02-13 12:30:18 -08:00
Rodrigo Kumpera 755c5bd713 [runtime] Fix docstring for mono_unhandled_exception_checked. 2018-02-13 12:30:18 -08:00
Rodrigo Kumpera 4f8968cf6c [corlib] Fix minor style issue. 2018-02-13 12:30:18 -08:00
Rodrigo Kumpera 1fd32df7d1 [runtime] Introduce a non-fatal unhandled exceptions and use it for AppDomain::ProcessExit.
Introduce AppDomain::NonFatalUnhandledException icall that delivers an exception as an unhandled exception but don't fail the process.
2018-02-13 12:30:17 -08:00
Bernhard Urban c9c7dad3a3 Bump mono/NUnitLite
Commit list for mono/NUnitLite:

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

Diff: https://github.com/mono/NUnitLite/compare/a8bef89392920dd0ef5d74ef3563d97083246414...0dc7716771023274074160d1816c2fa610e23d2f
2018-02-13 21:25:33 +01:00
Rodrigo Kumpera dd2c320aa3 [runtime] Change domain before firing ProcessExit. 2018-02-13 12:24:12 -08:00
Rodrigo Kumpera 7500341ec0 [runtime] Run the ProcessExit events in the threadpool and enforce a 3 seconds limit. Fixes #10087
The ProcessExit event is fired before the threadpool is shutdown, so we can leverage that to run them
with a timeout.

The timeout is 3 seconds per appdomain. It could be improved by making that global to all domains if that
ever becomes an issue.
2018-02-13 12:24:12 -08:00
Rodrigo Kumpera 6e28ccb4e5 [utils] Add "exec" log category for misc runtime activity.
This is intended to be a catch-all category for all sorts of miscellaneous events
we don't have a clear category for and that don't deserve one.
2018-02-13 12:12:10 -08:00
Alexis Christoforides 96f2d163a3 Merge pull request #6970 from dsyme/patch-1
Bump F# mono version to 4.1.32
2018-02-13 13:37:20 -05:00
Marek Safar e52ef6aedd [build] Fixes monolite build (#6982) 2018-02-13 19:33:04 +01:00
monojenkins 36cbab657f [msvc] Update csproj files 2018-02-13 16:50:22 +01:00
Rodrigo Kumpera f61bc393d3 Simplify MonoError and managed Exception creation (#6123)
MonoError is simplified for MME by having the error message eagerly created, which simplifies things A LOT.
Managed Exception creation is simplified by only setting Message, as it's done by other runtimes.

* [mini] Fix mini_emit_memory_copy_internal with ref types and remove workaround from mono_method_to_ir

* [mini] Remove unused argument and rename function to better reflect its use.

* [utils] Fix swapped member and signature fields in error message.

* [runtime] Simplify MME by only setting the message field since ClassName/MemberName don't need to be set.

* [runtime] Add mono_error_set_method_missing to exceptions.c and collapse setting MME to a single function.

This implements the cleanup discussed in the PR.

* [runtime] Cleanup MonoError for BadImageFormatException.

Move mono_error_set_bad_image & mono_error_set_bad_image_name to exception.c.
Rename mono_error_set_bad_image_name to mono_error_set_bad_image_by_name.

Introduce mono_corlib_exception_new_with_args to be used when creating exception objects.
It's easier to consume than mono_exception_from_name_two_strings_checked as it takes string arguments as char*.

Fix usage of mono_error_set_bad_image_by_name to never dup the supplied image name as the callee does it.
Fix some empty error messages.

Finally, reduce the cruft in mono_error_prepare_exception by using the new exception creation function from above.

* [runtime] Cleanup MonoError of FileNotFoundException.

Move it to use the generic first_argument and make it a simple error - IE, get_message doesn't format anything.

* [runtime] Rework MonoError for MissingFieldException.

* Fix build issues

* [runtime] Ensure memory is freed using new MonoError set functions.
2018-02-13 16:24:00 +01:00
Alexander Kyte 60d4907f48 [runtime] Revert mkbundle defaulting behavior made in ca8b8bd346 (#6687)
Fixes https://github.com/mono/mono/issues/6187
2018-02-13 09:59:53 -05:00
Alexander Köplinger d8d3e29f38 Bump api-snapshot 2018-02-13 15:14:58 +01:00
Don Syme 0354912603 Bump F# mono version to 4.1.32
This version contains a fix to fsharpi to make no-gui the default again
2018-02-13 13:41:31 +00:00
Radek Doulik d573dec96e Bump linker and update linker-analyzer references 2018-02-13 14:31:03 +01:00
Vlad Brezae d6e7483454 [interp] Fix CEE_UNBOX
When unboxing nullable we call Nullable.Unbox which returns the valuetype, but CEE_UNBOX needs to return an address to it. Therefore we store the result in a local in the frame so we can get its address.
2018-02-13 13:44:01 +01:00
Aleksey Kliger (λgeek) 7a528f6f97 [sre] Unlock loader lock on error paths (#6951) 2018-02-12 20:48:27 -05:00
Alexander Köplinger e572acca55 [ci] Only create artifacts.json GitHub status on release branches 2018-02-13 02:00:13 +01:00
Alexander Köplinger 939d720770 [ci] Disable monodoc tests on Windows for now
They fail: https://github.com/mono/mono/issues/6956
2018-02-13 01:51:12 +01:00
Rodrigo Kumpera ea7b3849c4 Cleanup recent JIT fix to get it done in the right place. (#6895)
* [mini] Fix mini_emit_memory_copy_internal with ref types and remove workaround from mono_method_to_ir

* [mini] Remove unused argument and rename function to better reflect its use.
2018-02-13 00:22:06 +01:00
jaykrell 29d402d8e0 [handle] Have MONO_HANDLE_* macros use a uintptr_t instead of int (#6906) 2018-02-12 18:15:34 -05:00
Zoltan Varga 25c41cbf41 Fix gshared support for default interface methods by always passing an mrgctx to them. (#6935)
* Fix gshared support for default interface methods by always passing an mrgctx to them.

This is needed because these methods can be part of more than one inheritance hierarchy or
be present more than once in the same inheritance hierarchy so its not possible to
assign rgxtx slots to their gshared entries that would work in all cases.

* [jit] Add a mini_method_is_default_method () helper function.
2018-02-12 17:36:27 -05:00
Alexis Christoforides 1c631424d2 Merge pull request #6929 from mono/disable-test-TaskCancelWait1
[System.Threading.Tasks] Disable a flaky test (corefx bump)
2018-02-12 13:16:29 -05:00
Alexis Christoforides dcecd8ff83 Disable flaky test
(https://github.com/mono/mono/issues/6947)
2018-02-12 13:02:49 -05:00
Martin Baulig b97d0c43d1 [System]: WebConnection.Connect() needs to probe all IP addresses.
Fix a regression introduced in the new web stack - when connecting
to a DNS host name that resolves to multiple IP addresses, we need
to probe them all.

On iOS, "localhost" will resolve to both "::1" and "127.0.0.1".
2018-02-12 16:59:58 +01:00
jaykrell e43adf3cd5 Change mono_thread_resume_interruption to return void, one less raw pointer to worry about. (#6690) 2018-02-12 01:29:11 -05:00
jaykrell c944c358f1 [scripts] Fix scripts/update_submodules.sh for use with git worktree 2018-02-11 23:15:25 -05:00
Zoltan Varga 7f9167bc5b [runtime] Fix the --enable-icall-symbol-map build. (#6943) 2018-02-11 18:32:55 -05:00
Zoltan Varga 921132a362 [runtime] Make icall tables loadable. (#6905)
* [runtime] Make icall tables loadable.

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

* Change ClCompile to ClInclude for new .h file.
2018-02-11 10:43:07 -05:00
Alex Rønne Petersen d8beb3ef11 [profiler] Remove obsolete code coverage support from the log profiler. (#6896) 2018-02-10 15:57:52 -05:00
Zoltan Varga 48898cb810 [sdks] Fix ios+llvm. (#6939) 2018-02-10 10:47:47 -05:00
Zoltan Varga 7f47f19085 [runtime] Fix a warning. (#6937) 2018-02-10 10:23:50 -05:00
Vlad Brezae b970e766fa [interp] Add class failure checks 2018-02-10 10:14:05 +02:00
Vlad Brezae 52ebab8603 [interp] Fix varargs passing
We must not push one vararg at a time since the alignment of the argument is not the same as the alignment of a value type in interp (which is always 8)
2018-02-10 10:12:39 +02:00
Vlad Brezae 3369b6e214 [interp] Align vt stack in some places 2018-02-10 10:12:39 +02:00
Vlad Brezae 6ffa48f6ad [interp] Add define for value type alignment 2018-02-10 10:12:39 +02:00
Zoltan Varga 9f2b8595a3 [jit] Fix the DISABLE_JIT build. (#6933) 2018-02-10 02:14:04 -05:00
Zoltan Varga 5c4510a8a7 [runtime] Implement support for conflict detection for Default Interface Methods. (#6897)
Detect conflicts caused by diamond inheritance during vtable construction, and throw an exception when a conflicting
methods is called.
Disable generic sharing for default interface methods, it doesn't work yet, probably
because these methods are called on classes, but the gshared information is associated with the interface.
Enable dim-diamondshape.exe test.
2018-02-09 21:28:19 -05:00
Zoltan Varga 284c5afdf4 Bug 60088 - Assertion at ../../../../external/mono/mono/mini/debugger-agent.c:4765, condition `array->len == 1' not met (#6902)
Problem was that I didn't consider `async void` method when adding that assert
2018-02-09 19:15:32 -05:00
Alexis Christoforides 6a5a14bea7 [System.Threading.Tasks] Disable a flaky test 2018-02-09 17:48:19 -05:00
Alexis Christoforides dcda4c77bc Disable some PngCodecTest that have trouble on CI right now 2018-02-09 15:36:18 -05:00
Alexander Köplinger 5e7483f354 [System.Drawing] Disable tests except on ARM64 (#6909)
See https://github.com/mono/mono/issues/6908
2018-02-09 21:22:16 +01:00
monojenkins dd5b5ca52e Set NetworkStream.ReadTimeout in WebConnection.InitConnection(). (#6904)
Setting ReadTimeout in WebResponseStream.ctor throws System.Net.Sockets.SocketException : Invalid arguments on iOS.

Set it in WebConnection.InitConnection() immediately after establishing a connection, before we read/write anything.
2018-02-09 21:21:52 +01:00
Zoltan Varga 2a3b0812a4 [jit] Simplify some gshared code. (#6899)
* [jit] Simplify some gshared code by calling mini_method_get_rgctx () in more places, make mono_method_lookup_rgctx () static. NFC.

* [jit] Get rid of the 'method' argument to emit_get_rgctx (), it should always be equal to cfg->method. NFC.
2018-02-09 12:52:26 -05:00
Bernhard Urban 2a3c498cbf [interp] disable test_42_arm64_dyncall_vtypebyval
regression test introduced by https://github.com/mono/mono/pull/6826
fails on ARM64 with interp
2018-02-09 17:29:36 +01:00
Ankit Jain 43617b0123 nuget-hash-extractor: Add msbuild extensions nuget to list of nugets to
.. process. Version from:

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

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

Also, update the list in the runtime and deniedAssembliesList.txt
installed for use by msbuild.
2018-02-09 11:28:48 -05:00
Ankit Jain 4cb7884477 nuget-hash-extractor: Add support for handling nuget with multiple
.. assemblies.

This is specifically required for handling .net assemblies in
`Microsoft.NET.Build.Extensions` nuget which don't work on mono. These
assemblies are bundled with msbuild and we want to be able to deny these
at runtime.
2018-02-09 11:28:48 -05:00
monojenkins d2998f5089 [msvc] Update csproj files 2018-02-09 11:24:46 -05:00
Marek Safar 71ad99f720 [build] Narrow recursive dependencies 2018-02-08 23:49:44 -05:00
Marek Safar b3d60257e5 [Mono.Security] Remove unused using 2018-02-08 23:49:44 -05:00
Rodrigo Kumpera 06b836ed91 [wasm] Make v8 build verbose and fix zip package root. (#6900) 2018-02-09 02:27:17 +01:00
Tychshenko, Dmitriy 06a89a59bc Adjust tabbing. 2018-02-08 16:52:39 -05:00
Tychshenko, Dmitriy b2ec39daa5 Add ordinal comparison when matching request path to listener paths 2018-02-08 16:52:39 -05:00
Tychshenko, Dmitriy 8917ddfb0c Fixes WCF methods with path parameters in UriTemplate annotation. Bugzilla bug #25444 [https://bugzilla.xamarin.com/show_bug.cgi?id=25444] 2018-02-08 16:52:39 -05:00
Tychshenko, Dmitriy f3b1c9bd88 Pick the Listener that matches the start of the request URL 2018-02-08 16:52:39 -05:00
Alexander Köplinger c84e6c81a2 [bcl] Fix more assembly identity mismatches (#6870)
As a follow up to https://github.com/mono/mono/issues/6848 I checked
all the assemblies and found some more identity mismatches with .NET
2018-02-08 22:22:37 +01:00
Rodrigo Kumpera 9adf4bd322 [wasm] Add system test suite exclude file. (#6847) 2018-02-08 22:08:17 +01:00
Ludovic Henry b6784b27a5 [sdks] Fix build for iOS (#6878) 2018-02-08 14:36:07 -05:00
Alexander Köplinger 3f61f9ff5d configure.ac: Only use library path in libgdiplus_loc
We use the value defined there to insert into `config` file in
runtime/Makefile.am and this would get the "preinstalled at" string.
2018-02-08 20:32:17 +01:00
jaykrell af03c6ae83 Detect libgdiplus in configure.ac by default on MacOSX (darwin). (#6873) 2018-02-08 20:02:45 +01:00
Alexander Köplinger b3eabd51c3 Bump bockbuild 2018-02-08 19:42:41 +01:00
Martin Baulig 8bfcb27147 [System]: Revert my latest WebResponseStream changes.
This reverts PR #6662 (commit 18a1a25) and #6771 (commit da03780).

These two changes introduced a regression:
https://github.com/mono/mono/issues/6788
2018-02-08 12:52:36 -05:00
Alexander Köplinger b9d463acb5 Bump bockbuild to get new gtk+ repo location 2018-02-08 17:54:05 +01:00
monojenkins 8e678de3f3 [msvc] Update csproj files 2018-02-08 11:38:43 -05:00
Marius Ungureanu a5078a2815 Bump bockbuild to add gtk# generator fix (#6880)
Bug 61202 - Fatal error when adding aspect ratio constraint
2018-02-08 15:32:10 +01:00
Alexis Christoforides 3203c8bfb3 Merge pull request #6835 from alexischr/disable-monitor-wait-test
Disable a couple of flaky tests (monitor-*abort)
2018-02-07 22:59:27 -05:00
Ludovic Henry fcb97b2279 [sdks] Add Android build for CI (#6846) 2018-02-07 22:16:38 -05:00
jaykrell 149073b84c Use gpointer (void*) as a generic pointer, not char*. (#6704)
This allows for removing many casts, and casts are bad.

Also, gulong does not hold a pointer on Win64, favor uintptr_t (or gsize).
2018-02-07 17:35:19 -08:00
Alexander Köplinger 31784ba06c [reference-assemblies] Fix public key for some newer v4.7.1 facades (#6863)
Fixes https://github.com/mono/mono/issues/6848
2018-02-08 01:07:39 +01:00
Ludovic Henry 1ad2fc4891 [sdks] Fix download-llvm.sh 2018-02-07 17:29:51 -05:00
Bernhard Urban 9cab3d73c6 [timezone] ignore LocalId test on XAMMAC_4_5 too
https://github.com/xamarin/maccore/issues/628
2018-02-07 23:14:02 +01:00
Ludovic Henry 2c96890aff [sdks] Fix execution permission of download-llvm.sh 2018-02-07 15:31:02 -05:00
Martin Baulig e9235144ca Bump corefx. (#6810) 2018-02-07 21:13:11 +01:00
Aleksey Kliger (λgeek) 766bf49afb [metadata] Define getters for MonoClass fields (#6652)
* [configure.ac] Add --enable-checked-build=private_types option

  The idea is that when private_types is turned on, we will hide the definitions
  of various structs in Mono and only allow access via getter/setter
  methods.

  If private_types is off, those same getters would be static inline functions
  and also the struct definition would be visible (to allow for incremental
  conversion of existing code).

* [metadata] Move _MonoClass definition to class-private-definition.h

* [metadata] Define a getter for every MonoClass field

  in a checked build, the getters are just declared in class-internals.h and
  defined in class-accessors.h

  in a non-checked build, the getters are static inline functions in class-internals.h

  For a field foo of type FooType define
      FooType m_class_get_foo (MonoClass *klass) { return klass->foo; }

  The exceptions are fields that are embedded structs, e.g. MonoType byval_arg,
  for those we return a pointer to the field instead of a copy:
      MonoType * m_class_get_byval_arg (MonoClass *klass) { return &klass->byval_arg; }

* [metadata] Rename MonoClass boolean getters to use is/has names

  instead of the string m_class_get_fieldname pattern

  - m_class_is_inited
  - m_class_is_size_inited
  - m_class_is_valuetype
  - m_class_is_enumtype
  - m_class_is_blittable
  - m_class_is_unicode
  - m_class_was_typebuilder
  - m_class_is_ghcimpl
  - m_class_has_finalize
  - m_class_is_delegate
  - m_class_is_gc_descr_inited
  - m_class_has_cctor
  - m_class_has_references
  - m_class_has_static_refs
  - m_class_has_no_special_static_fields
  - m_class_is_com_object
  - m_class_is_interfaces_inited
  - m_class_is_simd_type
  - m_class_is_has_finalize_inited
  - m_class_is_fields_inited
  - m_class_has_failure

* [metadata] (class-internals.h) Use m_class_get_ getters

* [metadata] (class-inlines.h) Use m_class_get_ getters

* [metadata] (class-accessors.c) Use m_class_get_ getters; setters not done

  The setters are not converted.
  Ultimately, I think that will sort itself out - a few of them are only used
  from SRE and from MonoClass construction - we will eventually provide setters
  for just two places and hide them elsewhere.
2018-02-07 13:01:19 -05:00
Egor Bogatov c1fd4b064d Add stubs for Interop.NetSecurityNative (#6824) 2018-02-07 10:48:05 -05:00
Zoltan Varga d813c533b9 [arm64] Handle arguments of type ArgVtypeOnStack in the dyn call code. Part of the fix for #59184. (#6826) 2018-02-07 10:29:49 -05:00
Ludovic Henry d79a892d77 [configure.ac] Do not always enable ninja (#6823) 2018-02-07 09:47:57 -05:00
Alexis Christoforides 0a3d7c0da6 Disable a couple of flaky tests (monitor-*abort) 2018-02-07 09:21:57 -05:00
Ludovic Henry 43026da5d4 [sdks] Bring back download of llvm for iOS (#6818)
Revert part of https://github.com/mono/mono/commit/605cadfb09d6c79723763b8afd09480a5941eabf
2018-02-06 18:56:32 -05:00
Alexander Köplinger f8a4bbd357 [ci] Add setting artifacts.json status
Needed for QA automation.
2018-02-07 00:41:53 +01:00
Alexander Köplinger 687dc212dc [ci] Add Windows .msi PR build (#6815)
Use the trigger `@monojenkins build pkg and msi`.
2018-02-07 00:31:28 +01:00
Vlad Brezae 4b8e0bea19 [interp] Add support for vararg call convention
When doing a vararg call we push on the vtstack the current call signature followed by the params. The child_frame will have a pointer to this memory on the parents vt_stack from where it can linearly access the varargs using the same ArgIterator logic.
2018-02-06 16:15:51 +01:00
Vlad Brezae f6786099a5 [glib] Include ALIGN_TO and ALIGN_PTR_TO 2018-02-06 16:15:51 +01:00
Vlad Brezae d3647fa17e [interp] Add storage fetching for typedbyref
Which is just a structure.
2018-02-06 16:15:51 +01:00
Vlad Brezae c8b7d6eece [interp] Add class check for refanyval 2018-02-06 16:15:51 +01:00
Vlad Brezae b66cbf955f [interp] Remove virtual call duplicated code 2018-02-06 16:15:51 +01:00
Vlad Brezae c3c2819da7 [interp] Remove void call duplicated code 2018-02-06 16:15:51 +01:00
Vlad Brezae ed9e0d101d [interp] Rename variable 2018-02-06 16:15:51 +01:00
Vlad Brezae f6964ef658 [interp] Remove some null checks
We emit explicit MINT_CKNULL. Add missing null check for internal multidimensional array runtime calls.
2018-02-06 16:15:51 +01:00
monojenkins e8cdc382a7 Bump API snapshot submodule 2018-02-06 09:52:24 -05:00
Egor Bogatov 1dd3fd1c64 Add missing api to System.Data (fixes 6767) 2018-02-06 09:52:24 -05:00
Rodrigo Kumpera 386b4d2bc6 [Mono.Posix] Fix the Android xattr check to not disable it on all other platforms. 2018-02-06 09:05:48 -05:00
Zoltan Varga 9317773e68 [tests] Disable threads-init.exe, it runs out of system threads. (#6803) 2018-02-06 00:04:18 -05:00
Alex Rønne Petersen 63652bfc25 [utils/threads] Gracefully handle ENOTSUP from pthread_kill () on Apple platforms. (#6754) 2018-02-05 17:33:04 -05:00
jaykrell 96082e3495 Fix some function pointer types to match, i.e. so C++ compiles w/o extra casts. (#6732) 2018-02-05 14:21:44 -08:00
Ludovic Henry ed4331a3d8 [ide] Add setup file for VSCode 2018-02-05 16:48:30 -05:00
Aleksey Kliger (λgeek) 993ed19a6f [metadata] Move MonoClass initialization to a separate file (#6611)
Use `git blame -C10 mono/metadata/class-init.c` to see attribution for most of the old code.

This PR comprises:

* [metadata] Move (some) MonoClass construction to class-init.c

So far moved MonoClassDef, MonoClassGtd and MonoClassGenericInst construction
functions.

The idea is to eventually isolate functions that needs write/setter access to
MonoClass fields in a separate translation unit and make MonoClass opaque and
only accessible via getters everywhere else.

* [metadata] Move pointer MonoClass creation to class-init.c

* Mark mono_ptr_class_get as external only, runtime should use
  mono_class_create_ptr.

* [msvc] Add mono/metadata/class-init.c (and .h) to the .targets file

* [metadata] Rename mono_generic_class_get_class

to mono_class_create_generic_inst

* [metadata] Move array class creation to class-init.c

* Mark mono_array_class_get external only, runtime should use
  mono_class_create_array
* Mark mono_bounded_array_class_get external only, runtime should use
  mono_class_create_bounded_array

* [metadata] Move generic param creation to class-init.c

* Also move mono_class_setup_vtable_general, mono_class_init_sizes, mono_class_setup_methods

* [metadata] Move mono_class_setup_basic_field_info to class-init.c

* [metadata] Move mono_class_setup_fields to class-init.c

* [metadata] Rename mono_class_from_generic_parameter_internal

to mono_class_create_generic_parameter

* [metadata] Move mono_class_layout_fields to class-init.c

* [metadata] Move mono_class_setup_{properties,events} to class-init.h

* [metadata] Move mono_class_setup_interfaces to class-init.c

* Also move mono_class_setup_mono_type

* [metadata] Move mono_class_setup_parent to class-init.c

* [metadata] remove some extern statistics
2018-02-05 16:31:42 -05:00
Zoltan Varga f01083ac48 [runtime] Add a 'frame_addr' field to MonoStackFrameInfo, which is equal to either interp_frame or ctx->sp. (#6644)
* [runtime] Add a 'frame_addr' field to MonoStackFrameInfo, which is equal to either interp_frame or ctx->sp.

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

* [ci] Reenable mixed mode tests.
2018-02-05 16:28:46 -05:00
Alexander Kyte c0bd5f8a5a [sdks] Script lldb android integration (#6310) 2018-02-05 15:47:35 -05:00
Alexander Köplinger c7f89e7837 [ci] Make sure packageFileName is a string
It was the file object before and just got turned into string
by coincidence in most places.
2018-02-05 21:35:12 +01:00
Ludovic Henry 51ec3ddf99 Bump version to 5.13 (#6792) 2018-02-05 15:21:08 -05:00
Martin Baulig da03780370 [System]: WebResponseStream now correctly reads the chunk trailer when using gzip/deflate. (#6771)
* [System]: WebResponseStream now correctly reads the chunk trailer when using gzip/deflate.

This should actually fix bug #59779.

* Add missing ConfigureAwait(false)
2018-02-05 14:45:56 -05:00
Alexander Köplinger 0bfda265b7 [ci] Report pending/failed status on GitHub for pkg/msi 2018-02-05 17:29:02 +01:00
Alexander Köplinger 4682391599 [ci] Include commit hash in blob URL of pkg/msi
This makes it easier to infer the commit just based on the URL.
2018-02-05 17:29:02 +01:00
Calvin d568c0b28d Support IBM AIX on POWER (#6677)
* Get autotools scripts for Mono and Boehm to recognize i

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

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

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

* Fix random and 64-bit file offset support

* Set TARGET on IBM i on POWER

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

From comment:

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

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

* Work around missing definition on AIX/PASE

* Fix conflicting definition from due too AIX headers

* Initial work to get JIT working on AIX

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

* needs calling convention work; AIX does NOT use ELF

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

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

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

* Handle regular AIX as well as PASE

* Implement stack boundaries check for AIX, volume info func

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

* highly uncertain for the bounds checking, needs further review

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

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

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

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

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

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

* Use pthread-stop-world.c on AIX

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

* AIX workarounds for some of support dir

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

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

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

* More support workarounds for AIX headers

* Replacement function body for syslog2 on vsyslog-less platforms

AIX lacks vsyslog; detect in autoconf and act appropriately.

* Final support hacks for AIX

* Fix problematic stack management on AIX

this gets us past ifdefs, after much handwringing

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

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

* Disable Boehm GC on AIX

Focus on getting SGen working, and avoid legacy debugging nonsense

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

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

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

* Perform a 64-bit build on AIX

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

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

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

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

* Fix stack size on AIX

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

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

* Fix hwcap to use better values on PPC AIX

Still needs more adjustment though

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

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

* We can use this definition on AIX

Now we can bootstrap Mono!

* Shuffle MonoArray ifdef per suggestion of @vargaz

* Fix System.Decimal division on big endian systems

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

* Fix dynamically linked build of Mono on AIX

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

* Fix PPC64 define in mono-config

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

* Don't use __thread even if detected on AIX

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

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

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

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

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

Also set libc and libintl to their proper values.

* Scheduling priority hack for i

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

* Final polish on request

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

* Be aware of ERESTART, on OSes that use it

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* [boehm] Fix warning in GC_push_all call

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

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

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

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

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

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

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

Examples:

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

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

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

* Tweaks.

* tweak

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

* whitespace

* fix comment

* remove diff-minimizing hacks

* cosmetic

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

* improving Makefile but still a ways to go

* fix C# indent

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

* update clean target in Makefile

* cleanup Makefile and C#

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

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

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

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

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

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

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

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

Errors and Failures:

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

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

* Review

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

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

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

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

* Fix comment in test code.

* format with s instead of hs

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

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

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

* [wasm] Address reviewer feedback.

* [wasm] Disable test that requires multiple threads.

* [wasm] Add package target to wasm.

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

* [wasm] Add CI configuration for WebAssembly.

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

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

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

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

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

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

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

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

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

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

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

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

Add comment for jit info freeing when having multiple tables.

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

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

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

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

Results are promising.

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

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

* code cleanup

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

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

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

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

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

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

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

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

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

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

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

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

* [bcl] Sort the MethodImpl table in PEAPI.

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

* [runtime] Fix vtable construction tracing.

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

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

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

* assume equivalence of error and null

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

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

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

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

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

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

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

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

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

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

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

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

Usage:

configure mono without the interpreter, such as:

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

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

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

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

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

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

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

   Runtime should use mono_class_get_checked and
   mono_class_get_and_inflate_typespec_checked, respectively.

* [runtime] Mark mono_ldtoken external only

   Runtime should use mono_ldtoken_checked

* [metadata] Mark mono_type_create_from_typespec external only

   Runtime should use mono_type_create_from_typespec_checked

* [runtime] Remove mono_class_inflate_generic_method_full.

   Mark mono_class_inflate_generic_method external only.

   Runtime should use mono_class_inflate_generic_method_full_checked.

* [runtime] Mark mono_get_inflated_method external only

   This function is obsolete.  It should have no callers.

* [metadata] Mark mono_field_from_token external only

   Runtime should use mono_field_from_token_checked

* [runtime] Add MonoError arg to mono_class_get_inflated_method

* [metadata] Mark mono_metadata_parse_method_signature external only

   Runtime should use mono_metadata_parse_method_signature_full

* [metadata] Mark mono_metadata_interfaces_from_typedef as external only.

   Runtime should use mono_metadata_interfaces_from_typedef_full

* [mini] Add MonoError arg to mono_class_get_method_generic

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

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

Remove some duplicated code

* [interp] Reenable thunks.exe on arm

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

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

* signal.h is required for sigaltstack

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

* there is no malloc.h on OpenBSD either

* sys/socket.h is required for struct sockaddr

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

* there is no need for pthread_attr_init/destroy anymore

* add -Wl,-zwxneeded to LDFLAGS on OpenBSD

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

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

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

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

* [System] Use temporary directory for saving settings files

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

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

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

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

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

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

For example if the static constructor throws an exception

* [interp] Run class cctor before allocating objects

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

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

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

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

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

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

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

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

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

Fix a little bit of typos.

* Take command lines from command line per PR feedback.

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

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

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

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

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

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

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

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

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

* Force inline to mimic previous.

* fix the forceinline part

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

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

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

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

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

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

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

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

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

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

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

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

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

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

To use, provide the following options to configure:

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

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

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

If you export
MONO_JEMALLOC_CONF="stats_print:true"

You will see detailed memory statistics for mono at exit.

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

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

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

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

* Attempt at a universal ifdef for MonoContextSimdReg presence

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

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

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

* [method2ir] mono_create_tls_get () can be static

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* remove a newline that was added

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

* Remove some newlines.

* more newlines

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

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

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

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

* [threads] Inline unsused function

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

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

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

* [ios-sdk] Add a test harness.

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

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

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

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

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

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

* [ios-sdk] Remove accidently commited binary.

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

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

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

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

* [ios-sdk] Fix logfile parsing.

* [ios-sdk] Fix log filtering.

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

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

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

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

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

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

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

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

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

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

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

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

* [ios-sdks] Fix the build.

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

* [ios-sdk] Add missing file.

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

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

* [ios-sdk] Enable more test suites.

* [ios-sdk] Fix device builds.

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

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

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

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

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

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

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

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

* [ios-sdk] Compile cross32 on CI.

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

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

* [ios-sdk] Fix the previous change.

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

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

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

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

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

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

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

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

* Add missing check for null synchronization context

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* Use set_real_time_clock for sys-time.c on Haiku

* Get mono-boehm compiling on Haiku again

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

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

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

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

An example of flat output:

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

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

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

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

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

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

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

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

```
2017-12-04 22:23:36 -05:00
Alexander Köplinger 399c2c89c7 [tests] Disable weak-fields.exe on FullAOT as well 2017-12-04 18:13:04 -05:00
Alexander Köplinger cd5f5282f2 Bump version to 5.11 (#6158) 2017-12-04 15:21:26 -05:00
Alexander Köplinger 58618dea1e [tests] Disable weak-fields.exe on ARM
It was introduced by https://github.com/mono/mono/pull/5972

Filed bug: https://bugzilla.xamarin.com/show_bug.cgi?id=60973

Reviewed manually by @lewurm.
2017-12-04 12:59:46 -05:00
Marek Safar a21fb19fc7 [mcs] Don't emit tuple names for a private types 2017-12-04 13:31:11 +01:00
Zoltan Varga db05a2523c [llvm] Update the llvm backend to work with the 2017-12-01-31d7f39423874d52922c06484f2c2af216844b4d branch of the mono llvm fork. (#6143) 2017-12-04 01:42:53 -05:00
David Karlaš 2bab8fa49e [Profiler] Fix parsing bug when jit is enabled
Bug was caused by wrong values in enum because `string` is parsed only when type is `SpecificTrampoline` but with mismatching values between C and C# enums it didn't parse string when it should causing parsing next event throwing random exceptions because there was still unexpected string data.
2017-12-04 03:45:58 +01:00
Zoltan Varga 5bdaef7e5f [runtime] Add support for weak fields. (#5972) 2017-12-03 23:47:05 +01:00
Zoltan Varga d107f0852c [jit] Fix the DISABLE_JIT build. (#6152) 2017-12-03 11:13:18 -05:00
Radek Doulik e2e34c157c [linker-analyzer] Fix error reporting
Make sure we don't "crash" with an unhandled exception and instead
report a problem loading the file.
2017-12-02 15:11:21 +01:00
monojenkins 0ae98538f6 Merge pull request #6148 from alexrp/profiler-stress-msbiology
[acceptance-tests] Disable the msbiology test completely.

It's proven to be too flaky everywhere, with random timeouts and OOMEs.
2017-12-02 11:35:03 +01:00
Alex Rønne Petersen f714138216 [acceptance-tests] Disable the msbiology test completely.
It's proven to be too flaky everywhere, with random timeouts and OOMEs.
2017-12-02 04:59:58 +01:00
Bernhard Urban ce96441a10 [mem access] don't do regular store if it's already handled by the unaligned case
fixes (for the runtime part): https://bugzilla.xamarin.com/show_bug.cgi?id=60865
2017-12-01 21:46:38 +01:00
Aleksey Kliger (λgeek) 465e2036d3 [w32handle] Don't enter GC SAFE around calls to w32handle_wait_{one,multiple} (#6132)
* [w32handle] Don't enter GC SAFE around calls to w32handle_wait_{one,multiple}

On non-Win32, the mono_w32handle_wait_{one,multiple} implementation is
coop-aware, so there's no need to enter/exit GC Safe.

On Win32, mono_win32_wait_for_{single_object,multiple_objects}_ex is not coop
aware (and can't be - because it's called from utils/os-event-win32.c which is
not supposed to use coop machinery), so do GC transitions around these calls.

Fixes cooperative GC regression due to f5fc773512

* [w32process] Use coop concurrency primitives

for exit_sem and processes_mutex.

With OS semaphores we could deadlock under coop GC if a GC happens at the same time that
a thread is waiting on the exit_sem - the finalizer thread gets suspended and
the incoming SIGCHLD never posts, so the waiting thread never suspends and the
GC STW never happens.

fixup! [w32process] Use coop semaphore for exit_sem

* [test] assembly_append_ordering.cs: mark methods with NoInlining

if TriggerLoadingSystemCore is inlined into Main, System.Core will be loaded
when Main is JITed, which throws off the assembly loading ordering that the
test cares about: that the SRE assembly is loaded before System.Core.
2017-12-01 10:42:49 -05:00
Bernhard Urban f079d5f961 [interp] move interp functions into a callback 2017-12-01 12:10:03 +01:00
Vlad Brezae 13d221bf40 [mini] Add missing try holes
When we leave a try block and invoke finally blocks, we need to add try holes also for catch handlers, since they can invoke the previously handled finally blocks.
2017-12-01 10:33:31 +01:00
Ludovic Henry f408d2c4c4 [log] Rework MONO_TRACE_* to allow for nested io-layer masks (process, file, handle, etc.) (#6138) 2017-11-30 23:28:23 -05:00
Alex Rønne Petersen c12b749434 Merge pull request #6134 from alexrp/master
[profiler] Correctly encode counter type/unit/variance values.
2017-12-01 04:28:31 +01:00
Zoltan Varga 225071a2a5 [llvm] Fix the build. (#6142) 2017-11-30 20:22:21 -05:00
Zoltan Varga c8bf8c287a [runtime] Replace the C and perl versions of the genmdesc tool with a python version. (#6140)
This has the following advantages:
    * There is only one implementation instead of two
    * The C version no longer needs to be compiled/recompiled.

    The disadvantage is the additional build time dependency on python.

    The windows build will keep using the C version for now.
2017-11-30 20:09:22 -05:00
markusbeth 3635db23fc Cleanup unused MONO_DISABLE_SHM env var (#6141)
The environment variable MONO_DISABLE_SHM seems to be unused now.
Cleanup the leftovers.
2017-12-01 01:32:09 +01:00
Zoltan Varga 9c2c689a61 Mini h cleanup (#6072)
* [jit] Extract AOT definitions from mini.h to aot-runtime.h.

* [jit] Remove some dead declarations from mini.h.

* [jit] Extract some non-JIT related functions and MonoJitDomainInfo/MonoJitTlsData into mini-runtime.h
2017-11-30 18:25:11 -05:00
monojenkins dcbc55c615 [msvc] Update csproj files (#6137) 2017-11-30 23:07:22 +01:00
Alexis Christoforides 73c6a2ee50 Merge pull request #6135 from YuriyGS/DataGridViewCell-Border
[System.Windows.Forms] Proper paint cell border and divider in DataGridView
2017-11-30 10:10:07 -05:00
Alex Rønne Petersen 26de079c89 [profiler] Correctly encode counter type/unit/variance values.
The change to encode these fields as byte was incorrect.
2017-11-30 10:09:52 +01:00
YuriyGS be6c2af639 Additional cell paddings in TextBoxCell:
- 1 pixel for right and bottom to compensate cells CellBounds overlapping;
 - one more pixel for top, right and bottom to have one pixel gap between text and border. Left border had a good gap already (why?).
No call DrawText for cell if there is no rectangle at all.
2017-11-30 11:50:01 +03:00
YuriyGS 384a163cfa Drawing row & column divider and take it into account for drawing borders.
Implemented paint for all missing border styles.
2017-11-30 11:45:07 +03:00
YuriyGS 0c873d207a AdjustCellBorderStyle - implemented edge/non-edge header/non-header row and column border styles fixed.
Fixed singleVerticalBorderAdded and singleHorizontalBorderAdded flags for the AdjustCellBorderStyle method call.
2017-11-30 11:27:04 +03:00
YuriyGS 2bd75f83ea Outset and SingleHorizontal border styles fixed 2017-11-30 10:49:42 +03:00
Alex Rønne Petersen 0239710580 [profiler] Ensure the profilers behave sensibly when loaded during AOT compilation.
The AOT profiler is not meant to be loaded during AOT compilation.

The coverage profiler does not currently support instrumentation of AOT code.

The log profiler does support enter/leave instrumentation of AOT code, but no
other functionality should be enabled in this case. We only want to set the
call instrumentation filter callback and then return control to the runtime.
2017-11-29 23:09:02 +01:00
Rodrigo Kumpera 0c88bc2ca3 Merge pull request #6115 from alexrp/profiler-lls-fix
[profiler] Fix thread list insertion failures.
2017-11-29 17:00:48 -05:00
Rodrigo Kumpera 804979969a Merge pull request #6110 from alexrp/master
[profiler] Make it possible to trigger heapshots from the M.P.L library.
2017-11-29 16:53:57 -05:00
Andreas Lindh 370fd7bb86 un-commented HmacSha256Signature bug 35661 2017-11-29 19:41:27 +01:00
monojenkins c5d3bf2428 [msvc] Update csproj files (#6131) 2017-11-29 17:14:06 +01:00
Marek Safar 33afa19ce3 [mcs] Implements C#7.1 default literal 2017-11-29 12:02:24 +01:00
Bernhard Urban 425c62c5da [interp] disassembler for mint instructions should return a string instead of printing char by char (#6114)
* [interp] disassembler for mint instructions should return a string instead of printing char by char

otherwise logs are unreadable on products like XI

* [fixup] free `ins`
2017-11-29 10:40:14 +01:00
Rodrigo Kumpera c79c456bd8 Merge pull request #6043 from kumpera/wasm-p2
Multiple fixes to the wasm backend
2017-11-28 15:39:00 -05:00
Aleksey Kliger (λgeek) 58d94f4f7f [loader] Don't assert on abstract methods in get_method_constrained (#6109)
If the constrained class is abstract, it might not implement the given method.
2017-11-28 15:02:28 -05:00
Alexis Christoforides b4eb34de9b Merge pull request #6121 from akoeplinger/bump-msbuild
Bump msbuild to xplat-master branch
2017-11-28 14:52:38 -05:00
Alexis Christoforides 38cc502132 [ci] Make bockbuild step fatal for run-test-mac-sdk.sh 2017-11-28 14:49:48 -05:00
Alexander Köplinger 8d1ef54321 [ci] Skip System.Runtime.CompilerServices.Unsafe tests on arm32 too
It fails on all 32bit architectures, not just i386.
2017-11-28 19:48:44 +01:00
Alex Rønne Petersen c36f5afb58 [profiler] Add an assertion to the log profiler to catch the thread resurrection case. 2017-11-28 19:06:59 +01:00
Alex Rønne Petersen 22d22ff3d5 [profiler] Remove tools_thread checks when raising profiler thread events.
These checks are no longer necessary as these thread callbacks are not invoked
for tools threads in the first place.
2017-11-28 19:06:57 +01:00
Alex Rønne Petersen cd46e14ee4 [profiler] Use thread_exited profiler event for recording thread end events.
With the revamped GC root reporting work, some GC root unregister events will
arrive after the thread_stopped event. This will cause the thread to be
re-added to the thread list in the profiler, and never be removed until program
exit. This meant that if such a thread had actually exited and a new thread
would reuse its thread ID, that new thread would fail to add itself to the
thread list, leading to failures like this one:

    init_thread: failed to insert thread 0x70000b761000 in log_profiler.profiler_thread_list, found = true

By using the new thread_exited event, we remove the thread from the thread list
after these GC root unregister events have arrived, thereby ensuring that the
thread won't be incorrectly 'resurrected'.
2017-11-28 19:06:55 +01:00
Alex Rønne Petersen 832e161fc9 [profiler] Add thread_stopping and thread_exited profiler events.
thread_stopping occurs earlier than thread_stopped, before any of the detach
code has run. thread_exited occurs after thread_stopped, once all detach logic
has finished.
2017-11-28 19:06:46 +01:00
Alexander Köplinger 8d487ae8e2 Bump bockbuild to upgrade expat library (#6093)
We've been asked by the upstream maintainers to update it: https://github.com/mono/linux-packaging-mono/issues/3
2017-11-28 18:54:24 +01:00
Bernhard Urban c92f638d2e [interp] small improvment for error reporting in interp compile method callback 2017-11-28 18:17:23 +01:00
Bernhard Urban 7ed2c02d0c [aot] encode interp_in wrappers with proper signature 2017-11-28 18:17:23 +01:00
Bernhard Urban fcfaf09acb [interp] fix copy/paste-typo in n2m macro magic 2017-11-28 18:17:23 +01:00
Bernhard Urban ccc1bd2c18 [aot] add more signatures for interp_in wrapper needed for iOS
signatures are coming from there:
https://github.com/xamarin/xamarin-macios/blob/2d4256ef15f1ebf0b7f5774dee03a97a8c32f3a6/runtime/delegates.t4#L9
2017-11-28 18:17:23 +01:00
Egor Bogatov afea7b6c79 [System] Add corefx tests for System.CodeDom (#5623) 2017-11-28 17:18:21 +01:00
Alexander Köplinger eb11cee53c Bump msbuild to xplat-master branch
In preparation for the next branching.
2017-11-28 17:12:49 +01:00
Alexander Kyte 0927d51418 [runtime] Implement a few ModuleBuilder getters (#5787)
* [runtime] Implement a few broken getters on ModuleBuilder

* [runtime] Implement ModuleBuilder.GetCustomAttributes

* [runtime] Test GetMethods, GetCustomAttributes, and GetFields for ModuleBuilder

* [runtime] Specify and test use of typebuilders with Custom Attributes + add more tests
2017-11-28 10:44:38 -05:00
monojenkins b3fad3f0f8 [msvc] Update csproj files 2017-11-28 16:44:07 +01:00
Ludovic Henry f5fc773512 [w32handle] Pass MonoW32Handle to more places (#5570)
* [w32find] Remove use of w32handle

* [w32handle] Ref handle when looking it up so it doesn't get destroyed while using it

* [w32handle] Ref handle when accessing its MonoW32HandleBase

* [w32handle] Make MonoW32Handle public

* [w32handle] Return MonoW32Handle as part of mono_w32handle_lookup_and_ref

* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_own

* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_isowned

* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_signal

* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_prewait

* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_specialwait

* [w32handle] Pass MonoW32Handle from mono_w32handle_ops_details

* [w32handle] Pass MonoW32Handle from mono_w32handle_foreach

* [w32handle] Pass MonoW32Handle to own_if_{owned,signalled}

* [w32handle] Pass MonoW32Handle to mono_w32handle_issignalled

* [w32handle] Pass MonoW32Handle from mono_w32handle_set_in_use

* [w32handle] Pass MonoW32Handle to mono_w32handle_{lock,trylock,unlock}_handle

* [w32handle] Remove dead mono_w32handle_ref

* [w32handle] Pass MonoW32Handle from mono_w32handle_set_signal_state

* [w32handle] Pass MonoW32Handle to mono_w32handle_test_capabilities

* [w32handle] Remove dead mono_w32handle_get_type

* [w32handle] Pass MonoW32Handle to mono_w32handle_ops_signal

* [w32handle] Pass MonoW32Handle to mono_w32handle_ops_isowned

* [w32handle] Pass MonoW32Handle to mono_w32handle_ops_specialwait

* [w32handle] Pass MonoW32Handle to mono_w32handle_timedwait_signal_handle

* [w32handle] Fix some typos and ref/unref imbalance

* [w32handle] Rename mono_w32handle_{trylock,lock,unlock}_handle to mono_w32handle_{trylock,lock,unlock}

* [w32handle] Rename numhandles to nhandles

* [w32handle] Return MonoW32Handle instead of index when creating the handle

* [w32handle] Remove gpointer handle parameter for mono_w32handle_{ref,unref}_core

* [w32handle] Remove gpointer handle parameter for mono_w32handle_timedwait_signal_handle

* [w32handle] Remove gpointer handle parameter for mono_w32handle_duplicate

* [w32handle] Remove gpointer handle parameter for w32handle_destroy

* [w32handle] Remove gpointer handle parameter for mono_w32handle_unref

* [w32handle] Remove dead function

* [w32handle] Remove gpointer handle parameter for own_if_{owned,signalled}

* [w32handle] Remove gpointer handle parameter for mono_w32handle_{wait_one,wait_multiple,signal_and_wait}

* [w32handle] Remove gpointer handle parameter for mono_w32handle_foreach callback

* [w32handle] Remove gpointer handle parameter for mono_w32handle_ops_{signal,own,isowned,specialwait,prewait,details}

* [w32handle] Make mutex and cond coop friendly

* [w32handle] Check for ref before type in mono_w32handle_lookup_and_ref

* [w32handle] Allocate the private_handles array on the heap, to reduce mono executable and library size
2017-11-28 09:14:06 -05:00
Rodrigo Kumpera 87500ea50a [profiler] Improve nodefaults usage.
If nodefaults is passed as the first argument, we would print `Could not parse argument: nodefaults` due to how it's parsed differently.
If nodefaults is passed after the first argument we would not print a warning that this was wrong.

This commit fixes both usability issues.
2017-11-28 11:14:50 +01:00
monojenkins ea10d2f2f8 Bump API snapshot submodule 2017-11-28 09:10:57 +01:00
Marek Safar 6be02ed6c7 Don't run System.Runtime.CompilerServices.Unsafe tests due to JIT crash on i386 2017-11-28 09:10:57 +01:00
monojenkins 3b00c67e0a Bump API snapshot submodule 2017-11-28 09:10:57 +01:00
Marek Safar 82151ac4fa [corlib] Adds Span/Memory tests 2017-11-28 09:10:57 +01:00
Alex Rønne Petersen 2ab06befe9 [profiler] Make it possible to trigger heapshots from the M.P.L library.
Also make it so on-demand heapshots can be done regardless of the heapshot
mode in use. There really wasn't a good reason to not allow it before.
2017-11-27 23:08:58 +01:00
Marek Safar dcf567ff64 [mcs] Populate referencecontainer member-cache correctly. Fixes #60860 2017-11-27 23:07:27 +01:00
monojenkins c1fd42eac8 Merge pull request #6097 from mono/slluis-patch-1
Fix invalid enum values in LogGCEvent
2017-11-27 22:55:06 +01:00
Ludovic Henry 984f648466 [sdks] Use runtime logging features to intercept Console.{Out,Error} and runtime logs for instrumentation (#6083)
* [sdks] Fix Android pick of mono runtime

* [android] Have Console.{Out,Error} go through the runtime log mechanism to ease their interception

* [sdks] Intercept runtime logs instead of Console to send back for instrumentation

* [sdks] Intercept Android test runner logging
2017-11-27 16:37:11 -05:00
monojenkins 20de41832a Merge pull request #6078 from alexrp/profiler-docs
[profiler] Some documentation improvements

* Update and rewrite profiler-related `man` pages.
* Update profiler API documentation for the new API.
* Extend the `exdoc` tool to support some more Doxygen features.
* Document the AOT profiler's file format.
* Clean up the sample profiler module and add a makefile.
* Include context/domain reports in `mprof-report`'s default report set.
* Exit the process when the `help` option is passed to the profilers.
* Remove the IOMap profiler.
* Remove some deprecated options from the log profiler's `help` output.
* Clean up the AOT profiler and bring its user interface in line with the others.
* Allow comments in coverage filter files.
2017-11-27 22:35:03 +01:00
Alexander Köplinger 41a3571272 [acceptance-tests] Run shorter version of GCStress on PRs and update targets (#6106)
In 22f0977132 it was disabled
but we can actually just run a shorter version in PRs.

Also reenable the precompilation target for the managed CoreCLR tests.
2017-11-27 21:49:53 +01:00
Jonathan Chambers 198147add4 Fix MonoContextSimdReg usage on non-glibc Linux amd64(#6007)
Include emmintrin.h and use __m128d for MonoContextSimdReg on Linux.

Fixes breakage on Alpine Linux introduced in #5764
2017-11-27 21:14:06 +01:00
monojenkins b25e55028b Merge pull request #6101 from DavidKarlas/gcrootFromStart
[LogProfiler] Removed GcRoot events logging from start

GcRoots should only be reported/captured during heapshot. We already set callback when heapshot collection starts and unset it when heapshot is finished. Which means after 1st heapshot is taken we don't log them outside heapshot. Hence we shouldn't be logging them from start...
2017-11-27 18:35:11 +01:00
monojenkins a84fa6652f [msvc] Update csproj files (#6105) 2017-11-27 16:42:34 +01:00
Rolf Bjarne Kvinge 6ed4adc2d8 [System][Test] Only Xamarin.iOS has a synchronization context by default.
This shows up when Xamarin.Mac tests start defining XAMMAC [1]

[1]: https://github.com/xamarin/xamarin-macios/pull/3034
2017-11-27 14:25:56 +01:00
Marek Safar 22f0977132 [ci] Update acceptance-tests 2017-11-27 11:15:07 +01:00
Marek Safar 22adb80c21 Update roslyn tests 2017-11-27 11:15:07 +01:00
Marek Safar 5f7452f384 Merge pull request #5273 from vladimir-kazakov/xmlenc-from-corefx
XMLENC from .NET Core.
2017-11-26 22:36:57 +01:00
Alex Rønne Petersen f3706fac10 [profiler] Report GC roots outside of heapshots unless the nodefaults option is given. 2017-11-26 14:52:52 +01:00
monojenkins 46c997fdf7 Bump API snapshot submodule 2017-11-26 10:20:13 +00:00
David Karlaš 82bca175c4 [LogProfiler] Removed GcRoot events logging from start
GcRoots should only be reported/captured during heapshot. We already set callback when heapshot collection starts and unset it when heapshot is finished. Which means after 1st heapshot is taken we don't log them outside heapshot. Hence we shouldn't be logging them from start...
2017-11-26 05:36:28 +01:00
monojenkins e51565c7e5 [msvc] Update csproj files (#6100) 2017-11-25 23:34:52 +01:00
Vladimir Kazakov 9ed8574570 XMLENC from .NET Core. 2017-11-25 16:42:10 +02:00
Alexander Köplinger 031405e9cc [corlib] Fix flaky ThreadPoolTests.AsyncLocalCapture test (#6099)
The test was added in https://github.com/mono/mono/commit/375471820c02ff0bab025bff75b5da7efc95d3cd.

We were seeing some flakyness in the this test, looking at it I
noticed that we were passing executeOnlyOnce = false to
(Unsafe)RegisterWaitForSingleObject. This means that the delegate
would be executed again whenever the AutoResetEvent `evt` is signaled or
the timeout elapsed. The problem is that evt is never signaled by design
and we set a timeout of 1ms which means we'd execute it in a tight loop.

Setting executeOnlyOnce = true fixes this and I verified it doesn't
change the intent of the test (i.e. the test still fails after the
original commit is reverted).

Bumped the timeout for the CountdownEvent as well to be safe
since it's quite short.
2017-11-25 12:59:04 +01:00
Alexander Köplinger e8e92e5323 [genproj] Support setting /langversion in csproj (#6096) 2017-11-24 23:45:23 +01:00
Zoltan Varga d29cc4770a [bcl] Remove the test for ExecutingAssembly.EntryPoint, it behaves in different ways on different configurations. (#6095)
* [bcl] Remove the test for ExecutingAssembly.EntryPoint, it behaves in different ways on different configurations.

* Simplify ifdef
2017-11-24 12:41:21 -05:00
Lluis Sanchez b736b420b5 Fix invalid enum values in LogGCEvent 2017-11-24 18:39:03 +01:00
Marek Safar ec117584a2 [corlib] Update exception message to match .net 2017-11-24 16:56:29 +01:00
Vlad Brezae 4f0fd2a59b [mini] Align stack when resuming to catch handler 2017-11-24 16:44:25 +02:00
Vlad Brezae 3325bdfbd5 [mini] Add counter for try holes memory usage 2017-11-24 16:44:25 +02:00
Vlad Brezae 78933c423f [mini] Add missing try holes
When doing an OP_CALL_HANDLER for a clause (from a leave opcode), all following instructions, up until the actual branch out of the try block, should be part of a hole for that clause. We were failing to account for a single leave instruction invoking multiple finally clauses sequentially, in which case a basic block can be a try hole for multiple clauses.
2017-11-24 16:44:25 +02:00
Vlad Brezae 98d3906a39 [mini] Fix clause try hole checking
This was inexplicably added as part of 2657d9cb1e, likely by mistake.
2017-11-24 16:44:25 +02:00
Alexander Köplinger 5ef930b5f8 [bcl] Build some assemblies with -warnaserror (#5295)
* [bcl] Build some assemblies with -warnaserror

This ensures that we keep the build warning free.

We'll only opt-in a few assemblies that already have zero warnings.
We also only apply this when using csc as mcs might raise different warnings.

For now just opt-in assemblies in the net_4_x profile.
2017-11-24 14:05:39 +01:00
Marek Safar 7b4dfeebc4 Merge pull request #5836 from marek-safar/corefx-bump
Corefx bump
2017-11-24 13:00:33 +01:00
monojenkins edc590a3d3 Bump API snapshot submodule 2017-11-24 09:09:12 +00:00
Alexander Köplinger 4535442e84 [ci] Switch .pkg PR build to pipeline script as well (#6092) 2017-11-24 01:30:00 +01:00
Marek Safar 484a9089a8 [corlib] Disable test check which is timezone dependent 2017-11-23 22:46:49 +01:00
Marek Safar e663bd7c92 Exclude any Mono marked corefx tests 2017-11-23 22:45:16 +01:00
Marek Safar 5eb884bab8 Fixes wrong argument name 2017-11-23 22:45:16 +01:00
Marek Safar 431e36f731 Bump mcs bootstrap version 2017-11-23 22:45:16 +01:00
Marek Safar 1cc3bc58be Bump corefx 2017-11-23 22:45:15 +01:00
Marek Safar ecd85dc839 [build] Support api-snaphot assembly references 2017-11-23 22:45:15 +01:00
Jonathan Chambers 5c2a49f4b6 Add back some more legacy profiler APIs (#6044)
- mono_profiler_install_allocation
- mono_profiler_install_enter_leave
- mono_profiler_install_exception
2017-11-23 21:54:25 +01:00
Rolf Bjarne Kvinge 00e2b06f2f Bump cecil & linker to latest. (#6081)
* Bump cecil & linker to latest.

* Bump API snapshot submodule
2017-11-23 21:30:33 +01:00
Rolf Bjarne Kvinge c2fceeaf39 [tests] Adjust ifdefs to get the expected behavior for Xamarin.Mac/Modern tests. (#6086) 2017-11-23 21:05:24 +01:00
Rolf Bjarne Kvinge 19a7107a03 [tests] Adjust ifdefs to get the expected behavior for Xamarin.Mac's cryptography tests. (#6091) 2017-11-23 21:04:32 +01:00
Alexander Köplinger 9107efe94d [api-diff] Only delete .cs files in the api diff
We're starting to add additional files into the profile directories
in api-snapshot and these would get deleted otherwise.
2017-11-23 19:18:21 +01:00
monojenkins 7ed25b0be4 [msvc] Update csproj files (#6087) 2017-11-23 18:36:33 +01:00
Marek Safar 011d28de46 Bump roslyn 2017-11-23 17:17:40 +01:00
Alex Rønne Petersen 16cf089281 [profiler] Clean up the AOT profiler a bit.
* Use the same option parsing logic as the other profilers.
* Support the same output file syntax as the other profilers.
* Use output.aotprofile as the default output file name.
* Open the output file on startup rather than shutdown.
* Use runtime logging functions instead of printf/fprintf.
* Don't print anything unless the verbose option is given.
* Fix an endianness issue with writing ints to the output file.
* Move all profiler state into MonoProfiler structure and store it statically.
* Remove outdated comments and includes.
2017-11-23 16:25:18 +01:00
Alex Rønne Petersen 0f985ed885 [profiler] Skip lines not starting with +/- in coverage filter files.
This allows writing comment lines.
2017-11-23 14:16:03 +01:00
Alex Rønne Petersen 76872edd27 [profiler] Use a new suppression file for the coverage profiler.
Keep the old one around only for compatibility with the old coverage support
in the log profiler.
2017-11-23 14:16:03 +01:00
Alex Rønne Petersen d1748f7c58 [profiler] Remove coverage options from the help text in the log profiler.
We want people to use the new coverage profiler instead.
2017-11-23 14:16:03 +01:00
Alex Rønne Petersen 7c8f5e02b2 [profiler] Don't document the nocalls option.
This one is only for compatibility, so don't document it.
2017-11-23 14:16:03 +01:00
Alex Rønne Petersen 9b0c6fc45d [profiler] Exit when printing the usage info.
Also print proper errors when failing to parse certain arguments rather than
just printing the usage info.
2017-11-23 14:16:03 +01:00
Alex Rønne Petersen 0d123027b0 [profiler] Remove the iomap profiler.
It hasn't worked for a very long time, contains very unsafe/broken code, and
appears to be used by no one.
2017-11-23 14:16:03 +01:00
Alex Rønne Petersen c7f9875f27 [man] Rewrite the profiler-related man pages.
* Separate profiler module documentation into a new mono-profilers(1) page.
* Add documentation for the aot and coverage profilers.
* Rewrite the mprof-report(1) page to only talk about mprof-report itself.
* Rewrite and update the profiler-related sections of mono(1).
* Conform to man page formatting conventions.
2017-11-23 14:16:03 +01:00
Alex Rønne Petersen cbe30987b0 [samples] Clean up the profiler sample and add a simple makefile. 2017-11-23 14:16:03 +01:00
Alex Rønne Petersen 0abcdc9c60 [mprof-report] Include domain and context reports in the default set. 2017-11-23 14:16:03 +01:00
Alex Rønne Petersen 8ab10ff01d [profiler] Document the AOT profiler file format. 2017-11-23 14:16:03 +01:00
Alex Rønne Petersen 53084a4098 [profiler] Add a comment to profiler-events.h about backwards compatibility. 2017-11-23 14:16:03 +01:00
Alex Rønne Petersen 80788a3c50 [docs] Improve profiler API documentation.
* Move doc comments to profiler.c so they're picked up by exdoc.
* Rewrite mono-api-profiler.html for the new profiler API.
* Clarify some aspects of the doc comments.
2017-11-23 14:16:03 +01:00
Alex Rønne Petersen 908d10de6c [exdoc] Don't transform newline characters to spaces.
This is unnecessary and messes with code block formatting.
2017-11-23 14:16:03 +01:00
Alex Rønne Petersen 528e793ce3 [exdoc] Support Doxygen-style code blocks.
This doesn't support the full syntax, but it's enough for our needs.
2017-11-23 14:16:03 +01:00
Alex Rønne Petersen aa19b6aa18 [exdoc] Support more Doxygen-style formatting. 2017-11-23 14:16:03 +01:00
Alex Rønne Petersen 5d2febd966 [exdoc] Don't insert unnecessary tab characters.
This messes with code block formatting.
2017-11-23 14:16:03 +01:00
Egor Bogatov 076632c3e9 Remove CodeDomConfigurationHandler from machine.config (#6070) 2017-11-23 10:31:56 +01:00
Zoltan Varga 718247da6f [bcl] Remove an ObjCRuntime reference from the TimeZone tests, it shouldn't be needed any more, and it prevents the tests from compiling on the monotouch profile. (#6079) 2017-11-23 00:32:33 -05:00
Ludovic Henry f1f3ae49f0 [sdks] Fix Android pick of mono runtime (#6080) 2017-11-22 20:28:47 -05:00
Alexis Christoforides 9d6f430994 Merge pull request #6067 from lambdageek/bug-60545-fixup-ginst
[loader] inflate constrained result if constraining an inflated generic method
2017-11-22 14:45:14 -05:00
Zoltan Varga 8aed7ab89c [aot] Add generic instances referenced by MONO_PATCH_INFO_METHOD_RGCTX patches. Fixes #60771. (#6075)
Some generic instances were not generated because they were only referenced by METHOD_RGCTX patches, and the gsharedvt
fallback didn't work because the method in question Unsafe.Add<T> uses a sizeof opcode on a gsharedvt type which is currently
not supported.

Testcase:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
using System;
using System.Runtime.CompilerServices;

public class Tests
{
        [MethodImplAttribute (MethodImplOptions.NoInlining)]
        public void Foo55<T> () {
            byte[] arr = new byte [10];
            ref byte data0 = ref arr [0];
            Unsafe.Add (ref data0, 0);
        }

        interface IFace {
            void Foo55 <T> ();
        }

        class AClass : IFace {
            public void Foo55 <T> () {
            byte[] arr = new byte [10];
            ref byte data0 = ref arr [0];
            Unsafe.Add (ref data0, 0);
            }
        }

    public static int Main () {
            IFace iface = new AClass ();
            iface.Foo55<int> ();
            return 0;
        }
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2017-11-22 12:51:36 -05:00
Jonathan Chambers c8cd5a5710 Use image set to store and allocate MonoClass representing arrays and pointers whose elements types may contain generic instances from other images. This can be true for array element classes which are generic instances (List<NonCorlibTyp>[]) or arrays (List<NonCorlibTyp>[][]). 2017-11-22 10:44:19 -05:00
Rolf Bjarne Kvinge ddace393cf [bitcode] Disable test_0_float_return_spill in bitcode to get green tests. (#6073)
See https://bugzilla.xamarin.com/show_bug.cgi?id=59953
2017-11-22 10:06:01 -05:00
Alexander Köplinger 27eed3574d [ci] MSBuild related fixes (#6071)
* [ci] Fix testing of msbuild in run-test-mac-sdk.sh

It contained the old version number and failed on bots that didn't
have leftover old build result.

* [ci] Fix msbuild paths in Windows packaging

They changed with 73bd521c07.
2017-11-22 02:51:45 +01:00
Rodrigo Kumpera 8e09c454f4 [wasm] Rewrite m2n-gen in C# 2017-11-21 15:23:54 -08:00
Rodrigo Kumpera 6549011576 [wasm] Address review issues. 2017-11-21 14:50:58 -08:00
Zoltan Varga 8ea4864f30 [sdks] Add an ios test runner. (#6063) 2017-11-21 15:26:50 -05:00
Aleksey Kliger (λgeek) 9a882ab9cf [class] Make some class setup methods mistakes less costly to make (#6048)
mono_class_setup_interface_offsets and mono_class_setup_interface_id should
only be called for interfaces.

mono_class_setup_interface_offsets is incorrect for classes, and
mono_class_setup_interface_id would be a no-op.
2017-11-21 15:26:04 -05:00
Alexander Köplinger d3c7faa750 [ci] Add Jenkins pipeline script for building OSX and Windows packages (#6065)
* [ci] Add Jenkins pipeline script for building OSX and Windows packages

This replaces the current Jenkins freestyle jobs.

We no longer need the signing inside of the MacSDKRelease profile
since we're now signing on a separate service and having the signing
certificates locally is discouraged anyway.

* [ci] Update embedded gtk-sharp in Windows msi to 2.12.45

This matches what we ship on www.mono-project.com
2017-11-21 21:24:42 +01:00
Aleksey Kliger 7e9074b54c [loader] inflate constrained result if constraining an inflated generic method
Fixes interpreter failure in gtest-253.cs due to 3259e04ace
2017-11-21 12:39:47 -05:00
monojenkins ef0f3a53f3 [msvc] Update csproj files (#6066) 2017-11-21 16:44:42 +01:00
Zoltan Varga 1f59d0958f [bcl] Add an .exclude file to disable some corlib tests when running with the mono sdk. (#6064)
These tests are disabled explicitly on xamarin.ios by xharness.exe: https://github.com/xamarin/xamarin-macios/blob/6fcf4ab7f4c7e2f736a278ca138ab567c1ff6bae/tests/xharness/BCLTestInfo.cs#L16
2017-11-21 16:20:26 +01:00
Ludovic Henry e5248979fe [sdks] Update Android for integration with XA (#6058)
* [sdks] Match xamarin-android targets flags and parameters

* [sdks] Only compile BCL profiles that are needed

* [sdks] Add release and debug out directories for android

* [sdks] Add Android SDK and NDK paths from xamarin-android

* [sdks] Match xamarin-android x86 SDK version

* [sdks] Use make_standalone_toolchain.py to provision the Android toolchain
2017-11-21 08:05:51 -05:00
Martin Baulig 6beed5f791 [System.Net.Http]: Fix "Content-Length: 0" logic for requests without body.
Implicitly add "Content-Length: 0" for all requests with a null body unless
we're using a body-less HTTP Verb (HEAD, GET, MKCOL, CONNECT, TRACE).
2017-11-21 11:34:00 +01:00
Alexander Kyte a178a5273a [runtime] Move mono_aot_can_dedup into aot-runtime 2017-11-21 10:11:59 +01:00
Marek Safar 2c160ed9a7 [mcs] C# 7.2 ref struct feature 2017-11-21 09:15:00 +01:00
Ankit Jain 73bd521c07 Bump NuGet.BuildTasks (#6004)
* Bump nuget-buildtasks

cherry-pick 304d785bd0

* [msbuild] Install importbefore/after hooks for nuget

cherry-pick 4c935964b2

* [msbuild] Fix build - create the directories before installing .. (#5980)

.. to them.

cherry-pick d711efdd90

* [msbuild] Fix build (#5981)

- Don't copy 14.0/Imports to 15.0 now, as we do that in nuget-buildtasks.
- And don't create symlinks for Microsoft.NuGet.targets as it is not
  required anymore.

cherry-pick ef1ea85c0f
2017-11-21 04:28:40 +01:00
Nate Woolls a6e7c1f81c [tools] Fix .apps generated by MacPack not running when Mono 5 is installed on macOS (#6024)
* [tools] Fix .apps generated by MacPack not running when Mono 5 is installed on macOS

The current script used by the generated .app only checks for Mono in /usr/local/bin, but not in /Library/Frameworks/Mono.framework/Versions/Current/Commands (the default location for new installations of Mono 5 on macOS)

* [tools] Fix WinForms .apps generated by MacPack not running when Mono 5 is installed on 64-bit macOS

Latest Mono now defaults to running mono64 on a 64-bit OS but there is currently no WinForms support on 64-bit Mono. Pass --arch=32 to mono when wrapping a WinForms app with MacPack.
2017-11-21 04:27:10 +01:00
Yuriy fab0ce54d3 [System.Windows.Forms] FileDialog internationalization (#6052)
* Localized * FileDialog. Fixed missing Locale.GetText for the displayed strings.

* Fixed padding and size of buttons in the PopupButtonPanel class. This was done to remove the workaround "Recently\nused" and similar in futher localizations.

* Changed width of PopupButtonPanel to prevent sticking buttons to the separator.
2017-11-21 03:49:40 +01:00
Marek Safar 21ba3d0d9d [corlib] Move System.Runtime.InteropServices.RuntimeInformation to co… (#6060)
* [corlib] Move System.Runtime.InteropServices.RuntimeInformation to corlib to match .net 4.7.1 api

* Bump API snapshot submodule
2017-11-21 03:32:23 +01:00
Aleksey Kliger 3259e04ace [loader] Rework get_method_constrained (Fixes #60545)
Instead of using find_method which relies on method name and exact signature
matching (and thus can't work for variant interfaces), use the vtable and the
interface offset to find the constrained method.

Terminology:
  base method - a method of the base class to be called
  base class - some general class or interface that declares a method
  constraint class - a more specific class that also implements the method.
  constrained method - the version of the base method in the constraint class.

To find the constrained method given the base method:

- if the base class is a class:
  the constraint class can't be an interface. it's either the base class or
  some subclass of it.  If the base method isn't virtual there's nothing to do
  the constrained method is the same one.
  If the base method is virtual, get its vtable slot and find the corresponding
  method in the constraint class's vtable.
- if the base class is an interface:
  in this case the constraint class is either another interface or a class.
  if the constraint class is an interface, since interfaces can't have
  implementations, there's nothing to do.
  if the constraint class is a class, then to find the constrained method
  get the interface slot offset of the base method and find the base interface offset
  of the base interface and look in the constrained class vtable.
  (the base interface offset gives the starting vtable slot for the base
  interface in the constraint class vtable; the slot offsets go consecutively
  for each of the methods of the interface).

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=60545
2017-11-20 18:36:38 -05:00
Aleksey Kliger 92f20ae75d [tests] Mono test for contravariant constrained.callvirt
Test that constrained.callvirt IL instruction sequence works for contravariant
interfaces.

Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=60545
2017-11-20 18:36:38 -05:00
Aleksey Kliger 0bbc3e8c15 [runtime] Cleanup mono_runtime_get_main_args
- Cleanup MonoError
- Rework coop handles usage to avoid raw pointers until exit.
2017-11-20 16:09:51 -05:00
Zoltan Varga 009b508174 Fix the ios build with recent xcode/osx, add comments about possible targets. (#6056) 2017-11-20 16:02:08 -05:00
Chris Hamons dae27ef2ba Fix CryptoConfig.CreateFromName on XM Modern (#6029) 2017-11-20 20:04:28 +01:00
Marek Safar a985310287 Disable a new test, it's crashing the interpreter 2017-11-20 12:22:48 +01:00
Marek Safar e5a8111a64 [mcs] Better typed-ref deconstruction for indexers. Fixes #60680 2017-11-20 12:22:48 +01:00
monojenkins 1d7ec6a3d7 Bump API snapshot submodule 2017-11-19 18:33:43 +01:00
Marek Safar 7a22e06622 Bump cecil 2017-11-19 18:33:43 +01:00
Egor Bogatov b44333823d XmlReaderSettings.EnableLegacyXmlSettings should always be false on mono. Fixes bug-60621 (#6014) 2017-11-19 13:43:06 +01:00
Alexander Kyte f1a22f31a7 [runtime] Fix test makefrag to accomodate moved tests 2017-11-19 10:16:06 +01:00
Zoltan Varga c498a00479 [bcl] Fix the ResolvePathBeforeDirectoryExists test on the mobile profile. 2017-11-19 10:13:27 +01:00
Zoltan Varga c2ea774d4c Revert "[touchup] Use HANDLE_FUNCTION_RETURN_OBJ instead of HANDLE_FUNCTION_RETURN_VAL (no change in behavior)"
This reverts commit e608ed2386.

Revert this as it breaks the build.
2017-11-18 10:08:44 -05:00
Alexis Christoforides 9c64c7d390 Merge pull request #6030 from luhenry/corefx-switch-to-c
[corefx] Bump corefx to pick switch of System.Native to C
2017-11-17 17:54:01 -05:00
Alexis Christoforides 29d2176893 Merge pull request #6045 from chamons/bump_master_cecil
Bump cecil
2017-11-17 17:30:06 -05:00
Alexis Christoforides e608ed2386 [touchup] Use HANDLE_FUNCTION_RETURN_OBJ instead of HANDLE_FUNCTION_RETURN_VAL (no change in behavior) 2017-11-17 17:27:43 -05:00
Ludovic Henry 24fc118eef [sdks] Cleanup wasm targets (#6025)
* [sdks] Cleanup wasm targets

* [sdks] Remove CUSTOM_BUILD_TARGETS variable
2017-11-17 17:21:44 -05:00
Alexis Christoforides 18fb8563fb [touchup] Remove redundant code 2017-11-17 17:21:20 -05:00
Alexis Christoforides 5cf1aada52 Merge pull request #6017 from monojenkins/update-csprojs
[msvc] Update csproj files
2017-11-17 17:09:56 -05:00
Alexis Christoforides 421f8553fb Merge pull request #6042 from Unity-Technologies/winrt-time-zone-adjustment-rules
Fix TimeZoneInfo rule population for WinRT
2017-11-17 17:08:15 -05:00
Chris Hamons e3862cb004 Bump cecil 2017-11-17 13:51:59 -06:00
Rodrigo Kumpera 937fcd1023 [wasm] Unbreak EH 2017-11-17 10:25:36 -08:00
Rodrigo Kumpera 9a143f99ca [wasm] Fix signature of Monitor::Enter icall. 2017-11-17 10:25:36 -08:00
Rodrigo Kumpera 82e9c5ccd7 [sdks] Adjust debug spew to help debug GC issues. 2017-11-17 10:25:36 -08:00
Rodrigo Kumpera 1b9e3ec070 [sdks] Add code to run corlib test suite. 2017-11-17 10:25:36 -08:00
Rodrigo Kumpera 04d0d026b8 [sdks] Remove debug spew from new nunit driver and add option to run a single test. 2017-11-17 10:25:36 -08:00
Rodrigo Kumpera 3d80b0b50e [wasm] Don't abort on thread creation, simply fail it. 2017-11-17 10:25:36 -08:00
Rodrigo Kumpera 0d10ad9a26 [wasm] clock_gettime fails on with EINVAL. gtod works just fine. 2017-11-17 10:25:36 -08:00
Rodrigo Kumpera c8ed7a1715 [wasm] Current version of libc abort on getpwnam. 2017-11-17 10:25:36 -08:00
Rodrigo Kumpera 426109e9c9 [wasm] Rework incremental test runner to work more closely to how nunit works WRT setup steps. 2017-11-17 10:25:36 -08:00
Rodrigo Kumpera 9e8a648fa7 [wasm] Build the runtime with ASSERTIONS=2 for now to get better crash diagnostics. 2017-11-17 10:25:36 -08:00
Rodrigo Kumpera cb8d515c00 [wasm] Update the wasm m2n tramps.
They are not generated by a ruby script.
The commit includes the generated file and the generation script for now to ease development.
We can later discuss generating it at build time.
2017-11-17 10:25:35 -08:00
Rodrigo Kumpera d9224b10b2 [interp] Make assertions more usable. 2017-11-17 10:25:35 -08:00
Rodrigo Kumpera 48c111e123 [wasm] Add better implementation of mono_w32file_get_volume_information. 2017-11-17 10:25:35 -08:00
Rodrigo Kumpera fed2587457 [wasm] Return actual stack bounds instead of phony values. 2017-11-17 10:25:35 -08:00
Rodrigo Kumpera 0d6f22f04c [wasm] Mono relies waaaay too much on mmap returning zero'ed memory, so just do it. 2017-11-17 10:25:35 -08:00
Rodrigo Kumpera 7cb492db00 [util] Properly Initialize the last entry of a superblock instead of relying on mmap returning zero'd memory. 2017-11-17 10:25:35 -08:00
Rodrigo Kumpera 88e9d00c52 [corlib] Add wasm source lists for test suite. 2017-11-17 10:25:35 -08:00
Rodrigo Kumpera 07d07ad907 [wasm] Switch to an incremental nunit test runner to make sure the main thread gets pumped regularly. 2017-11-17 10:25:35 -08:00
Jonathan Chambers 491f4b651f The return value of GetDynamicTimeZoneInformationEffectiveYears in the successful case is ERROR_SUCCESS (0). Adjust failure case to be for return values non 0. 2017-11-17 12:50:00 -05:00
monojenkins af08374ef2 [msvc] Update csproj files 2017-11-17 15:33:02 +00:00
Alexis Christoforides 3e1eeec6c3 [System.IO] Directory.Exists() now resolves the full path first. Fixes #60267
In Unix, assume our current directory contains:
`test`, a directory
`test/test2`, another directory
`test/test2/test_file`, a file
`test3`, a symbolic link pointing to `test/test2`

Then the path "test3/../test3" has two interpretations depending on the processor:

* The OS (the `lstat` syscall, `ls`, etc.) will find it invalid (as it evaluates to: enter `test/test2`, go up one level, try to enter `test3` which is another level down
* We (.NET, at least CoreCLR) should find it valid (enter `test3`, go up one level, enter `test3`).

This ensures that for Directory.Exists, we process the path `..`'s on the .NET level before passing it for native processing.
2017-11-17 11:31:44 +01:00
Alexander Kyte 2bb178c7a8 [runtime] Increase the BCL imt trampoline count (fix tests) 2017-11-17 11:26:00 +01:00
Bernhard Urban 1f4bd60284 [lldb] update interp main loop function name 2017-11-16 23:27:51 +01:00
Bernhard Urban 4d02be3abf [interp] only access arguments on frame if there are any for sure
discovered by AddressSanitizer
2017-11-16 23:27:51 +01:00
Bernhard Urban 5bc422d733 [interp] end of a clause can point _after_ the last instruction
detected by AddressSanitizer: code generating the offsets for exception
handling would access the array beyond its bound.
2017-11-16 23:27:51 +01:00
Rodrigo Kumpera d416f570bd Merge pull request #6003 from kumpera/profiler-compat-mode
[profiler] Make profiler arg parsing more compatible with previous version.
2017-11-16 14:33:56 -05:00
Ludovic Henry b488cacd50 [corefx] Bump corefx to pick switch of System.Native to C 2017-11-16 14:28:56 -05:00
Alexis Christoforides 0435b2ba16 Merge pull request #6027 from lewurm/fix-DefaultThreadCurrentCultureIsIgnoredWhenCultureFlowsToThread
[corlib] fix DefaultThreadCurrentCultureIsIgnoredWhenCultureFlowsToThread test
2017-11-16 14:05:47 -05:00
Hugh Bellamy 8a82b292fb Update GdipGetImageDimensions tests to pass against Windows GDI+ (#6008)
Make the image height dimension check more relaxed.
These fail against windows and cause errors when fixed in mono/libgdiplus#121
2017-11-16 18:57:11 +01:00
Neale Ferguson 51a8a45906 Fix big endian build problem 2017-11-16 17:18:11 +01:00
Bernhard Urban ae9cef9103 [corlib] fix DefaultThreadCurrentCultureIsIgnoredWhenCultureFlowsToThread test
this test case was broken for an unknown time, but surfaced with a
recent change in nunit-lite (2255c54966)
that runs every test in a new `ExecutionContext`. Previously, the
pre-condition for this test was implicility fulfilled by another test.
The test failed already when executed only on its own. With the change
around `ExecutionContext`, each test is "isolated" regarding said
pre-condition.

The fix is to explicitly fulfil the pre-condition in the test.
2017-11-16 17:11:42 +01:00
Rodrigo Kumpera 375471820c [corlib] Don't capture the execution context when UnsafeRegisterWaitForSingleObject is used. Fixes #60029 (#6013) 2017-11-16 09:29:15 +01:00
Aleksey Kliger c0f6935b45 [sre] Don't warn about duplicate token for MonoArrayMethod
ModuleBuilder::GetArrayMethod returns a fresh MonoArrayMethod instance each
time it's called, even if you ask for the same method multiple times.  On the
other hand, mono_image_get_array_token caches tokens by method signature.
Therefore mono_image_create_token should expect collisions.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=60238
2017-11-16 09:15:47 +01:00
Aleksey Kliger 8b7df777bb [test] Regression test for 60238 2017-11-16 09:15:47 +01:00
Zoltan Varga bcaca2dbaf [bcl] Add a Mono.Runtime.Tests assembly which can be used to run the JIT regression tests using nunit. (#6015) 2017-11-15 20:50:43 -05:00
Alexis Christoforides 401ed4d16c [System.Process] Consider open's exit code when using it to start a process. Fixes #19503 (#6010) 2017-11-15 13:53:00 -05:00
Katelyn Gadd 2cc1ae3b29 Provide a special implementation of ReadToEnd for CStreamReader so that it echoes input characters correctly when TermInfoDriver is initialized instead of suppressing them. Fixes bug #40699. 2017-11-15 09:44:10 -08:00
Alexander Kyte ca8b8bd346 [runtime] Add Dedup Support to MkBundle (#5484)
* [runtime] Fix mkbundle compilation on OSX

* [runtime] Add aot arguments to mkbundle

* [runtime] Enable compiling aot with mkbundle

* [runtime] Add new dedup interface to mkbundle

* [runtime] Fix path resolving for mkbundle

* [runtime] Use mkbundle in BCL tests

* [runtime] Skip building System.Security, System.IdentityModel tests on testing_aot_full

* [runtime] Fix in-tree building for mkbundle

* [runtime] Move testing dll into profile

* [runtime] Add target to mkbundle all tests before CI

* [runtime] Build stripper and use with mkbundle

Preliminary linker support ran into dependency-finding bug
with the monolinker.exe binary. Fix postponed until later.

* [runtime] Skip not supported tests with mkbundle

* [runtime] Don't re-aot when running BCL tests

* [runtime] Provide config to mkbundle

* [runtime] Fix mkbundle internationalization test results, build all

* [runtime] Clean up temp mkbundle aot directory

* [runtime] Add mkbundle support for dedup

* [runtime] Fix tracking of dedup module in mkbundle

* [runtime] Document mkbundle AOT options in man pages

* [runtime] Fix CADMessage generic method argument marshalling
2017-11-15 09:56:26 -05:00
Alexander Kyte 50fa04c136 [runtime] Implement runtime support for inflated wrapper and generic dedup (#5349)
* [runtime] Support excluding or choosing to emit only inflated methods

* [runtime] Only write cache if changed, so can be used by Makefiles

* [runtime] Thread state through multiple mono_compile_assembly calls

* [runtime] Emit skipped methods in dedup module

* [runtime] Use AOT attribute to mark dummy dedup module

* [runtime] Expose and use can_dedup for AOT compiler+runtime

* [runtime] Add missing cases to the mangler

* [runtime] Fix direct calls with dedup

* [runtime] Implement runtime support for finding deduped code

* [runtime] Refactor dedup state setup into new function

* [runtime] Add in dedup debugging aid / external visibility

Gives a demo on how to make mangled method names externally visible

* [runtime] Log dedup statistics
2017-11-15 09:55:21 -05:00
Rodrigo Kumpera 115b290143 [runtime/corlib] Improve MissingMethodExceptions by including message… and signature. Fixes #60505
This fix is a bit weird but it's due to some restrictions of the managed API.

MissingMemberException & friends require both ClassName and MemberName to be supplied independently, so the signature
can't simply be applied to MemberName. So we pass it on a separate field.

The next thing is that we want C#'esque signatures, where the return type comes before ClassName.MemberName, so we pass
a format string and apply it in managed.
2017-11-15 09:31:21 +01:00
monojenkins 43a23e71e5 Bump API snapshot submodule 2017-11-15 09:27:21 +01:00
Marek Safar 6910dd4bc0 [System.Data] Add missing Microsoft.SqlServer.Server APIs 2017-11-15 09:27:21 +01:00
Bernhard Urban c58ab6f4cb more readable assignment 2017-11-15 07:28:47 +01:00
Bernhard Urban 93ad6575a5 [metadata] make get_darwin_locale thread-safe
fixes https://bugzilla.xamarin.com/show_bug.cgi?id=59916
2017-11-15 07:28:47 +01:00
Alexis Christoforides 3318b29704 Merge pull request #5985 from YuriyGS/bug60514
[System.Windows.Forms] Proper padding and border width for DataGridViewTextBoxCell. Fixes #60514
2017-11-14 17:03:30 -05:00
Rodrigo Kumpera 67160915c9 [profiler] Restore 'counters' and 'sampling-real' options 2017-11-14 13:04:49 -08:00
Jonathan Chambers 52d836f5e2 Fix icall parameters to use managed boolean type. (#6006) 2017-11-14 15:48:06 -05:00
Bernhard Urban 2255c54966 [external] bump nunit-lite in order to include fix for racy FinallyDelegate 2017-11-14 21:06:22 +01:00
Bernhard Urban 0bba45f06e [interp] fix build on windows (#6000)
it was fine on CI, but developers can run into build errors if they
don't follow a strict order (due to autotools fighting with
`winconfig.h`).

`basic.exe` passes, but everything involving native transitions crashes.
2017-11-14 14:50:37 +01:00
Jonathan Peppers a5248e5e11 [bcl] bringing back InetAccess test category
This partially reverts 9b4b6d6211

Xamarin.Android’s QA team has a need to run on-device tests in cases
where the device does not have an internet connection.

I also marked a few tests with `InetAccess` indicated from a past test
run here:
http://xqa.blob.core.windows.net/gist/log-1481cb7679ce4db0a305a551ff7f4e18.txt
2017-11-14 11:37:12 +01:00
Alexis Christoforides a6c2080c24 Merge pull request #5759 from luhenry/w32process-refactor-mono_w32process_get_fileversion_info
[w32process] Reduce mmap allocation by mapping file only once
2017-11-13 20:45:48 -05:00
Rodrigo Kumpera 26b76cb879 [profiler] Make profiler arg parsing more compatible with previous version.
This introduces the following changes.

By default, enable more events. Exceptions and Counters are on by default.
By default, if alloc or heapshot are enabled, we emit root events as well.

New `nodefaults` argument that disables the above changes to default arg processing.

Added "nocalls" argument for compat only purposes.

Restored "cycles/" prefix to sample frequency argument. It was already a dead argument, but kept for compat.
We restored that as existing clients pass that flag.
2017-11-13 16:56:27 -08:00
Zoltan Varga c445fa3262 [runtime] Initialize the min_align field of ptr classes, since they have the 'inited' field set, so mono_class_init_sizes () might not be called for them. Fixes #60634. (#5999) 2017-11-13 19:46:19 -05:00
Aleksey Kliger (λgeek) 0257dcde58 [tests] Add disabled regression test for #49308 (#5997)
* [tests] Appdomain assembly loading regression test for #49308

Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=49308

We try to trick the remoting code into causing an assembly from a bad directory
to be loaded too eagerly into an appdomain.  If we succeed, we call a method
that doesn't exist.  Expected behavior is that the bad assembly is not loaded
and instead we can do an Assembly.LoadFrom of a good assembly.

* [tests] Add appdomain-marshalbyref-assemblyload.exe to KNOWN_FAILING_TESTS

This is a regression test for
https://bugzilla.xamarin.com/show_bug.cgi?id=49308, it should be re-enabled
when the bug is fixed.
2017-11-13 17:06:40 -05:00
Ludovic Henry 33eb71ae07 [System] Fix DeflateStream crash with high concurrency on Read/Write/Close (#5994)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=56727
2017-11-13 15:16:03 -05:00
Ludovic Henry bf1b5dced0 [sdks] Remove passing AndroidRunner instance to C# and back (#5988) 2017-11-13 15:05:10 -05:00
Dave Curylo 2f308109e1 Fix path to embedded glob.c implementation.
Was moved in https://github.com/mono/mono/commit/f23f72c9de0cb7d03e5db68623440af9dcb19d6c and LICENSE should reflect where these embedded dependencies are found.
2017-11-13 09:27:12 -08:00
Marek Safar d1ece840fe [mdbdump] Include guid in xml dump 2017-11-13 09:07:18 -08:00
monojenkins 5f35ea4b68 [msvc] Update csproj files (#5995) 2017-11-13 16:48:43 +01:00
Mikhail Filippov 05fae5f1fa Add ignoring features option into genproj 2017-11-13 06:51:50 -08:00
lateralusX 2503f874ca Enable concurrent GC as default mode for Windows MSVC mono sgen builds. 2017-11-13 05:27:39 -08:00
Alexander Köplinger f23ce4f37e [corlib] Add more tests, embed linker descriptor xml in test assembly
This enables us to remove https://github.com/xamarin/xamarin-android/blob/e0c0c2bae53f15f8949bef5eda64d1018455ab59/tests/Xamarin.Android.Bcl-Tests/Resources/LinkerDescription.xml.
2017-11-13 05:19:38 -08:00
Bernhard Urban 9afe9e1445 [interp] disable block_guard_restore_aligment_on_exit.exe on CI (#5991)
there is an about 10% chance that it hangs and thus times out on CI.
2017-11-12 20:00:40 +01:00
Zoltan Varga d59f8a64ae [jit] Avoid nullifying LDADDR instructions in load_simd_vreg_class (), they could have references if explicit-null-checks are enabled. Fixes #60539. (#5979) 2017-11-10 13:35:32 -05:00
Ankit Jain af818a1709 [msbuild] Change the version used in bockbuild to just '15', instead .. (#5986)
.. of 15.x. It doesn't really affect anything and makes it simpler on
wrench to specify directory from which to run the tests!

(cherry picked from commit 3f3b106aca)

# Conflicts:
#	packaging/MacSDK/msbuild.py
2017-11-10 17:49:59 +01:00
YuriyGS 356c5aaef8 Using padding and border width 2017-11-10 18:18:18 +03:00
Manuel de la Pena 4e43805a1e [Tests] Make Mono.Data.Sqlite tests more robust. (#5982)
* [Tests] Make Mono.Data.Sqlite tests more robuts.

There are cases in which the tests are ran in parallel and the files
used for the db are writte/read by several tests at the same time. This
changes ensures that we do have a diff test file per test case to ensure
that we do not have false negatives.
2017-11-10 16:08:47 +01:00
Alexis Christoforides 78be18ab99 Merge pull request #5917 from lambdageek/centrinel-ann
Add Centrinel annotations to object.h and handle.h
2017-11-10 09:58:05 -05:00
Ludovic Henry 295625bbb0 [sdks] Change how we run test suites on the app (#5894)
Instead of using a textbox in the app, we use a file which contains which the name of the dll that contains the tests
2017-11-10 09:02:04 -05:00
Aleksey Kliger 00035e5b68 Include <config.h> in C files that include mono headers
Any translation unit that includes a Mono header should include <config.h>
first to ensure that all of our configuration defines are available.

In particular, config.h defines MONO_INSIDE_RUNTIME which, in mono-publib.h causes
MONO_RT_EXTERNAL_ONLY to be defined to an attribute that causes a compilation
error if you use a function that is internally deprecated for the runtime.

Also change a couple of places that used non-_checked functions.
2017-11-09 22:19:32 -05:00
Aleksey Kliger 70807d5198 [coop handles] Mark handles macros with Centrinel SUPPRESS macros
Handles macro bodies are allowed to operate on raw pointers to managed memory.

The macro arguments must be UNSPUPPRESSed because we want warnings if the
arguments are doing bad things.
2017-11-09 18:06:11 -05:00
Aleksey Kliger 7d3dc331b5 Mark _MonoObject and managed object typedefs with MONO_RT_MANAGED_ATTR 2017-11-09 18:02:48 -05:00
Aleksey Kliger d244f6d2c7 Define MONO_RT_MANAGED_ATTR and MONO_RT_CENTRINEL_SUPPRESS macros
Marking a struct definition or a typedef with MONO_RT_MANAGED_ATTR will cause
Centrinel to treat pointers to the struct as residing in managed memory and to
issue warnings when raw pointers to such managed objects occur in the runtime.

(Also Centrinel knows that if the first field of a struct is a `MonoObject`,
then the struct is definiting a subtype of a managed object and so pointers to
_that_ struct also point into managed memory)
2017-11-09 17:55:03 -05:00
Jonathan Chambers ee20fc0ad9 Remove Boehm specific code path in GC aware hash tables as it can now push/mark roots. 2017-11-09 15:56:06 -05:00
Alexis Christoforides e348c56a01 [coop] Convert ves_icall_System_Environment_GetCommandLineArgs icall to use coop handles 2017-11-09 15:25:46 +01:00
Alexander Köplinger 4b80cb6861 [bcl] Add .NET 4.7.1 reference assemblies (#5974) 2017-11-09 14:28:22 +01:00
Ludovic Henry e45d72f4a8 Merge pull request #5969 from luhenry/backport-master-950ea65c3ba571cd139dc34b48d7101a2e894993
[System] Add missing ConfigureAwait
2017-11-08 18:35:36 -05:00
Aleksey Kliger (λgeek) a9e1c60a63 Merge pull request #5970 from lambdageek/bug-60245
[remoting] Check for transparent proxy in ves_icall_MonoField_{Get,Set}ValueInternal
2017-11-08 17:37:50 -05:00
Bernhard Urban b78e9b5e98 [interp] disable Test.System.Threading.ThreadTest.TestUndivisibleByPageSizeMaxStackSize (#5966)
It fails _sometimes_ in a weird way, which is probably a bug in the
interpreter when executing `nunit`. Disable it until it is fixed.
2017-11-08 17:28:20 +01:00
Aleksey Kliger 69ec805ff3 [test] FieldInfo.{Get,Set}Value tests for ContextBoundObject
Test that passing a transparent proxy to GetValue and SetValue works as expected

Regression tests for https://bugzilla.xamarin.com/show_bug.cgi?id=60245
2017-11-08 11:00:22 -05:00
Aleksey Kliger cd2fd4d81d [remoting] Check for transparent proxy in ves_icall_MonoField_{Get,Set}ValueInternal
Cover the case where System.Reflection.TypeInfo:GetValue or
System.Reflection.TypeInfo:SetValue are passed a transparent proxy as the
object.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=60245
2017-11-08 11:00:21 -05:00
Brendan Zagaeski 40be6362c6 [System] Add missing ConfigureAwait (#5963)
This is a candidate fix for:
https://bugzilla.xamarin.com/show_bug.cgi?id=60317

The bug was introduced by 1b5e0f7331.

Preliminary verification
========================

If I make just this _one_ change to a "bad" commit of Mono from after
commit 1b5e0f7, rebuild System.dll in the `xammac` profile, and then
overwrite that file in the MonoBundle directory of a Xamarin.Mac test
app, then I restore the old "good" behavior.  (I started with
38da0b3b49 as the "bad" version for my
tests.)

I believe this confirms that the cause of bug 60317 was the usual
deadlocking issue when awaiting Tasks on the UI thread.  As discussed on
https://blog.stephencleary.com/2012/07/dont-block-on-async-code.html, if
any Tasks awaited anywhere up the call stack are missing
`ConfigureAwait (false)`, then you can run into trouble on the UI
thread.

Additional little checks
========================

1. Do the other `await` statements in commit
1b5e0f7331 all look OK?  Yes, it looks
like this was the only `await` statement that was missing
`ConfigureAwait (false)`:

```
$ git show 1b5e0f7331 | grep await
+				await ProcessOperation (cancellationToken).ConfigureAwait (false);
+				var ret = await InnerRead (cancellationToken).ConfigureAwait (false);
+					await Parent.InnerWrite (RunSynchronously, cancellationToken);
+				var ret = await Parent.InnerRead (RunSynchronously, requestedSize, cancellationToken).ConfigureAwait (false);
+					result = await asyncRequest.StartOperation (CancellationToken.None).ConfigureAwait (false);
+				result = await asyncRequest.StartOperation (cancellationToken).ConfigureAwait (false);
+			var ret = await task.ConfigureAwait (false);
+			await task.ConfigureAwait (false);
```

2. Is it a concern that mcs/class/System did not contain any calls to
`ConfigureAwait ()` until commit 1b5e0f7:

```
$ git grep ConfigureAwait 1b5e0f73316ee7b83c8947bc738015443fabd7af^ -- mcs/class/System || echo 'None'
None
```

I do not think this is a concern.  For example,
System.Net.Http.HttpClient has been using `ConfigureAwait (false)` for
several years, so there is a precedent for it.
2017-11-08 10:12:33 -05:00
Manuel de la Pena ea060b586d [Tests] Fix flaky IO tests due to parrallel execution on Mac bots. (#5965) 2017-11-08 06:37:12 -08:00
Alexander Köplinger a45569fe37 [System] Fix NullReferenceException in Win32EventLog (#5949)
This occasionally happens:

```
System.NullReferenceException : Object reference not set to an instance of an object
  at System.Diagnostics.Win32EventLog.NotifyEventThread (System.Threading.ManualResetEvent resetEvent) [0x00001] in D:\j\workspace\w\mcs\class\System\System.Diagnostics\Win32EventLog.cs:739
  at System.Diagnostics.Win32EventLog.<EnableNotification>b__44_0 () [0x00000] in D:\j\workspace\w\mcs\class\System\System.Diagnostics\Win32EventLog.cs:729
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in D:\j\workspace\w\mcs\class\referencesource\mscorlib\system\threading\thread.cs:68
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in D:\j\workspace\w\mcs\class\referencesource\mscorlib\system\threading\executioncontext.cs:957
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in D:\j\workspace\w\mcs\class\referencesource\mscorlib\system\threading\executioncontext.cs:904
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in D:\j\workspace\w\mcs\class\referencesource\mscorlib\system\threading\executioncontext.cs:893
  at System.Threading.ThreadHelper.ThreadStart () [0x00008] in D:\j\workspace\w\mcs\class\referencesource\mscorlib\system\threading\thread.cs:105
```

We'll get it because there's a race as the lamdba capturing
_notifyResetEvent in EnableNotification() is outside of the
_eventLock so _notifyResetEvent can be null by the time it is called.

We need to check for that case in NotifyEventThread().
2017-11-08 14:44:30 +01:00
Bernhard Urban 198481639f [interp] clear stack on resuming into the main loop (#5959)
* [interp] clear stack on resuming into the main loop

fixes `System.Collections.Generic.DictionaryTest.IDictionary_Add3`.

The problem is that resuming into an handler requires the evaluation stack to be emptied, which didn't happen with the new unified exception handling.

The frame layout looks like this in memory:

| sp | vt_sp | locals | ... |
|----|-------|--------|-----|

If we don't empty `sp` properly, we will eventually overflow into the `vt_sp` area (which is the evaluation stack for value types).  So things get funny if `sp == vt_sp` and you do stuff like this:

```c
  sp->data.p = vt_sp;
```

Kind of amazing that it almost passed the whole test suite with that bug.

* [interp] clear eval stack for value types as well when entering a handler

* [interp] disable more tests in corlib suite
2017-11-08 06:13:20 +01:00
Martin Baulig 865e344512 [System]: Override SslStream.FlushAsync () to call the async version on the underlying stream. (#5960)
* [System]: Override `SslStream.FlushAsync ()` to call the async version on the underlying stream.

* Bump API snapshot submodule
2017-11-08 06:10:23 +01:00
Alexander Köplinger a60b50417a [Facades] Use same assembly company/product/copyright attributes as other BCL assemblies (#5961)
* [Facades] Use same assembly company/product/copyright attributes as other BCL assemblies

We can't use Consts.cs since it'd bloat up the facades too much.

Also remove ".dll" suffix from AssemblyTitle/Description to match
what the Facades in the .NET Framework Reference Assemblies pack
are using.

* Bump API snapshot submodule
2017-11-08 06:01:53 +01:00
Bernhard Urban 4e01b276ae [interp] enable it by default in configure (#5925)
* [interp] enable it by default in configure

can be disabled via --enable-minimal=interpreter, like other components in the
runtime.

* [interp] use DISABLE_INTERPRETER in Makefile.am.in so it is closer to what we had before

* [interp] improve handling of interpreter flag and also check if we are on a cross-compile runtime

* [configure] add interpreter to the list of --enable-minimal

* [ci] remove --enable-interpreter from script

* [windows] disable interpreter for now

* [driver] add output about availabilty of interpreter in --version

* [man] add entry to mono.1 about --interpreter

* [driver] update --interpreter handling
2017-11-08 01:03:19 +01:00
Rodrigo Kumpera a62a7e7e96 Merge pull request #5924 from kumpera/wasm-sdk-integration
[sdk] Add wasm interpreter support.
2017-11-07 14:41:09 -05:00
Egor Bogatov a2649fe604 ignore quick syntax to exclude files in removecomments.sh for local-dist (#5958) 2017-11-07 17:59:49 +01:00
Jonathan Chambers e3d3433b76 Detect platform tizen and link profiler statically similar to Android. 2017-11-07 17:09:10 +01:00
lateralusX de771964ee Add missing build dependency to fix correct parallel build order. 2017-11-07 07:59:46 -08:00
Egor Bogatov 3c4b261617 [corlib] corefx tests from System.Threading.* and System.Text.RegularExpressions (#5762) 2017-11-07 07:08:49 -08:00
Alexander Köplinger 3e9c2af62a [profiler] Improve NUnit xml reporting (#5954)
We were only recording whether the tests passed or failed overall,
but not individual results of tests cases.

This adds that capability.
2017-11-07 14:48:40 +01:00
Johan Lorensson 83f9f3a813 Merge pull request #5950 from lateralusX/lateralusX/disable-join-thread-in-detach
Temporary disable adding thread to joinable threads on none Windows platforms.
2017-11-07 08:21:04 +01:00
Zoltan Varga 286e62e84d [runtime] Handle ENOTCONN/EHOSTDOWN in mono_w32error_unix_to_win32 (). Print a warning instead of asserting, there are lots of error codes we don't handle, map them to ERROR_NOT_SUPPORTED for now. Fixes #60422. (#5927) 2017-11-07 02:51:24 +01:00
Rolf Bjarne Kvinge c3be0663c1 [System] Ignore tests that fail on device until the corresponding bugs have been fixed. (#5951)
* [System] Ignore broken test until corresponding bug is fixed.

* [System] Ignore test that randomly hangs on device.
2017-11-07 02:48:17 +01:00
Rodrigo Kumpera 5ed0fab147 [wasm] Fix test driver and mono's JS support library. 2017-11-06 15:46:30 -08:00
monojenkins ec78917e10 Bump API snapshot submodule 2017-11-06 11:31:56 -08:00
Marek Safar c5fa794e98 [bcl] Updates referencesource to 4.7.1 2017-11-06 11:31:56 -08:00
Bernhard Urban e2a7e328d3 [mcs tests] clean up interp target 2017-11-06 20:20:01 +01:00
Bernhard Urban 43f03233f3 [interp] enable Mono.Debugger.Soft tests on CI 2017-11-06 20:20:01 +01:00
lateralusX acf3607795 Temporary disable adding thread to joinable threads on none Windows platforms.
Race only observed on Windows and current solution adds dependency between detach
and finalizer thread. Disable on none Windows platforms until we have an alternative
solution to the race condition. Keep on Windows until we have alternative solution
since race is manifesting itself on Jenkins builds.
2017-11-06 20:10:45 +01:00
Josip Medved 1a79065f8c Ensuring TextBox is properly updated upon setting/clearing password character. (#5947) 2017-11-06 16:43:58 +01:00
Bernhard Urban 035ad2f118 [mcs tests.make] control with TEST_WITH_INTERPRETER if run-test target uses the interpreter 2017-11-06 15:50:32 +01:00
Bernhard Urban 30fd079c90 [mcs make] introduce TEST_RUNTIME_FLAGS, analogously to TEST_RUNTIME vs. RUNTIME 2017-11-06 15:50:32 +01:00
Bernhard Urban 879f4bc60f [corlib] annotate failing tests when running in interpreter 2017-11-06 15:50:32 +01:00
Bernhard Urban 591ab6d34b [interp] properly resolve MonoType of MonoClassField via mono_field_get_type ()
fixes System.Reflection.Emit/TypeBuilderTest.cs:TypeResolveGenericInstances()
2017-11-06 15:50:32 +01:00
Bernhard Urban 6f7025ba00 [interp] check interruption request flag properly after allocating an object 2017-11-06 15:50:32 +01:00
Bernhard Urban 88970711ff [interp] allow MONO_CALL_STDCALL calling convention on cee_calli insn
fixes Test/System.Reflection.Emit/ILGeneratorTest.cs::TestEmitCalliWithNullReturnType()
2017-11-06 15:50:32 +01:00
Bernhard Urban 292f8ac3c5 [interp] use checked variant of method_get_header and throw exception if there is an error 2017-11-06 15:50:32 +01:00
Bernhard Urban dfca26c32f [interp] allow unsigned i8 in pinvoke signature 2017-11-06 15:50:32 +01:00
Jonathan Chambers 9e6c430e5e Have Boehm mark handle stacks rather than using GC tracked memory. Unify handle memory across all GCs. 2017-11-06 15:41:17 +01:00
Zoltan Varga 29826908fc [interp] Make the interpreter use the JIT exception handling code. (#5943)
This removes the duplicate code from the interpreter and makes it possible to support exception debugging.

Also fix the the basic block construction code so CEE_THROW begins a new bblock.
2017-11-06 08:52:25 -05:00
Marek Safar 5a88e085f3 [corlib] Fixes NullFullNameForSpecificGenericTypes for mobile profiles 2017-11-05 14:42:05 -08:00
Jonathan Chambers f58ba94f8c Add g_ptr_array_capacity to retrieve current size of GPtrArray. Allows clients to know if future additions will cause (re)allocations. (#5931) 2017-11-04 21:57:43 -04:00
Alexander Köplinger 733b4a4c9f [ServiceModel.Web] Fix test by adding WebHttpBehavior to WebChannelFactory endpoint on MOBILE
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=59909

WebChannelFactory doesn't add the WebHttpBehavior on mobile:
https://github.com/mono/mono/blob/4272b68b769951c221ec39d3e844f8f715e1df62/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/WebChannelFactory.cs#L87-L90

This makes the WebInvokeAttributeTest.RejectTwoParametersWhenNotWrapped
test fail on mobile since it doesn't reach the normal validation
method where it'd fail with InvalidOperationException, e.g. here''s
the stack on net_4_x profile:

```
System.InvalidOperationException : Operation 'Join' has multiple message body parts. Add parameters to the UriTemplate or change the BodyStyle to 'Wrapped' or 'WrappedRequest' on the WebInvoke/WebGet attribute.
  at System.ServiceModel.Description.WebHttpBehavior.ValidateOperation (System.ServiceModel.Description.OperationDescription operation) [0x000f9] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel.Web/System.ServiceModel.Description/WebHttpBehavior.cs:249
  at System.ServiceModel.Description.WebHttpBehavior.Validate (System.ServiceModel.Description.ServiceEndpoint endpoint) [0x00028] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel.Web/System.ServiceModel.Description/WebHttpBehavior.cs:268
  at System.ServiceModel.Description.ServiceEndpoint.Validate () [0x0007f] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel/System.ServiceModel.Description/ServiceEndpoint.cs:129
  at System.ServiceModel.ChannelFactory`1[TChannel].CreateChannel (System.ServiceModel.EndpointAddress address, System.Uri via) [0x0002b] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs:148
  at System.ServiceModel.ChannelFactory`1[TChannel].CreateChannel (System.ServiceModel.EndpointAddress address) [0x00000] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs:115
  at System.ServiceModel.ChannelFactory`1[TChannel].CreateChannel () [0x00006] in /Users/alexander/dev/mono/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs:110
```

We can fix this by adding the WebHttpBehavior in the test manually.

NB: I'm actually not sure why this isn't done by default on MOBILE?
According to MSDN it should.
2017-11-03 21:33:42 -07:00
Katelyn Gadd dc023c2fe0 Fix bug 57938 - FullName not returning null for certain generic types (#5920) 2017-11-03 21:15:28 -07:00
vkargov f6e21efe14 [ci] Coverage-imposed build flags should take top priority (#5940) 2017-11-04 03:22:22 +01:00
Vlad Brezae 4272b68b76 [interp] Throw exception in case of field access failure 2017-11-04 02:01:59 +02:00
Vlad Brezae 8f3a51860d [interp] Enable some tests 2017-11-04 02:01:59 +02:00
Vlad Brezae 14d137029b [interp] Don't sigsegv on field lookup failure
Throw exception instead
2017-11-04 02:01:59 +02:00
Vlad Brezae 36d588d62f [interp] Don't assert on ldtoken failure 2017-11-04 02:01:59 +02:00
Vlad Brezae 5d056c0184 [interp] Fix error propagation from interp invoke 2017-11-04 02:01:59 +02:00
Zoltan Varga 4c8bff917c [interp] Avoid translating methods while holding a low level lock, make a copy of InterMethod instead, do the translation with the copy, and copy the results back inside the lock. (#5935) 2017-11-03 18:45:28 -04:00
Aleksey Kliger 5fffc1b8cf [interp] Change 'class' to 'klass' 2017-11-03 21:52:26 +01:00
Jonathan Chambers 174bea7caf Replace 'class' identifier usage with 'klass' to avoid compile errors in C++ 2017-11-03 21:52:26 +01:00
Jo Shields 81feabe4c6 Consider Facades in Provides: too. Version number challenges remain. (#4874)
rpm-find-provides is a mess, this makes it a bit less of a mess by adding not only stuff from the GAC, but also Facades and 4.5 directories. Doesn't help with version mismatches for facades though.
2017-11-03 21:19:00 +01:00
Yuriy c43d73cfd7 [System.Windows.Forms] Fixes #60435. DataGridViewRow.CreateCellsInstance method is never invoked
This fixes bug #60435, where the DataGridViewRow.CreateCellsInstance method is never invoked. Now value of the Cells property is initialized by calling the CreateCellsInstance method.
2017-11-03 20:46:25 +01:00
Yuriy 151fa5590f Internationalization support for System.Windows.Forms: (#5886)
Removed unused localization resource files.
Added default resources for English locale. Updated makefile and System.Windows.Forms-net_4_x.csproj.
Class Locale now uses ResourceManager.
2017-11-03 20:40:17 +01:00
Zoltan Varga fb0fe43283 [sdb] Make get_this_addr () work with the interpreter. (#5937) 2017-11-03 10:39:32 -04:00
Manuel de la Pena fa898df0fc [Tests] Fix zip tests on iOS devices. (#5939)
The zip tests were not using temp files which created bug #60480 when
trying to read the embeded resources. This also fixes the situation in
which tests are run in parallel for the Mac since we could have tests
that step on each other files.
2017-11-03 15:18:48 +01:00
Manuel de la Pena 5143b5a461 [Test] Fix System.IO.Compression.FileSystem tests on iOS devices. (#5938)
Not using a temp file returns in an exception on iOS devices as per bug
60482.
2017-11-03 15:18:36 +01:00
Vlad Brezae 9b9159cb4a [interp] Use xdomain wrappers as with normal jit
Both on jit and interp, the full corlib message sink path does not work on some testcases. Apparently we rely on the xdomain wrappers for correctness there.
2017-11-03 06:25:08 +01:00
Vlad Brezae 5a1fa0f3df [interp] Don't rethrow current frame exception after an icall 2017-11-03 06:25:08 +01:00
Vlad Brezae e2b59a234f [interp] Set correct stack type for icall return 2017-11-03 06:25:08 +01:00
Vlad Brezae ae8d913b00 [interp] Fix constructor call on transparent proxies (#5934)
The object creation of some types (like ContextBoundObject) can return a transparent proxy. When calling the constructor on the returned object we might need to go through the remoting wrappers.
2017-11-02 23:32:19 -04:00
Rodrigo Kumpera 01e767447b [sdks] Address reviewer suggestion. 2017-11-02 16:08:18 -07:00
Rodrigo Kumpera d1349d274f [wasm] Add test runner that executes the mini test suite. 2017-11-02 15:59:56 -07:00
Rodrigo Kumpera a0687c199c [wasm] Build the wasm profile is it was configured in. 2017-11-02 15:58:48 -07:00
Rodrigo Kumpera db00ae8496 [wasm] Update port to work with master. 2017-11-02 15:25:29 -07:00
Rodrigo Kumpera 675b190455 [wasm] Workaround for emcc 1.37.22 that miscompiles the inline assembly. 2017-11-02 15:25:03 -07:00
Rodrigo Kumpera 6f229c1a1b [sdk] Fix wasm build. 2017-11-02 15:22:55 -07:00
Bernhard Urban 5b118b84e5 [interp] disable appdomain-unload (crashes too often) and add comment (#5922) 2017-11-02 13:22:28 -04:00
Vladimir Kargov fa7623e0f3 [tests] Allow overriding Mono arguments for JIT and AOT scenarios. 2017-11-02 08:20:59 -07:00
Vladimir Kargov 8ed81c060c Revert "[configure] Test AOT+LLVM if mono was configured to support both. (#5880)"
This reverts commit 79ef4d8eef.
2017-11-02 08:20:59 -07:00
Alexander Köplinger 033ccb6635 [System.Security] Simplify monodroid test excludes (#5919)
https://github.com/mono/mono/pull/5916 added !MOBILE ifdefs to the
sources so we can remove the .sources file exclusions.
2017-11-01 22:32:25 +01:00
Alexander Köplinger 3df4b8f7f6 [corlib] Add more Assembly*Attribute tests (#5918)
This should allow us to remove most of the linker exclusions in [1]
since they'd be used and thus not linked away in the tests.

Some of the attributes had existing tests but those were under !MOBILE
since they're using RefEmit. Added additional tests to those as well.

[1] https://github.com/xamarin/xamarin-android/blob/c43c5e671aa57a56f7ba5abc3423e9906af51a83/tests/Xamarin.Android.Bcl-Tests/Resources/LinkerDescription.xml
2017-11-01 22:32:07 +01:00
Rodrigo Kumpera 80a20870af [sdk] Use single : in android target that doesn't get appended to. 2017-11-01 14:16:40 -07:00
Rodrigo Kumpera 55cae500f5 [wasm] Add wasm-interp target to build the wasm interpreter based runtime. 2017-11-01 14:15:28 -07:00
Rodrigo Kumpera f124b4d1b8 Merge pull request #5912 from kumpera/bunch-of-changes-for-sdks
This fixes a bunch of issues I found with mono-sdks plus add a Mono.config override to help doing scoped builds.
2017-11-01 11:54:43 -07:00
Manuel de la Pena b73480af34 [Tests] Ensure that only a subset of the System.Security tests are ran on mobile platforms.
(cherry picked from commit 9f696f0eab)
2017-11-01 03:18:15 +01:00
Johan Lorensson d49e8c32c4 [mkbundle] Enhanced mkbundle cygwin/mingw fallback support. (#5867) 2017-11-01 01:05:58 +01:00
Zoltan Varga e0607c34f0 Debugger support for the interpreter (#5902)
* [interp] Add infrastructure code needed for unified exception handling between the interpreter and the JIT.

* Pass the clause to mono_interp_set_resume_state ().
* Add a mono_interp_run_filter () function to run filter clauses.
* Add a 'ji' field to ExceptionTraceIp which is used to avoid an ip->ji lookup in ves_icall_get_trace ().
* Rename mono_handle_exception_internal_first_pass () to handle_exception_first_pass () and make it return the
  StackFrameInfo for the frame which caught the exception.

This allows the removal of the duplicate and hard to understand interpreter EH code
and makes it easier to add debugger support to the intepreter.

* [sdb] Pass the already computed StackFrameInfo to mono_debugger_agent_handle_exception () so it doesn't have to be recomputed in ss_create (). This approach works both for the JIT and the interpreter.

* [interp] Generate seq points for async methods too.

* [interp] Rename ves_exec_method_with_context () to interp_exec_method_full (), add a interp_exec_method () helper with less arguments.

* [interp] Set ctx->sp for interpreter frames to the address of the InterpFrame structure, code in debugger-agent.c uses it to order frames.

* [sdb] Fix the support for filter clauses in the interpreter by running them in a new interpreter frame.

* [sdb] Add DEBUGGER_INVOKE frames for the interpreter.

* [interp] Add a mono_interp_frame_get_parent () function, use that instead of the 'new_sp' argument to mono_interp_frame_iter_next ().

* [sdb] Run the test code for the ClassLocalReflection () test only for that test since it doesn't work with the interpreter.

* [interp] Fix the build.
2017-10-31 18:39:43 -04:00
Konstantin Safonov 08bb8da2cc [System.Web] Reference source import (#5909)
* [System.Web] Reference source import: DataSourceControlBuilder, DefaultAuthenticationEventHandler, EventEntry, Pair, ServerValidateEventArgs, TreeNodeTypes, WizardStep

* Bump API snapshot submodule
2017-10-31 20:48:41 +01:00
cherusker bea6d82e80 Unlock sgen-fin-weak-hash.c:
- Unlock simple counters
- Unlock the usage of `next_fin_stage_entry` and `fin_stage_entries` within `add_stage_entry ()`
2017-10-31 17:16:38 +02:00
cherusker 2bf3e7e3a9 Prepare unlocked.h for the upcoming changes:
- add the `volatile` qualifier to all pointer parameters
- add `UnlockedWritePointer ()`
2017-10-31 17:16:38 +02:00
Zoltan Varga b259c836ab [jit] Move the code handling the MonoLMFExt structures from exceptions-<ARCH>.c to mini-exceptions.c, its the same on all platforms. (#5907)
* [jit] Move the code handling the MonoLMFExt structures from exceptions-<ARCH>.c to mini-exceptions.c, its the same on all platforms.

* [jit] Remove mono_arch_init_lmf_ext (), it does the same on every platform.
2017-10-31 10:32:20 -04:00
oittaa 35acde58d4 Use getrandom() instead of /dev/urandom on Linux (#5851)
Use getrandom() instead of /dev/urandom on Linux

getrandom() was introduced in version 3.17 of the Linux kernel and glibc has implemented it since version 2.25.
2017-10-31 14:25:07 +01:00
Vlad Brezae 32d2f28518 [sgen] Collect major after user requested minor collections
After a user requested minor collection we need to check if the new size of the heap exceeds the allowance, in which case we need to also do a major collection.

Fixes bug (#60168) where, if user triggers minors repeatedly, we never get to collect the major space (which is normally checked after the nursery is full, which never happens in this case)
2017-10-31 13:47:28 +02:00
Bernhard Urban 9a879a1b11 [interp] disable broken test cases on CI (#5914)
they do not always fail.

exception18.exe fails with:

```
Unhandled Exception:
System.Exception: Exception carried 3 frames along with it when it should have reported one.
-0: 0x00020 throw      in C:Main () () at Main:32 // (TODO: proper stacktrace)
-1: 0x00037 vcall      in (wrapper runtime-invoke) object:runtime_invoke_direct_void (object,intptr,intptr,intptr) ([0x0] [0x7fff5907bab0] [0x0] [0x7ffdf8e05308] ) at runtime_invoke_direct_void:55 // (TODO: proper stacktrace)
```

bug-48015.exe fails with:

```
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
-0: 0x00063 vcallvirt  in System.Runtime.Remoting.Proxies.RemotingProxy:Invoke (System.Runtime.Remoting.Messaging.IMessage) ([0x10e407930] [0x10e4081d0] ) at Invoke:99 // (TODO: proper stacktrace)
-1: 0x00077 callvirt   in System.Runtime.Remoting.Proxies.RealProxy:PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy,System.Runtime.Remoting.Messaging.IMessage,System.Exception&,object[]&) ([0x10e407930] [0x10e4081d0] [0x7fff522b36e8] [0x7fff522b36e0] ) at PrivateInvoke:119 // (TODO: proper stacktrace)
-2: 0x00034 call       in (wrapper runtime-invoke) <Module>:runtime_invoke_direct_object_RealProxy_IMessage_Exception&_object[]& (object,intptr,intptr,intptr) ([0x0] [0x7fff522b3640] [0x7fff522b36e8] [0x7fd8dc85ff28] ) at runtime_invoke_direct_object_RealProxy_IMessage_Exception&_object[]&:52 // (TODO: proper stacktrace)
-3: 0x00000            in (wrapper remoting-invoke) object:Equals (object) ([0x10e4081a8] [0x10e4081a8] )
-4: 0x0000d callvirt   in Driver:Main (string[]) ([0x10e4003e8] ) at Main:13 // (TODO: proper stacktrace)
-5: 0x0003d vcall      in (wrapper runtime-invoke) <Module>:runtime_invoke_direct_void_string[] (object,intptr,intptr,intptr) ([0x0] [0x7fff522b5ab0] [0x0] [0x7fd8da40d408] ) at runtime_invoke_direct_void_string[]:61 // (TODO: proper stacktrace)
```

partial revert of: https://github.com/mono/mono/pull/5861
2017-10-31 12:46:46 +01:00
Alexander Köplinger 0dbdcf2e77 [Mono.Posix] Fix some socket tests on monodroid (#5915)
d9922895d4 removed Mono.Unix.Native/SocketTest.cs
from the exclude list on the monodroid profile.

It turns out that some tests don't work there however,
they fail with an ArgumentOutOfRangeException on some socket options.
2017-10-31 02:31:43 +01:00
Zoltan Varga 8992f0fd05 [runtime] Remove the no_raise argument from mono_register_jit_icall_full (), no icalls call mono_raise_exception () anymore. Rename the 'is_save' argument to 'no_wrapper'. Allow inlining wrappers for all icalls. (#5897) 2017-10-30 19:08:13 -04:00
Zoltan Varga 92477b9583 [jit] Remove unused mono_interruption_checkpoint_from_trampoline_deprecated () JIT icall. (#5895) 2017-10-30 19:04:31 -04:00
Rodrigo Kumpera 82579ce9ce Merge pull request #5879 from kumpera/wasm-work-p6
[wasm] Add missing tramp and fix compilation
2017-10-30 18:10:21 -04:00
Rodrigo Kumpera d208927a5f [sdks] Add notes for the BCL build. 2017-10-30 15:08:27 -07:00
Rodrigo Kumpera c133304b95 [android] Fix compilation with recent ndk and sdk target < 16. 2017-10-30 15:08:25 -07:00
Rodrigo Kumpera 6b3e68486a [sdks] Update bcl target to include wasm profile. 2017-10-30 15:08:06 -07:00
Rodrigo Kumpera cc9cb3f6d7 [sdks] Fix autogen invocation and respect Make.config options.
Not all systems will have brew's libtool force linked, so we probe for glibtool to ensure we got it.

Respect DISABLE_ options.

Added DISABLED_BCL.
2017-10-30 15:08:01 -07:00
vkargov 79ef4d8eef [configure] Test AOT+LLVM if mono was configured to support both. (#5880) 2017-10-30 17:28:36 -04:00
Ludovic Henry 110888fd66 [interp] Enable more runtime tests for interpreter 2017-10-30 20:08:24 +01:00
Rodrigo Kumpera d5028868d3 Merge pull request #5685 from urisimchoni/callspec-ut
Callspec unit testing and a bugfix
2017-10-30 14:04:45 -04:00
Zoltan Varga da53cb0e08 [runtime] Rename mono_raise_exception_with_context_deprecated () back to mono_raise_exception_with_context (), its ok to use since it starts unwinding from the CTX argument which points into managed code. (#5896) 2017-10-30 11:19:48 -04:00
Zoltan Varga fdcf7da3f4 [amd64] Remove the unused MonoLMF.rip field. (#5904) 2017-10-30 11:17:35 -04:00
Ludovic Henry ff078951a5 [w32process] Reduce mmap allocation by mapping file only once 2017-10-30 10:50:29 -04:00
Zoltan Varga 9fdc0045ad [runtime] Avoid creating callbacks.interp_get_remoting_invoke if the interpreter is not enabled at runtime. (#5905) 2017-10-29 21:50:54 -04:00
Zoltan Varga 96361e3913 [arm64] Throw OverflowException instead of the more general ArithmeticException. 2017-10-29 12:06:40 +01:00
Konstantin Safonov / kasthack ddd07a749f [System.Web] LoginTextLayout from reference source 2017-10-28 09:59:36 +02:00
Jonathan Chambers dd033ae341 Duplicate friend assembly names and add needed null terminator. 2017-10-28 09:58:59 +02:00
Neale Ferguson 1c15c3ebd3 Match amd64/arm64 in the way of handling exceptions within trampolines (#5891) 2017-10-28 02:02:25 -04:00
Rodrigo Kumpera f5915baa5d [sdks] Fix android configure with latests NDK
The latest NDK doesn't support platform 9 anymore, the minimum it accepted was 14 thus I changed both arm and x86 to it.
This is harmless as 14 covers all but gingerbread which XA plans on stopping to support.

Added a android-toolchain target that configure all android toolchains.
2017-10-27 16:43:25 -07:00
Rolf Bjarne Kvinge cfba305b7e [corlib][Test] Ignore FileTest.SymLinkLoop until bug #59239 is fixed. (#5889)
https://bugzilla.xamarin.com/show_bug.cgi?id=59239
2017-10-28 01:12:06 +02:00
Konstantin Safonov a043b26831 [System.Web] EmptyControlCollection from reference source (#5884)
* [System.Web] EmptyControlCollection from reference source

* Bump API snapshot submodule
2017-10-28 01:10:33 +02:00
Rodrigo Kumpera f871b90d5e [sdks] Fix Android build.
The generated project.properties file is required by build.xml.
Fix the clean target to work on a clean tree and to remove those generated files.
2017-10-27 15:50:22 -07:00
Rodrigo Kumpera ac4095a1ea [sdks] Improve path handling and include local conf file
On my system, XS installs android sdk/ndk on different places.
This patch probe the default places and fallback to the places I got.

It does verify if the paths are bad and fail building ASAP.

Finally, in includes sdks/Make.config that will include defines to trim what things you actually want to build.
2017-10-27 15:49:31 -07:00
Rodrigo Kumpera 2856f523f6 [wasm] Add missing tramp 2017-10-27 14:49:45 -07:00
Uri Simchoni 4a28d3595c [runtime] fix prev commit build for Linux x64 2017-10-27 22:22:02 +03:00
Rodrigo Kumpera 6b8b32b6fc [runtime] Fix unit test. 2017-10-27 22:07:21 +03:00
robotrovsky e1b75723d7 Bugfix: 1.5 stop bits for serial port should set the posix stop bit flag (#5873)
1.5 stop bits have not been handled at all.
According to this documentation of the 8250 UART:
http://stanislavs.org/helppc/8250.html

a set bit 2 in the LCR register means stop bits = 1.5 for 5 bit words or 2 for 6, 7 or 8 bit words.
That is the reason why pyserial also sets the bit:
https://github.com/pyserial/pyserial/blob/92d101613be41ecb2f2054c3f43a006fbe6f9966/serial/serialposix.py#L377
2017-10-27 19:59:13 +02:00
Marek Safar f2e658cdca [build] Add wasm profile 2017-10-27 19:48:59 +02:00
Konstantin Safonov 6d9d804d62 [System.Web] TableFooterRow from reference source (#5882)
* [System.Web] TableFooterRow from reference source

* Bump API snapshot submodule
2017-10-27 19:38:24 +02:00
Zoltan Varga 0a320dbb95 [aot] Error out when using the coverage profiler + aot, its not supported. Fixes #60175. (#5881) 2017-10-27 19:08:41 +02:00
Konstantin Safonov adbf98b977 [System.Web] CompilationMode from reference source (#5878) 2017-10-27 12:23:28 +02:00
Konstantin Safonov 1f1a1574c2 [System.Web] ScrollBars from reference source (#5869) 2017-10-27 12:23:00 +02:00
Konstantin Safonov 6e529aafcc [System.Web] ObjectDataSourceEventHandler from reference source (#5868) 2017-10-27 12:22:42 +02:00
Konstantin Safonov 5802f03926 [System.Web] WizardStepType from reference source (#5870) 2017-10-27 12:21:44 +02:00
Konstantin Safonov 8e617d38da [System.Web] TableHeaderRow from reference source (#5866)
* [System.Web] TableHeaderRow from reference source

* Bump API snapshot submodule
2017-10-27 12:16:55 +02:00
Konstantin Safonov aa39bf69f2 [System.Web] IndexedString from reference source (#5872)
* [System.Web] IndexedString from reference source

* Bump API snapshot submodule
2017-10-27 12:14:16 +02:00
Konstantin Safonov c17cc609da [System.Web] ImageClickEventArgs from reference source (#5871)
* [System.Web] ImageClickEventArgs from reference source

* Bump API snapshot submodule
2017-10-27 12:09:07 +02:00
Uri Simchoni 59c42eacf4 [mono/unit-tests] add callspec unit tests for different classs same prefix
Add a test that covers the case where a callspec method
descriptor has a class whose name is a prefix of the matched
class.
2017-10-27 10:01:45 +03:00
Uri Simchoni e4b94aa495 [metadata] Avoid matching class with prefix name
When matching a class in match_class() debug helper, avoid maching the class
if the matched-against descriptor's class name is only
a prefix of the class name, but the class name is actually
longer (e.g. don't match Foo2 against Foo).
2017-10-27 10:01:45 +03:00
Uri Simchoni ec038ebb76 [mono/unit-tests] callspec unit testing
Add a unit test for callspec parsing and evaluation.

call specifications are being  used with the --trace command line
argument and with the log profiler 'callspec' parameter. This test
suite verifies that call specifications are correctly parsed and matched
against methods at runtime.
2017-10-27 10:01:45 +03:00
Marek Safar c14b08013c [Microsoft.CSharp] Adds more tests 2017-10-26 23:33:17 +02:00
Ludovic Henry b0919d93f9 [sdks] Source drop from xamarin/mono-sdks (#5876)
```
commit dcd3ed4930fbfa19df1a34c17bc17f5a57badb83
Author: Rodrigo Kumpera <[email protected]>
Date:   Thu Apr 6 15:53:36 2017 -0700

    switch mono to 2017-04.

 external/mono | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit cbff024be0d2ed30efda0ee228c339e4e2dce866
Author: Rodrigo Kumpera <[email protected]>
Date:   Thu Apr 6 15:53:13 2017 -0700

    Update readme with xtc specifics.

 README.md | 13 +++++++++++++
 1 file changed, 13 insertions(+)

commit b385e6ce4ee7ffb92cdb39cdf8bbdb82355d909f
Author: Rodrigo Kumpera <[email protected]>
Date:   Thu Apr 6 15:34:18 2017 -0700

    Add makefile to build & submit to xtc.

 android/xtc/Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

commit 09ca3773ac25d8415c537f063d057aa471bb1eae
Author: Rodrigo Kumpera <[email protected]>
Date:   Thu Apr 6 15:08:29 2017 -0700

    UITest based runner.

 android/xtc/RuntimeTests.csproj | 43 +++++++++++++++++++++
 android/xtc/RuntimeTests.sln    | 17 +++++++++
 android/xtc/Tests.cs            | 84 +++++++++++++++++++++++++++++++++++++++++
 android/xtc/packages.config     |  5 +++
 4 files changed, 149 insertions(+)

commit bc20ebfeb58ee9d876e2f675651bdb9afa07fdeb
Author: Rodrigo Kumpera <[email protected]>
Date:   Thu Apr 6 15:05:39 2017 -0700

    Finish x86 support.

 android/Makefile           | 4 ++++
 android/jni/Application.mk | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

commit dcec00c4ef9240324ef3c4b9a4d5ab7c670c1984
Author: Rodrigo Kumpera <[email protected]>
Date:   Thu Apr 6 13:49:55 2017 -0700

    Add new redeploy target plus fix bcl staging.

 android/Makefile         | 4 ++++
 android/managed/Makefile | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

commit 5d6db27c2a3039271138f9f8c58a72262211793d
Author: Bernhard Urban <[email protected]>
Date:   Thu Mar 30 18:26:24 2017 -0400

    [readme] add todo item for android

 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 9ebd7bed3a5e66ccae2819e4c1045a1714a4274b
Author: Bernhard Urban <[email protected]>
Date:   Thu Mar 30 17:39:49 2017 -0400

    fix default make target

 Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

commit f307dd3ef39733f528f1ef816741d2a9f4017f7a
Author: Bernhard Urban <[email protected]>
Date:   Thu Mar 30 17:37:11 2017 -0400

    [sdks] use $(NDK_DIR) from paths.mk

 sdks/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 83f470fcd7b039fd7945ec939c314bc18d2829ad
Author: Rodrigo Kumpera <[email protected]>
Date:   Thu Mar 30 16:58:45 2017 -0400

    More todos

 README.md | 1 +
 1 file changed, 1 insertion(+)

commit d5a3d38a848860f5c4ba320c0ca6d26d52eff635
Author: Rodrigo Kumpera <[email protected]>
Date:   Thu Mar 30 16:58:28 2017 -0400

    Add x86 and x86_64

 android/jni/Application.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 3c51f005173a021d1bf6e8ecea22bc3b5fda08ba
Author: Rodrigo Kumpera <[email protected]>
Date:   Thu Mar 30 16:55:45 2017 -0400

    Fix the mono submodule.

 external/mono | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit e293d61090c9e8eb3a113a0d34be7ddd1e2c3597
Author: Bernhard Urban <[email protected]>
Date:   Wed Mar 29 18:36:29 2017 -0400

    [readme] add links to specific NDK

 README.md | 6 ++++++
 1 file changed, 6 insertions(+)

commit 0985f1c448641484de6eac249f9cb9af1f1973b5
Author: Rodrigo Kumpera <[email protected]>
Date:   Wed Mar 29 16:32:47 2017 -0400

    fix x86/x86_64 packaging.

 README.md        |  1 +
 sdks/Makefile    | 13 +++----------
 sdks/android.erb | 13 +++++++++++++
 3 files changed, 17 insertions(+), 10 deletions(-)

commit c0b9498d9afdaea48f474d31358a284b31d621e5
Author: Rodrigo Kumpera <[email protected]>
Date:   Wed Mar 29 15:31:37 2017 -0400

    Add x86 and x86-84 to sdks.

 sdks/Makefile            | 15 +++++++++++++--
 sdks/android-template.rb | 33 +++++++++++++++++++++++++++++++++
 sdks/android.erb         |  4 ++--
 3 files changed, 48 insertions(+), 4 deletions(-)

commit 53778f4d473798123cf06896ffd2082517afc08d
Author: Rodrigo Kumpera <[email protected]>
Date:   Wed Mar 29 11:40:18 2017 -0400

    small updates

 Makefile  | 7 ++++++-
 README.md | 5 +++++
 2 files changed, 11 insertions(+), 1 deletion(-)

commit 531603b66b630f3a46d1173124e202867f22460b
Author: Rodrigo Kumpera <[email protected]>
Date:   Wed Mar 29 11:33:08 2017 -0400

    Add Android app.

 android/AndroidManifest.xml                        |  17 +
 android/Makefile                                   |  56 ++
 android/build.xml                                  |  92 ++++
 android/jni/Android.mk                             |  36 ++
 android/jni/Application.mk                         |   2 +
 android/jni/runtime-bootstrap.c                    | 588 +++++++++++++++++++++
 android/res/layout/main.xml                        |  22 +
 android/res/values/strings.xml                     |   4 +
 .../src/org/mono/android/main/AndroidRunner.java   | 136 +++++
 9 files changed, 953 insertions(+)

commit 2ae7f04e5fec696c83e47e8d938d9c9a3804beb8
Author: Rodrigo Kumpera <[email protected]>
Date:   Wed Mar 29 11:05:30 2017 -0400

    Add C# test runner, build scripts and the needed machine.config.

 Makefile                            |  55 +------
 android/machine.config              | 278 ++++++++++++++++++++++++++++++++++++
 android/managed/Makefile            |  80 +++++++++++
 android/managed/fake-monodroid.cs   |  80 +++++++++++
 android/managed/main.cs             | 106 ++++++++++++++
 android/managed/mini-test-runner.cs |  74 ++++++++++
 6 files changed, 621 insertions(+), 52 deletions(-)

commit ded22bbf4a496e5e4a5fc9feb1f615698101718b
Author: Rodrigo Kumpera <[email protected]>
Date:   Tue Mar 28 13:59:42 2017 -0400

    update readme

 README.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

commit f32b490b520da12a68f14ca6adfb00cb06b6733e
Author: Rodrigo Kumpera <[email protected]>
Date:   Tue Mar 28 00:26:00 2017 -0400

    Initial set of scripts to build Android runtimes.

 .gitmodules              |  4 +++
 Makefile                 | 57 +++++++++++++++++++++++++++++++
 README.md                | 23 +++++++++++++
 external/mono            |  1 +
 paths.mk                 |  5 +++
 sdks/Makefile            | 83 +++++++++++++++++++++++++++++++++++++++++++++
 sdks/android-template.rb | 58 +++++++++++++++++++++++++++++++
 sdks/android.erb         | 88 ++++++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 319 insertions(+)

commit c61c02f2f30e513c3f2c471892158958e9a042ca
Author: Rodrigo Kumpera <[email protected]>
Date:   Wed May 3 12:22:18 2017 -0700

    Build offsets & cross compilers, requires tip of kumpera/mono/naked-mono-goes-ios. Ready for cleanup-a-ton.

 sdks/ios.mk | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

commit 9b0f4522b96f7f9f91837859ad422e7a5c4300fb
Author: Rodrigo Kumpera <[email protected]>
Date:   Tue May 2 19:56:22 2017 -0700

    add cross64.

 sdks/ios.mk | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

commit 1b03dc6552dd08b1690374e6b73d89a085b59a2e
Author: Rodrigo Kumpera <[email protected]>
Date:   Tue May 2 19:55:30 2017 -0700

    add cross compilers. cross offset generation missing.

 sdks/ios.mk | 52 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 48 insertions(+), 4 deletions(-)

commit 1697337e706220185568eedf52b73e236521576a
Author: Rodrigo Kumpera <[email protected]>
Date:   Tue May 2 17:38:52 2017 -0700

    add device64

 sdks/ios.mk | 115 ++++++++++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 92 insertions(+), 23 deletions(-)

commit 39f5ce7332d2d2cb7f9ca187f5d88f092f030d3c
Author: Rodrigo Kumpera <[email protected]>
Date:   Tue May 2 13:18:15 2017 -0700

    missing files.

 ios/MonoTestRunner/main.cs | 106 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 106 insertions(+)

commit e3acb9682de0cf11ceda0ab38649c39fc7518b41
Author: Rodrigo Kumpera <[email protected]>
Date:   Tue May 2 13:15:53 2017 -0700

    some IO stuff

 ios/MonoTestRunner/Makefile                        | 15 ++++--
 .../MonoTestRunner/Base.lproj/Main.storyboard      | 41 +++++++++++++++--
 ios/MonoTestRunner/MonoTestRunner/ViewController.m | 18 ++++++++
 .../MonoTestRunner/runtime-bootstrap.c             | 12 +++--
 .../MonoTestRunner/runtime-bootstrap.h             |  1 +
 .../MonoTestRunner/runtime-objc-helpers.m          | 53 +++++++++++++++++++++-
 6 files changed, 129 insertions(+), 11 deletions(-)

commit 5c83e9bb5bfdae13ff632d620b4d2a9896c83be3
Author: Rodrigo Kumpera <[email protected]>
Date:   Thu Apr 20 15:41:43 2017 -0700

    Skeleton support for iOS. Sim only, not part of regular build.

 ios/MonoTestRunner/Makefile                        |  32 ++
 .../MonoTestRunner.xcodeproj/project.pbxproj       | 373 +++++++++++++++++++++
 ios/MonoTestRunner/MonoTestRunner/AppDelegate.h    |  17 +
 ios/MonoTestRunner/MonoTestRunner/AppDelegate.m    |  51 +++
 .../AppIcon.appiconset/Contents.json               |  93 +++++
 .../MonoTestRunner/Assets.xcassets/Contents.json   |   6 +
 .../Base.lproj/LaunchScreen.storyboard             |  27 ++
 .../MonoTestRunner/Base.lproj/Main.storyboard      |  26 ++
 ios/MonoTestRunner/MonoTestRunner/Info.plist       |  45 +++
 ios/MonoTestRunner/MonoTestRunner/ViewController.h |  15 +
 ios/MonoTestRunner/MonoTestRunner/ViewController.m |  32 ++
 ios/MonoTestRunner/MonoTestRunner/main.m           |  16 +
 .../MonoTestRunner/runtime-bootstrap.c             | 269 +++++++++++++++
 .../MonoTestRunner/runtime-bootstrap.h             |  16 +
 .../MonoTestRunner/runtime-objc-helpers.m          |  44 +++
 sdks/Makefile                                      |  10 +-
 sdks/ios.mk                                        | 177 ++++++++++
 17 files changed, 1245 insertions(+), 4 deletions(-)
 ```
2017-10-26 15:15:56 -04:00
Rodrigo Kumpera 55df935275 Merge pull request #5874 from vargaz/fix-60255
[jit] Throw the more specific OverflowException instead of ArithmeticException in the ldiv/lrem emulation functions. Fixes #60255.
2017-10-26 10:21:07 -07:00
Zoltan Varga eb9238c05e [jit] Throw the more specific OverflowException instead of ArithmeticException in the ldiv/lrem emulation functions. Fixes #60255. 2017-10-26 10:12:31 -04:00
Alexander Kyte df86ddf49b [dontmerge/forjenkins] Always enable jemalloc, so CI builds with enabled for pkg 2017-10-26 03:01:12 -04:00
Alexander Kyte 27d68cef08 [runtime] Bring jemalloc to mono
Jemalloc is known to have much better performance than system memory
allocators, and is safe in concurrent/re-entrant situations.

To use, provide the following options to configure:

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

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

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

If you export
MONO_JEMALLOC_CONF="stats_print:true"

You will see detailed memory statistics for mono at exit.

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

To understand the build work, I'm statically linking jemalloc.a into
the compilation unit for mono/utils/mono-jemalloc.c, which is
responsible for registering it with mono at startup. No further
copying out of the submodule is necessary at installation time.
2017-10-26 03:01:11 -04:00
Katelyn Gadd 067809c50e Add an automated test that will fail if the list of feature names in CompilerServices.RuntimeFeature is changed (#5854) 2017-10-25 23:13:50 +02:00
Marek Safar a348c12719 Bump roslyn 2017-10-25 21:38:44 +02:00
Rodrigo Kumpera 5c75f593de Merge pull request #5764 from Unity-Technologies/save-resume-tramp-amd64-xmm-arg-regs
Save and resume full 128-bits of xmm argument registers in trampoline…
2017-10-25 10:11:08 -07:00
Rodrigo Kumpera 13a9fb6c7a Merge pull request #5844 from vargaz/fix-60288
[runtime] Allow valuetypes larger than 1MB created by csc. Fixes #60288.
2017-10-25 10:07:43 -07:00
Marek Safar b0983b83cd [mono] Update denied assemblies list 2017-10-25 18:37:23 +02:00
lateralusX 82e2421819 Build fixes for none Windows desktop platforms.
* Exclude a couple of sources currently not building anything useful on Windows.
* Added MONO_EMTPY_SOURCE_FILE to a couple of source files ending up empty by default.
* Excluded API's not included on UWP targets.
* Explicitly declared import project paths in target files.
* Added support to define x64 MASM build outside default targets file.
2017-10-25 16:44:19 +02:00
Zoltan Varga e3c239ccdc [arm] Add support for unlimited size/number of arguments to the dyn call code. Part of the fix for #59184. (#5840) 2017-10-25 10:08:12 -04:00
Egor Bogatov 0f045b1ded [System.Data] Cleanup after #4893 (PR) (#5841)
* [System.Data] cleanup

* Remove DataProviderTests
2017-10-25 11:34:22 +02:00
Jon Purdy 00af82567c Bump corlib version for MonoIO coop handle changes. 2017-10-24 10:37:29 -07:00
Jon Purdy 1ba4211147 [coop-handles] System.IO.MonoIO.Read 2017-10-24 10:37:29 -07:00
Jon Purdy 498eb7dc58 [coop-handles] System.IO.MonoIO.GetCurrentDirectory 2017-10-24 10:37:29 -07:00
Jon Purdy 72b5a0e99e [coop-handles] System.IO.MonoIO.get_InvalidPathChars 2017-10-24 10:37:29 -07:00
Jon Purdy 6cdc5531dc [coop-handles] System.IO.MonoIO.FindNextFile 2017-10-24 10:37:29 -07:00
Jon Purdy b73d5302b1 [coop-handles] System.IO.MonoIO.FindFirstFile 2017-10-24 10:37:29 -07:00
Jon Purdy 52786872cd [coop-handles] System.IO.MonoIO.Write 2017-10-24 10:37:29 -07:00
Jon Purdy 77fd6e0846 [coop-handles] System.IO.MonoIO.SetFileAttributes 2017-10-24 10:37:29 -07:00
Jon Purdy 16ebef70ed [coop-handles] System.IO.MonoIO.SetCurrentDirectory 2017-10-24 10:37:29 -07:00
Jon Purdy 85f4b5b167 [coop-handles] System.IO.MonoIO.ReplaceFile 2017-10-24 10:37:29 -07:00
Jon Purdy 8ea394429c [coop-handles] System.IO.MonoIO.RemoveDirectory 2017-10-24 10:37:29 -07:00
Jon Purdy 847aec7167 [coop-handles] System.IO.MonoIO.Open 2017-10-24 10:37:29 -07:00
Jon Purdy 0de5f20375 [coop-handles] System.IO.MonoIO.MoveFile 2017-10-24 10:37:29 -07:00
Jon Purdy e57d26ebaf [coop-handles] System.IO.MonoIO.GetFileStat 2017-10-24 10:37:29 -07:00
Jon Purdy 794f17ef8b [coop-handles] System.IO.MonoIO.GetFileAttributes 2017-10-24 10:37:29 -07:00
Jon Purdy 89647e4d20 [coop-handles] System.IO.MonoIO.DeleteFile 2017-10-24 10:37:29 -07:00
Jon Purdy 26aaf7617d [coop-handles] System.IO.MonoIO.CreateDirectory 2017-10-24 10:37:29 -07:00
Jon Purdy 477d5f3f70 [coop-handles] System.IO.MonoIO.CopyFile 2017-10-24 10:37:29 -07:00
Ankit Jain 26ccf75f06 [msbuild] Add symlink to csc.exe in msbuild bin dir
Roslyn looks only inside `$msbuild_bin/Roslyn/` and does not fallback to
the framework path. msbuild worked around this by setting `CscToolPath`:

https://github.com/mono/msbuild/commit/157a0f4d1a7aadd4e561e3ca8c784cbc2529926f

But this kicks in only if the default msbuild target files are imported!
If the `Csc` task is being used without importing them, then we fail
with

	`error MSB3082: Task failed because "csc.exe" was not found.`

`Microsoft.CodeAnalysis.VisualBasic.dll` is the only file not being
symlinked, after this change. So, instead we will symlink all the files.

Fixes bxc #60340 .
2017-10-24 17:09:03 +02:00
Alexander Köplinger 2b15f1e6b2 [runtime] Fix Windows build break due to renamed mono_error_raise_exception (#5849)
It was renamed in 91a10ffd01
but some places which are only used on Windows were missed.
2017-10-24 16:32:24 +02:00
Radek Doulik 4b702c8d6a [corlib] Updated LinkerDescriptor
Preserve
`System.Runtime.Remoting.Activation.ActivationServices.CreateProxyForType`. It
is called from `object.c:mono_object_new_specific_checked` when
constructing remoting or com objects.

I didn't add `feature="remoting"` because it is used also for com
objects.

Added linker test. Without the LinkerDescriptor addition, it fails
like this:

    Unhandled Exception:
    System.NotSupportedException: Linked away.
      at (wrapper managed-to-native) System.Object.__icall_wrapper_ves_icall_object_new_specific(intptr)
      at C.Main () [0x00001] in /Users/rodo/git/mono/mcs/tools/linker/Tests/mscorlib/test-remoting.cs:11
    [ERROR] FATAL UNHANDLED EXCEPTION: System.NotSupportedException: Linked away.
      at (wrapper managed-to-native) System.Object.__icall_wrapper_ves_icall_object_new_specific(intptr)
      at C.Main () [0x00001] in /Users/rodo/git/mono/mcs/tools/linker/Tests/mscorlib/test-remoting.cs:11
2017-10-24 16:14:56 +02:00
Alexis Christoforides 9502de7852 Merge pull request #5846 from kumpera/wasm-work-p5
[interpreter] Fix the DISABLE_REMOTING build.
2017-10-24 01:07:39 -07:00
Alexis Christoforides 14a6854c79 [scripts] Build 64-bit package by default 2017-10-24 00:36:56 -07:00
Zoltan Varga bc3ba3cb5d [arm] Make the generic trampoline call mono_thread_force_interruption_checkpoint_noraise () and throw the exception itself instead of calling the obsolete mono_interruption_checkpoint_from_trampoline (). (#5838) 2017-10-24 01:46:29 -04:00
vinogradniy 79d96a5a8d Fix WCF Windows Linux cross WCF-comunication via NetTcpBinding (without any security Transport|Message). (#5842)
See also:
 * https://stackoverflow.com/questions/37813752/wcf-and-data-contract-with-template
 * https://bugzilla.xamarin.com/show_bug.cgi?id=58261
2017-10-24 00:40:51 +02:00
Zoltan Varga 03ea90cf1f [bcl] Optimize Process.GetCurrentProcess ().MainModule. (#5843) 2017-10-24 00:32:31 +02:00
Zoltan Varga cc67bfdcfc [runtime] Allow valuetypes larger than 1MB created by csc/mcs. Fixes #60288. 2017-10-23 18:08:11 -04:00
Rodrigo Kumpera f2e1f58a80 [interpreter] Fix the DISABLE_REMOTING build. 2017-10-23 14:40:19 -07:00
Jonathan Chambers 77b4cd11d1 Only null check target for delegate if method is not static. (#5833)
* Only null check target for delegate if method is not static. Fixes regression introduced by 1cfd52452a.

* [interp] pass first stack arg to transform, so we get the correct delegate wrapper

the wrapper logic detects if the target method of a delegate is a static
method with an argument bound, and handles it properly in the generated
code.

fixes mono/tests/delegate14.cs
2017-10-23 15:53:20 -04:00
Zoltan Varga 91a10ffd01 [runtime] Mark mono_raise_exception()/mono_reraise_exception() as external only. Add new _deprecated internal versions. (#5839) 2017-10-23 15:50:59 -04:00
Rolf Bjarne Kvinge 5edb2a54db [runtime] Improve diagnostics about methods that failed to LLVM-compile by including the typename in the message. (#5706) 2017-10-21 12:25:23 -04:00
Alexander Köplinger d60877b0f3 Fix tarball build
corefx.unix.sources wasn't included in the tarball so it failed.
2017-10-21 00:44:56 +02:00
Alexis Christoforides 2124bda984 Merge pull request #5830 from alexischr/wrench-tests
Add MacSDK test script
2017-10-20 10:16:55 -07:00
Rodrigo Kumpera 7cde4806fd Merge pull request #5632 from luhenry/threads-rework-shutdown
[threads] Guarantee we abort all threads before shutdown
2017-10-20 10:06:20 -07:00
Vlad Brezae 299ad0f1fd Merge pull request #5825 from BrzVlad/fix-interp-appdomain
[interp] Interp fixes
2017-10-20 20:03:02 +03:00
Alexis Christoforides f5ee4a398c Add MacSDK test script 2017-10-20 09:22:31 -07:00
Zoltan Varga dc732f0166 [jit] Fix #59182 for the coop case as well. (#5824) 2017-10-20 09:54:02 -04:00
Vlad Brezae e9899e4bb1 [interp] Enable appdomain tests 2017-10-20 16:53:48 +03:00
Vlad Brezae 70cff6b6b0 [interp] Rethrow abort exceptions at end of catch 2017-10-20 16:51:54 +03:00
Vlad Brezae 043ee9f13d [interp] Interruption checkpoint during branches
This makes aborts work when interp is stuck in a loop.
2017-10-20 11:12:46 +02:00
Vlad Brezae 7483082d9a [interp] Handle remoting calls in delegates 2017-10-20 11:12:45 +02:00
Vlad Brezae ea73165ca8 [interp] Add lmf when doing icalls
So we can unwind when exceptions are directly thrown from unmanaged.
2017-10-20 11:12:45 +02:00
Vlad Brezae ee98142c15 [interp] Don't generate remoting wrapper for normal calls
Remoting calls should be virtual only.
2017-10-20 11:04:39 +02:00
Vlad Brezae 111a6ed2ff [interp] Fix tls jit pointer fetch 2017-10-20 11:04:39 +02:00
Katelyn Gadd 44b21bca28 Fix bug #58400 - incorrect implementation of LocalPath for file URLs (#5779) 2017-10-20 10:53:25 +02:00
Bernhard Urban c26e069703 [interp] remove setjmp/longjmp unwinding machinery 2017-10-20 10:52:25 +02:00
Bernhard Urban 5e6893ad48 [interp] remove unused ves_exec_method 2017-10-20 10:52:25 +02:00
Vlad Brezae 15bb34e6d6 Merge pull request #5785 from BrzVlad/fix-59153
[mini] Don't attempt to compile method of open generic class
2017-10-20 10:53:40 +03:00
Ludovic Henry 30b5ea7cd9 [MonoError] Add goto_if_nok to reduce duplicated code (#5834) 2017-10-19 21:52:58 -04:00
Alexander Köplinger f5aca1da30 [tests.make] Filter out comments from test.dll.sources for TEST_FILES
This broke "make dist" after 61559965a1
because comments were added to System.Data_test.dll.sources
and they weren't stripped when TEST_FILES was computed so it tried
to include them in the tarball as files.
2017-10-20 01:32:26 +02:00
Bernhard Urban a8dab358d9 [interp] do not attempt to transform method of open generic class 2017-10-19 21:02:06 +03:00
Ludovic Henry 1df82c2d51 [threads] Also abort background threads on shutdown
We count on the fact no threads are created or switched to foreground between the time we waited for all foreground threads to exit and the time we abort all running threads (except for the finalizer and DONT_MANAGED threads). This is racy and we should suspend all threads, them being foreground or background.
2017-10-19 13:40:49 -04:00
Ludovic Henry 0b40428d59 [threads] Let mono_thread_detach_internal remove thread from threads
Removing the thread from the `threads` array in `remove_and_abort_threads` goes against the lifetime expectation that a thread is removed from `threads` when it is being detached. This 2 ways of having the thread removed complicates the lifetime management and expectations of the thread.
2017-10-19 13:34:31 -04:00
Alexis Christoforides 1538798867 Merge pull request #5778 from alexischr/bug-56003
[System.URI] Don't reset host string processing on Unicode paths. Fix…
2017-10-19 09:46:13 -07:00
Egor Bogatov 61559965a1 [System.Data] move to corefx (#4893)
* [System.Data] move to corefx

* [System.Data] Missing API: SqlTypesSchemaImporters

* [System.Data] Missing API: SqlNotification*

* [System.Data] Missing API: SqlDataSourceEnumerator

* [System.Data] Missing API: SQLDebugging

* [System.Data] fix build

* [System.Data] remove public API from different assemblies

* Apply corefx changes

* Hide some PropertiesTest (missing API in corefx)

* Missing API: TypedDataSetGenerator*, etc

* Missing API: SqlClientMetaDataCollectionNames

* Missing API: SqlCredential

* SqlMetaDataFactory.cs is actually sqlmetadatafactory.cs (case sensitive)

* Missing API: PoolBlockingPeriod

* Fix case-sensitive issues

* Odbc support (requires changes in corefx)

* ODBC support

* Re-enable ODBC ProviderTests

* Apply corefx changes

* temp commit: fix build

* Missing API: Microsoft.SqlServer.Server.*

* Missing API: DBDataPermission, OdbcPermission, SqlClientPermission

* Missing API: DbProviderFactoriesConfigurationHandler, DbProviderConfigurationHandler, DbProviderFactory.CreatePermission

* Missing API: DbProviderFactories

* Missing API: SqlCommand BeginXXX methods, SqlException.Message, OdbcFactory.CreatePermission

* Add System.Data.SqlClient.SqlMetaData.xml (embedded resource)

* reorganize *.sources files for win32, macos and linux

* bump corefx

* [System.Data] API: SqlDataSourceEnumerator, SqlClientFactory, SqlParameter, SqlMetaData

* [System.Data] cleanup

* [System.Data] mobile profile, cleanup

* [System.Data] Fix few odbc tests (changes are in corefx PR)

* [System.Data] fix Open_ConnectionString_DatabaseInvalid test

* [System.Data] enable all tests

* Add AsynchronousProcessing and ConnectionReset to SqlConnectionStringBuilder

* [System.Data] fix build

* fix all ProvierTests

* fix tests (files several issues against the corefx)

* system-data code cleanup

* system-data code cleanup

* add SqlTypesSchemaImporters

* remove corefx/RuntimeInformation.cs, add OleDbPermission stub

* OleDbPermission should be serializable (fixing tests)

* remove ODBC from mobile profile

* fix linux build - add 619 (obsolete) to nowarn list.

* temp commit

* fix a few api diff issues

* add OleDbType type (currently exists even in mobile profiles)

* add stubs

* Add stubs for OleDb

* improve oledb stubs

* improve oledb stubs

* improve oledb stubs

* more oledb stubs

* add xunit tests from corefx

* Add SqlClient corefx tests

* use corefx sources for System.Data.DataSetExtensions

* Remove [InternalsVisibleTo ("System.Data.DataSetExtensions")] from System.Data

* [System.Data] sync with external/corefx

* fix linux\macOS builds

* Fix xunit tests

* System.Data/Makefile cleanup

* tabify System.Data

* Rollback changes in System.Web & SqlSharpCli

* small cleanup

* [System.Data] Remove redundant .sources files

* [System.Data] update odbc Res.cs

* [System.Data] Remove redundant .sources files

* fix System.Data.dll.sources (add a blank line)

* remove TypeForwarder for DBNull and register xunit tests for System.Data

* Bump API snapshot submodule
2017-10-19 18:20:03 +02:00
Jonathan Chambers ce596ec25c Save and resume full 128-bits of xmm argument registers in trampoline. Add definition of MonoContextSimdReg on amd64 for Windows platform and use for size/offset calculations. 2017-10-19 12:10:07 -04:00
monojenkins c50b4ef9c7 [msvc] Update csproj files (#5832) 2017-10-19 17:49:07 +02:00
Rodrigo Kumpera 5a7d6e3d9a Fix spiller when the dest membase optimization intereferes with lvreg caching. Fixes #20562 (#5747)
* [mini] Fix spiller when the dest membase optimization intereferes with lvreg caching. Fixes #20562

Given this IR sequence:
	int_add R18 <- R18 R18
	move R37 <- R18

The spiller would use the dest membase optimization and change the `add` to `add_membase_reg` and assume that the value in R18 would still be valid afterwards. This was the case cuz the code handling sreg2 won't check whether R18 would be mutated but not kept in a register.

The fix is to disable lvreg caching if the dest membase optimization is used. It forces later uses to reload from memory, which is not great, but it's correct.

* [mini] Add regression test for #20562 and re-enable ratests.cs.
2017-10-19 11:24:41 -04:00
Johan Lorensson 0f9bbb90fb [runtime] Rename atomic functions from the win32 style naming to mono_atomic_<op>_<type>, with a consistent signature on all platforms, including Windows implementation. (#5767)
* [runtime] Rename atomic functions from the win32 style naming to mono_atomic_<op>_<type>, with a consistent signature on all platforms. This fixes a large number of warnings on windows.

* Add Windows implementaiton of mono_atomic_*.

* Windows implementation of mono_atomic_* inline functions.
* Changed naming typo in mono_atomic_xchg_i32Add and mono_atomic_xchg_i32Add64.
* Fixed some additional signed/unsigned/volatile warnings when using mono_atomic_*
* Fixed some smaller additionl warnings.

* Fix Interlocked* to mono_atomic_* name change in signal.c

* Additional name adjustment of atomics.

Aligning more towards C11/C++11 standard namings:

mono_atomic_xchg_add_i32|i64 -> mono_atomic_fetch_add_i32|i64

Changed from mono_atomic_add to mono_atomic_fetch_add in cases when return
type is not used.

Also includes small mingw build fix on Windows.

* Aligned loads with C++11 implementation using explicit compiler barrier.

On x86/x64 Windows, reading a properly aligned 8,16,32 bit volatile variable
(using /volatile:ms extension) should have acquire semantics. On x64
this also includes 64-bit properly aligned volatile variables.

The C++11 implementation does however include an explicit _ReadWriteBarrier in
its sequentially consistent implementation to instruct compiler to not reorder
load/stores. Since compiler supports two modes of volatile behavior (ms/iso)
this additional barrier is probably there for consistency, independent of the
behavior of volatile keyword.

NOTE, the x86/x64 CPU architecture has strong guarantees regarding load/store of
memory operations, so issuing a CPU memory barrier for loads should not be needed
(and is not done in C++11 atomics implementation).

This commit also adds a couple of optimizations for 32-bit loads and for x64,
64-bits loads. The C++11 implementation uses the same pattern loading them as 8
and 16 bits variables, so no need for Interlocked* calls to load 32-bit and for x64
64-bit variables.
2017-10-19 10:43:03 -04:00
Alexander Köplinger 1e29ed0d7e [System.Core] Remove duplicated test classes (#5829)
These tests classes are already included in the corlib test assembly.
Having them duplicated in System.Core causes issues in XA because
both test assemblies are in the same process.

To solve this we introduce abstract *TestBase classes that we can
share between the test assemblies and only mark the concrete test
class implementations with [TestFixture]
2017-10-19 16:34:35 +02:00
Egor Bogatov 8af88bd0e6 Update root gitignore (#5831)
".idea" - folder generated by jetBrains Rider IDE (it's possible to open, compile and debug net_4_x.sln solution in it)
2017-10-19 16:18:46 +02:00
Zoltan Varga ceec5e9786 [coverage] Fix the printing of nested generic instances. Fixes #60224. 2017-10-19 15:45:59 +02:00
Marek Safar 9cce09b0a2 [runtime] Workaround for verifier bug #59967 2017-10-19 15:30:07 +02:00
Marek Safar c763b4a250 Bump Roslyn 2017-10-19 15:30:07 +02:00
Alexander Köplinger 6caf00b09c [bcl] Remove AssertExtensions helper classes (#5828)
* [bcl] Remove AssertExtensions helper classes

Since we're on nunitlite now we can use the proper `Assert.Throws<>()`
instead and remove the helper class (which we actually duplicated!)
2017-10-19 12:38:33 +02:00
EgorBo cfedbd7aa2 replace min with MIN 2017-10-19 10:54:03 +02:00
EgorBo eb5fa1fced fix code-style issues 2017-10-19 10:54:03 +02:00
EgorBo bbb109bd03 limit max possible threads in ThreadPool (SetMaxThreads). Fixes bug-60027 2017-10-19 10:54:03 +02:00
Marek Safar dbb0872f49 [corlib] Adds ValueTuple tests 2017-10-19 10:04:37 +02:00
Alexis Christoforides 0ccfa87a91 [System.URI] Don't reset host string processing on Unicode paths. Fixes #56003
This may not be the final fix; the Mono-only workaround was introduced in b5dc9a4951 to fix a crash with Unicode paths in TryCreate. However the test case for that issue now succeeds without the workaround.
2017-10-18 16:33:56 -07:00
Vlad Brezae df37bb7a7c [mini] Don't attempt to compile method of open generic class
It requires creating a vtable for the class, which is not supported.
2017-10-19 00:16:16 +03:00
Bernhard Urban 0b60a62ee7 [interp] use POP_VT macro 2017-10-18 21:23:42 +02:00
Bernhard Urban 6684e29f7a [interp] check stack_type in cee_ldobj
fixes test-580.cs
2017-10-18 21:23:42 +02:00
Bernhard Urban 7777d78b16 [System.Net] Tweak tests for watchOS 2017-10-18 19:59:55 +02:00
Zoltan Varga 71997d296f [llvm] Fix the returning of vtypes using a hidden argument in bitcode, in some cases, we forgot to generate the code to return the value, causing random data to be returned. Fixes #59956. (#5786) 2017-10-18 13:29:02 -04:00
monojenkins 17d86bd264 [msvc] Update csproj files (#5823) 2017-10-18 18:52:00 +02:00
Zoltan Varga 5440d5718b [runtime] Avoid an assertion in mono_profiler_get_coverage_data () if the method doesn't have a body. (#5777) 2017-10-18 09:27:40 -04:00
Zoltan Varga e7736ca5cc [ppdb] Add a log message when an assembly has no ppdb debug directory. (#5795) 2017-10-18 09:04:04 -04:00
Marek Safar 1d0e803fbb [runtime] Don't crash when method/assembly with no code coverage does not have debug symbols 2017-10-18 14:26:51 +02:00
Aleksey Kliger (λgeek) 3d00ea31a7 [sre] Register a canonical reflected method for a methodspec token. (Fixes #60233) (#5813)
* [test] ILGenerator test for duplicate methodspec tokens

Regression test for [Bugzilla #60233](https://bugzilla.xamarin.com/show_bug.cgi?id=60233)

* [sre] mono_dynamic_image_register_token: Change asserts to warnings

This partly relaxes the changes in 792b5367cd
which added the assertions.

In practice the assertions introduced a crash in heavy uses of
System.Reflection.Emit such as unit testing frameworks and dynamic languages.
We still want to know if there are surprising uses of
mono_dynamic_image_register_token, but we don't need a crash.  SRE used to work
before 792b5367cd, so no need to break it.

* [sre] Register a canonical reflected method for a methodspec token (Fixes #60233)

This is like the fix for [bugzilla
59364](https://bugzilla.xamarin.com/show_bug.cgi?id=59364) but this time it's a
methodspec token, not a memberref token.
2017-10-18 08:11:51 -04:00
Marek Safar 4bd3aa2158 [bcl] Update PlatformDetection helpers 2017-10-18 13:07:47 +02:00
Marek Safar e87cc4822c Bump xunit dependency 2017-10-18 09:01:18 +02:00
Bernhard Urban 618ef61ae9 [eglib] check if result is set
quote from the darwin man page:

> The functions getpwnam_r(), getpwuid_r(), and getpwuuid_r()
> return 0 if no error occurred, or an error number to indicate
> failure.  It is not an error if a matching entry is not found.
> (Thus, if result is NULL and the return value is 0, no
> matching entry exists.)
2017-10-18 08:55:52 +02:00
Alexander Köplinger 464c5916d5 [bcl] Fix test assembly build for monodroid profile (#5808)
* [System.IdentityModel] Add excludes for tests that don't compile on monodroid profile

Also add a new test for X509CertificateValidator so the assembly
isn't empty on monodroid.

* [System.ServiceModel] Add excludes for tests that don't compile on monodroid profile

* [System.Security] Add excludes for tests that don't compile on monodroid profile

Also reduce duplication between common.sources and System.Security.dll.sources

* [System.Web.Services] Add excludes for tests that don't compile on monodroid profile

* [System.ComponentModel.DataAnnotations] Make tests compile on monodroid profile
2017-10-18 02:20:07 +02:00
Vlad Brezae afb822af07 Merge pull request #5803 from BrzVlad/fix-small-warning
[sgen] Fix warning
2017-10-18 00:51:49 +03:00
Alexander Köplinger bdababe715 [bcl] Add dependency on .exclude.sources to test assembly (#5804)
Otherwise the assembly won't get rebuilt when you modify .exclude.sources
which can be quite confusing.
2017-10-17 22:06:53 +02:00
Bernhard Urban 9c2a4ff286 [mini regressions] enable aot-tests.cs & gshared.cs on more configurations (#5791)
* [mini regressions] enable aot-tests.cs also on non-fullaot

* [interp] handle Nullable in cee_unbox

* [interp] fix cee_ldobj when top of stack is a value type

fixes test_0_dyncall_nullable

* [mini] require aot-tests regression tests to run only with OPT_INTRINS
2017-10-17 15:47:32 -04:00
Bernhard Urban 2a294c432e [interp] do not run mcs/tests on ARM on CI
an issue [1] is blocking it on that architecture.

https://github.com/mono/mono/pull/5806
2017-10-17 21:26:41 +02:00
Bernhard Urban 87694b9ed0 [mcs/tests] make test harness output more verbose on V=1 2017-10-17 21:26:41 +02:00
Bernhard Urban d12dda34e4 [mcs/tests] add interp target 2017-10-17 21:26:41 +02:00
Bernhard Urban f2bab1910d [linker] update referenced source files 2017-10-17 19:04:42 +02:00
Bernhard Urban 8e3867013a Bump linker 2017-10-17 19:04:42 +02:00
monojenkins 9ff18d1dca [msvc] Update csproj files (#5805) 2017-10-17 18:22:28 +02:00
Bernhard Urban 2d63c93d06 [interp] use correct code base pointer and set native_offset
frame->ip points into generated code MINT bytecode, while hd->code
points into the original CIL code buffer.

il_offset is calculated by exception handling:
https://github.com/mono/mono/blob/8593149b0be0f58a98d798b42aef10c58cdc8069/mono/mini/mini-exceptions.c#L1150
2017-10-17 17:43:55 +02:00
Bernhard Urban acb5f68e3e [interp] avoid leaking MonoMethodHeader data structure by freeing or avoiding it 2017-10-17 17:43:55 +02:00
Bernhard Urban d055f9e21f [interp] fix minor leaks around wrappers 2017-10-17 17:43:55 +02:00
Marek Habersack d9922895d4 [monodroid] Enable a number of tests (#5799)
Just over a year ago Xamarin.Android switched to running BCL tests straight
from the Mono sources but at the time we decided we didn't want to enable
a number of "new" tests (in the sense - never previously ran on XA) to avoid
introducing new failures in time which required focusing on more important
goals.

Currently, Xamarin.Android no longer uses Mono **sources** to build its tests
but, rather, it uses test **assemblies** built by Mono. This commit restores
the previously excluded tests in preparation for full BCL test coverage in
the near future.
2017-10-17 14:47:53 +02:00
Vlad Brezae d8d4307293 [sgen] Fix warning 2017-10-17 15:44:42 +03:00
Alexander Köplinger c399c787c8 [I18N] Add more encoding tests
There was very little test coverage of the I18N encodings before.

This adds a bunch of tests based on Latin1EncodingTest.cs since
latin1 is quite similar to these encodings.

A few of the added tests fail in some encodings due to what looks
like bugs in the implementation, disabled those temporarily, see FIXME's.
(filed https://bugzilla.xamarin.com/show_bug.cgi?id=60216 for tracking)
2017-10-17 14:12:24 +02:00
Alexander Köplinger 25ad948e02 [corlib] Add corefx System.Text.Encoding tests
This adds about 9800 Encoding related tests from corefx, all passing
after the latest fixes.
2017-10-17 14:12:24 +02:00
Alexander Köplinger 83af047720 [corlib] Add tests for EncoderFallback
Also remove some debug spew.
2017-10-17 14:12:24 +02:00
Alexander Köplinger e8ad2487f3 [corlib] Use Latin1Encoding from referencesource
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53296
2017-10-17 14:12:24 +02:00
Alexander Köplinger 4c4d3dcdc5 [I18N] Remove commented code from ucm2cp.c
This is just confusing in the final output.
2017-10-17 14:12:24 +02:00
Alexander Köplinger 73eed5d415 [I18N] Fix wrong charIndex in encoder fallback
We need to modify charIndex/charCount _after_ we called
the fallback encoder otherwise it'll get the wrong index.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=45893
2017-10-17 14:12:24 +02:00
Marek Safar 8593149b0b [build] Add code coverage mode (#5789) 2017-10-17 12:22:55 +02:00
Alexander Köplinger 606f40e708 [corlib] Fix SRE.SaveTest error during teardown on Windows
When I added temp dir handling to SaveTest in https://github.com/mono/mono/pull/5727
I copied the Setup/TearDown from TypeBuilderTest.

However that class doesn't actually save+load the assemblies so
it doesn't run into the issue on Windows where assemblies can't
be deleted because they're still loaded in the AppDomain.

To fix this follow CustomAttributeBuilderTest and ModuleBuilderTest,
i.e. just catch all Exception's in teardown...
2017-10-17 09:24:48 +02:00
Alexis Christoforides 66f11a1699 Merge pull request #5715 from BrzVlad/fix-alpine-context
[amd64] Get xmm registers only when on glibc
2017-10-17 03:00:02 -04:00
Vlad Brezae dd1a39dbc6 [amd64] Get xmm registers only when on glibc
Other libc's like on alpine, have different ucontext_t format.
2017-10-17 02:19:01 +03:00
Alexander Köplinger c89a3e55b7 [Mono.Posix] Use TestHelper code from monodroid repo (#5793)
We need this because XA is now starting to use the test assemblies
we build in the Mono repo instead of using the .cs source directly
and this would conflict.
2017-10-17 00:07:35 +02:00
Vlad Brezae a1cc4dfedb Merge pull request #5788 from BrzVlad/fix-handle-track-sp
[coop handles] Fix handle track_sp
2017-10-17 00:33:16 +03:00
Alexis Christoforides 23d2615f3d Merge pull request #5782 from YuriyGS/bug60115
[System.Windows.Forms]  In MonthCalendar added validation on acceptable date interval. Fixes #60115
2017-10-16 11:03:00 -04:00
Johan Lorensson 3a8e4fcfd4 Merge pull request #5781 from lateralusX/lateralusX/fix-thread-suspend-windows
[Windows] Fix random failures in sgen stress tests on Windows due to mono_thread_is_gc_unsafe_mode assert.
2017-10-16 08:43:57 +02:00
Vlad Brezae d4b2024871 [coop handles] Add comment to prevent hard to debug bugs 2017-10-15 01:20:37 +03:00
Vlad Brezae 69b9f11b6f [coop handles] Fix monotonic handle check race with stw in mono_handle_new 2017-10-15 01:20:28 +03:00
Vlad Brezae 1f1edce576 [coop handles] Add log entry about successor handle 2017-10-15 01:20:20 +03:00
Vlad Brezae dc2d1c291f [coop handles] Fix monotonic check
Stack grows downwards so we expect handle->alloc_sp to be smaller than previously allocated handles.
2017-10-15 01:20:08 +03:00
Alex Rønne Petersen 23d2ee726d Merge pull request #5753 from alexrp/wsl-fixes
[runtime] Some WSL fixes.
2017-10-13 19:54:44 +02:00
YuriyGS 1dcaf8fddc Added validation on acceptable date interval when update SelectionRange property. Fixed loss of focus when the user presses the arrow buttons and shift. 2017-10-13 17:22:46 +03:00
Bernhard Urban efdf035cfb [arm64] use DMB ISH barrier instead of undefined barrier option
ARMv8 ARM [cf. C6.2.65] says:

> All other encodings of CRm that are not listed above are reserved, and can
> be encoded using the # syntax. It is IMPLEMENTATION DEFINED whether options
> other than SY are implemented. All unsupported and reserved options must
> execute as a full system barrier operation, but software must not rely on
> this behavior

That means, before we would rely that chip implementations fall back to
SY, which is explicitly stated that software must not rely on. Also, ISH
is enough, as a "inner shareability domain" contains all PEs controlled
by a single hypervisor or operating system. That is what GCC, linux
kernel and so forth do as well.
2017-10-13 16:09:30 +02:00
Bernhard Urban 8dead2a644 [arm64] update definitions for barrier option of DMB
according to C6.2.65 of ARMv8 ARM (Printed on: September 25, 2017)
2017-10-13 16:09:30 +02:00
Alex Rønne Petersen 959eb46e17 [mono-context] Work around a WSL bug when fetching XMM registers.
Some broken versions of WSL don't set the mcontext_t::fregs field to a valid
pointer. We work around this by checking if the pointer is NULL, and if so,
not making the fpstate available. This is not ideal as we won't scan XMM
registers on these broken WSL versions, but accessing the
ucontext_t::__fpregs_mem layout is more complicated than it seems, so this
workaround will have to do.
2017-10-13 14:45:23 +02:00
Marek Safar d73e8be1de [mcs] Fixes parsing tuple name inside generic type in method header block 2017-10-13 12:48:16 +02:00
lateralusX f53ce8e180 Fix random failures in sgen stress tests on Windows due to `mono_thread_is_gc_unsafe_mode assert.
Random failures in Jenkins tests, more frequent in sgen stress test due to the following assert:

Assertion at ..\mono\mini\mini-trampolines.c:842, condition `mono_thread_is_gc_unsafe_mode ()' not met

When investigating this a little deeper revealed a race when switching thread states from ASYNC_SUSPENDED
to RUNNING. The assert would fire on a running thread due to having a ASYNC_SUSPENDED state, but when thread
state was inspected in debugger it was showing correct RUNNING state.

Looking through the code indicated that this should not be possible, since caller would suspend thread before
setting ASYNC_SUSPENDED using atomic ops and set back to RUNNING before thread was resumed using atomic ops.

So based on this the only way to get wrong state and fire assert would be if the thread was not immediately
suspended when Win32 SuspendThread API returned, and read the ASYNC_SUSPEND value before really suspended by
the kernel. Nothing in the API documentation indicates that the SuspendThread actually behaves this way, but
current implementation assumes that SuspendThread actually suspends the thread and only return when no more
user mode code is executed by the thread.

Turns out that this is not 100% accurate and SuspendThread is just a suspend request to the scheduler, so when
SuspendThread call returns the “suspended” thread might still execute user mode code and that breaks the assumption
in current implementation opening up for the observed race condition triggering the assert. This behavior of SuspendThread
has been described in this article, https://blogs.msdn.microsoft.com/oldnewthing/20150205-00/?p=44743/.

The fix is to make sure thread is really suspended before continue executing. The way to do so is by requesting the threads
context right away after SuspendThread call returns. This will force the kernel to wait until thread has really been suspended
since it need to return back a valid context record to the caller.

Fix also includes a smaller optimization. Since we retrieved the context later in the execution of mono_threads_suspend_begin_async_suspend,
the fix opens the possibility to pass a sigctx to thread_state_init_from_handle and then the implementation of thread_state_init_from_handle
could use passed sigctx in its work instead of request it again (if passed in). Since we need to get the context early on Windows, we could
reuse that, passing it into thread_state_init_from_handle aving us from several unnecessary kernel mode context switches otherwise needed
to open thread and get thread context. NOTE, this optimization is only used on Windows and other platforms will use default behavior.
2017-10-13 12:39:44 +02:00
Alexander Köplinger 8eb2c02d7e [acceptance-tests] Reenable ms-test-suite test after Mono bug was fixed (#5776)
Fix went in with https://github.com/mono/mono/pull/5751
2017-10-12 22:10:35 +02:00
Vincent Povirk 1c4d741a02 [corlib/Test] Check for "Israel Standard Time" zone on Windows. 2017-10-12 11:29:31 +02:00
Vincent Povirk ce19b84529 [corlib] Remove a broad try/catch.
This was hiding a bug reading registry info for some timezones.
2017-10-12 11:29:31 +02:00
Vincent Povirk b86c084cbc [corlib] Use full years for transition rule start/end ranges.
This fixes creation of TimeZoneInfo for some time zones on Wine (such
as Israel Standard Time) and probably also Windows.
2017-10-12 11:29:31 +02:00
EgorBo 6d4821b282 fix formatting issues 2017-10-12 10:33:07 +02:00
EgorBo 55fb7bcda1 fix bug-60031 Thread doesn't throw ThreadStateException when it should 2017-10-12 10:33:07 +02:00
Alexander Köplinger 308ce3f5c3 [tests] Remove test from runtime-invoke.cs
It was added in a54603a604
but fails on ARM FullAOT at the moment:
https://jenkins.mono-project.com/job/test-mono-mainline-fullaot/label=debian-8-armhf/461/testReport/MonoTests/runtime/runtime_invoke_exe/

According to Zoltan the test doesn't run on all platforms yet
so we should just revert it.
2017-10-12 08:53:37 +02:00
Ludovic Henry 7a452797f1 [tests] Re-enable appdomain-thread-abort.exe (#5736)
* [tests] Re-enable appdomain-thread-abort.exe

* [tests] Refactor appdomain-thread-abort.exe
2017-10-11 22:09:02 -04:00
Ludovic Henry db8183c9d8 [debugger] Fix LineNumbers test (#5744) 2017-10-11 22:07:47 -04:00
Alexander Köplinger 43757d67ef [msvc] Fix MONO_CORLIB_VERSION to match configure.ac (#5770)
When I simplified MONO_CORLIB_VERSION to only include major.minor
instead of major.minor.build in https://github.com/mono/mono/pull/5449
I forgot to apply the same change to the msvc copy of that logic.
2017-10-12 02:33:58 +02:00
Alexis Christoforides 81f7d591d7 Merge pull request #5741 from alexischr/bug-60028
[corlib] Throw exception on using disposed Timer object. Fixes #60028
2017-10-11 15:55:39 -04:00
Bernhard Urban 663754bf46 [mini helpers] fix disassembly on aarch64
the disassembler inserts metadata to show everything as data.
2017-10-11 21:24:03 +02:00
Marek Safar 4fe87bd820 [corlib] Adds more tests 2017-10-11 20:57:37 +02:00
Stephen C. Wills 03474ba9e2 Fixed unhandled exceptions in EndPointListener.cs (#5724)
Application hosting self-hosted website over https crashes when attempting to access a webpage over http. The patch described in the bug report below resolves the crash, and the commit in this pull request implements the fix.

https://bugzilla.xamarin.com/show_bug.cgi?id=52675
2017-10-11 19:36:37 +02:00
Rodrigo Kumpera abd4a6a57b Merge pull request #5746 from kumpera/fix_56194
[runtime] Ensure the field type is resolved before using it in RuntimeHelpers::InitializeArray. Fixes #56194
2017-10-11 09:53:11 -07:00
Bernhard Urban 286aa03847 [interp] remove wrong checks, as cee_mkrefany and cee_refanyval only take one argument on the stack
if the stack is only of height one at this point, the access is out of
bounds as well.
2017-10-11 14:01:11 +02:00
Bernhard Urban d8bd874fe4 [interp] assume `this' always to be platform pointer size
this query is wrong for builtin value types such as float.

fixes gtest-etree-01.exe
2017-10-11 14:01:11 +02:00
Bernhard Urban 49b29bfce8 [interp] flag mint_box instruction if value type stack should be popped too
in some scenarios the reference could be loaded via some unsafe
constructs (i.e., it doesn't live on `vt_sp`), so we have to
distinguish that use case, otherwise we could underflow `vt_sp`.

fixes test-301.cs and test-305.cs
2017-10-11 14:01:11 +02:00
Bernhard Urban 1f580e17b8 [interp] bail out on __arglist and propagate MonoError properly in transformer
thus, we do not assert at least on test-269.exe
2017-10-11 14:01:11 +02:00
Bernhard Urban 3468d54fbb [interp] set stack type properly for ldelem_vt
fixes gtest-112.cs
2017-10-11 14:01:11 +02:00
Bernhard Urban b05f478376 [interp] add i1, i2 & r8 support for CEE_STELEM
fixes test-async-11.exe
2017-10-11 14:01:11 +02:00
Bernhard Urban 34592c5233 [interp] resolve generic types properly in mint_box, mint_ldobj and mint_cpobj
fixes crash in gtest-065.cs and gtest-072.cs
2017-10-11 14:01:11 +02:00
Bernhard Urban 6c60d2fce0 [interp] pass field instead of pre-calculated size for ld*fld.vt 2017-10-11 14:01:11 +02:00
Bernhard Urban 373ebd547d [tramps] add missing fp reg and check for the future 2017-10-11 13:59:58 +02:00
Bernhard Urban fa92fa86c2 [interp] fix offsets in switch insn dump (only affects debug output) 2017-10-11 13:59:58 +02:00
Bernhard Urban 3a8cb50b07 [interp] fix compiler warning
> interp/interp.c: In function ‘ves_exec_method_with_context’:
> interp/interp.c:4553:4: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
>     MonoDomain *tls_domain = (MonoDomain *) ((gpointer (*)()) mono_tls_get_tls_getter (TLS_KEY_DOMAIN, FALSE)) ();
2017-10-11 13:59:58 +02:00
Bernhard Urban ed10891d9b [interp] replace printf with g_print 2017-10-11 13:59:58 +02:00
Bernhard Urban d071235ffa [lldb] update expression in script 2017-10-11 13:59:58 +02:00
Johan Lorensson 16a67c6f6e Merge pull request #5689 from lateralusX/lateralusX/windows-native-unwind-codeview-support
[Windows] Windows x64 full AOT native unwind info support.
2017-10-11 13:04:07 +02:00
Zoltan Varga e47b1865c2 [runtime] Allow throwing pending exceptions from protected wrappers. 2017-10-11 12:32:41 +02:00
Zoltan Varga 0ae4504681 [runtime] Remove a mono_error_raise_exception () call from mono_remoting_wrapper (), its not needed since mono_remoting_wrapper () is called through a wrapper. 2017-10-11 12:32:41 +02:00
Zoltan Varga 12ca539f85 [jit] Call mono_llvm_raise_exception () directly from a bitcode jit icall. (#5752) 2017-10-11 09:57:16 +02:00
Bernhard Urban 42816aaa92 [interp] fix offset calculation for exvar slots in locals
otherwise we off-by-one overflow and smash other things
2017-10-11 09:19:08 +02:00
Aleksey Kliger ad4ed79c9a [test] Add Type.GetType("", ...) tests 2017-10-11 08:57:50 +02:00
Aleksey Kliger 0c61eb1b12 [reflection] Throw TLE for Type.GetType("", true) (Fixes #59664)
In the C parser check for empty at the outset.
In the managed parser, copy an empty string component to the built-up TypeSpec
and handle it in the Type.GetType (..., asmResolver, typeResolver) implementation
2017-10-11 08:57:50 +02:00
Aleksey Kliger e004f1ed5e [reflection] Use MonoError for mono_reflection_parse_type_checked
Mark mono_reflection_parse_type as external only.  Runtime should use the
_checked version.
2017-10-11 08:57:50 +02:00
Rodrigo Kumpera 95ab8ab08f [runtime] Ensure the field type is resolved before using it in RuntimeHelpers::InitializeArray. Fixes #56194
Field types are now lazily resolved and this breaks the RuntimeHelpers::InitializeArray icall.

The solution is to use mono_field_get_type_checked to ensure the type is there.
2017-10-10 15:55:54 -07:00
Bernhard Urban 8f324cdfc2 [ASan] introduce MONO_NO_SANITIZE_ADDRESS macro and mark sgen pin object scanning function as such
ASan has very few false-positives, quoting the ASan documentation
(https://github.com/google/sanitizers/wiki/AddressSanitizer#turning-off-instrumentation):

> In some cases a particular function should be ignored (not instrumented)
> by AddressSanitizer:
>
>  [...]
>
> * Ignore a function that does some low-level magic (e.g. walking through
>   the thread's stack bypassing the frame boundaries).
>
>  [...]
2017-10-10 23:25:30 +02:00
Zoltan Varga 8cf8b32972 [runtime] Use mono_set_pending_exception () in ves_icall_System_Threading_Thread_Sleep_internal (). (#5748) 2017-10-10 21:44:34 +02:00
Zoltan Varga f02e158d3c [runtime] Remove unused mono_gc_out_of_memory () function. (#5750) 2017-10-10 17:25:30 +02:00
Marek Safar 4718035ee6 [mcs] Adds workaround for compiled enum types used as fields of other types. Fixes #59080 2017-10-10 17:08:38 +02:00
Bernhard Urban 1c9cf1f1c0 [interp] fix LMF popping during exception handling
Assume you have something like this:

```
$ cat invokecrasher.cs
using System;
using System.Reflection;

public class InvokeCrasher {
        readonly static object[] default_args = new object[1] { new string[] {} };
        public static void Main (string []args) {
                Assembly assembly = Assembly.LoadFile ("crasher.exe");
                try {
                        assembly.EntryPoint.Invoke (null, default_args);
                } catch {
                }

                assembly.EntryPoint.Invoke (null, default_args);
        }
}
```

```
$  cat crasher.cs
using System;

public class Crasher {
        unsafe public static void Main (string []args) {
                int i = 1337;
                CrashMe (&i);
                throw new Exception ();
        }

        unsafe static void CrashMe (int *p) {
                // p = (int *) 0;
                *p = 0;
        }
}
```

On the first `Invoke ()` the interpreter goes through `ves_pinvoke_method`:

```
      interp_push_lmf (&ext, frame);

      mono_interp_enter_icall_trampoline (addr, margs);

      interp_pop_lmf (&ext);
```

The LMF is needed for unwinding by mini. In this situation though,
`Crasher` throws an exception and goes through the exception handling machinery
of the interpreter which leads to missing out of the `interp_pop_lmf ()` call.

On the second `Invoke` we would therefore push the same address as an LMF
again, which leads to a LMF that points to itself as `previous_lmf`. If we
encounter a native crash in this state (as hinted with `p = (int *) 0; *p = 0;`),
the unwinding machinery would end up in an infinite loop.
2017-10-10 15:14:31 +02:00
Bernhard Urban 8e9c90b37e [interp] remove InterpMethod entry in hash table on free_method callback 2017-10-10 15:13:39 +02:00
Yuriy 428d0606ab [System.Windows.Forms] Proper operation order. Fixes #59393. (#5734) 2017-10-10 15:12:48 +02:00
Bernhard Urban 344a3ec4e1 [interp] use GC aware memcpy for storing value types to fields
value types can contain references, and therefore GC write barriers are
required.
2017-10-10 14:35:49 +02:00
Alexander Köplinger 75415afa76 [bcl] Fix csi to work on Mono (#5737)
It'd fail to find System.Runtime.dll and System.ValueTuple.dll.
Changed the csi.rsp to include those from the Facades/ dir and added a test.

Workaround for https://bugzilla.xamarin.com/show_bug.cgi?id=58965
2017-10-10 13:41:34 +02:00
monojenkins c4bee6af4d Merge pull request #5726 from alexrp/master
[profiler] Clean up the makefile and address some issues with it.

* Don't link the profilers to libmono, except on mobile.
* The coverage profiler doesn't use zlib. Don't link to it.
* Fix the LIBADD variable for the VTune profiler.
* Add some comments for certain non-obvious aspects.
* Some style cleanup.

Also introduce a HOST_IOS variable in the build system which covers iOS, watchOS, and tvOS.
2017-10-10 12:45:06 +02:00
Alex Rønne Petersen 8e9ae0cb07 [w32socket] Ignore errors for IP_MTU_DISCOVER on WSL.
WSL, being Linux, declares IP_MTU_DISCOVER in its headers, but does not
actually support it. This is fixed in newer (preview) builds of WSL, but add
this workaround so Mono will work on older (stable) WSL versions.
2017-10-10 08:01:52 +02:00
Alexis Christoforides 15c0640201 Merge pull request #5714 from alexischr/update_bockbuild
Update Bockbuild
2017-10-09 20:05:45 -04:00
Alexander Köplinger 4058c2be43 [utils] Add check for ANDROID_UNIFIED_HEADERS to mono-compiler.h (#5742)
https://github.com/mono/mono/pull/5680 added mmap/sendfile prototypes
but we should only use those when ANDROID_UNIFIED_HEADERS is defined
to avoid getting errors like:

```
/Users/alexander/dev/xamarin-android/external/mono/mono/utils/mono-compiler.h:157:7: error: conflicting types for 'mmap'
void* mmap (void*, size_t, int, int, int, __mono_off32_t);
        ^
/Users/alexander/android-toolchain/toolchains/arm-linux-androideabi-clang/bin/../sysroot/usr/include/sys/mman.h:47:15: note: previous declaration is here
extern void*  mmap(void *, size_t, int, int, int, off_t);
                ^

/Users/alexander/dev/xamarin-android/external/mono/mono/utils/mono-compiler.h:166:9: error: conflicting types for 'sendfile'
ssize_t sendfile (int out_fd, int in_fd, __mono_off32_t* offset, size_t count);
        ^
/Users/alexander/android-toolchain/toolchains/arm-linux-androideabi-clang/bin/../sysroot/usr/include/sys/sendfile.h:36:16: note: previous declaration is here
extern ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
```
2017-10-10 01:08:17 +02:00
monojenkins d2e60f48b6 [msvc] Update csproj files (#5745) 2017-10-09 21:40:39 +02:00
Alexander Köplinger c9fc371e31 [corlib] Use temp directory for assemblies in SaveTest.Save() (#5727)
It was writing to the current working directory before which
doesn't work on platforms where that directory is read-only.

Using the same setup/teardown methods as TypeBuilderTest we
instead create a directory in the temporary location and put
the files there.
2017-10-09 20:08:25 +02:00
Alexis Christoforides 64b4a63a87 [corlib] Throw exception on using disposed Timer object. Fixes #60028 2017-10-09 13:37:07 -04:00
Marek Safar 90a68e6591 [corlib] Fixes make dist (#5735) 2017-10-09 15:44:11 +02:00
lateralusX aef03761fa Updated with review feedback. 2017-10-09 08:55:34 +02:00
Alex Rønne Petersen 70abfb795a [profiler] Clean up the makefile and address some issues with it.
* Don't link the profilers to libmono, except on mobile.
* The coverage profiler doesn't use zlib. Don't link to it.
* Fix the LIBADD variable for the VTune profiler.
* Add some comments for certain non-obvious aspects.
* Some style cleanup.

Also introduce a HOST_IOS variable in the build system which covers iOS,
watchOS, and tvOS.
2017-10-08 06:56:55 +02:00
vkargov 56b3c007f4 [runtime] Don't insta-fail when a faulty COM type is encountered. (#5616)
* [jit] Don't insta-fail on faulty cominterop invocations.

* [runtime] New test for bug 8477.

* [jit] Implement mono_error_get_exception_name() and mono_mb_emit_exception_for_error()

* [jit] Throw an exception when a static method on a ComImport class is called.
2017-10-06 16:07:33 -04:00
Alexis Christoforides 9eed0cb99e Update Bockbuild 2017-10-06 13:34:46 -04:00
lateralusX e77153a623 Adding basic codeview support on Windows x64 full AOT builds.
Emit very basic codeview information into full AOT builds on Windows x64. The codeview information is far from complete and
is currently just initial work needed to get function symbol names to appear in native callstack that includes managed functions.
Described functions does not include parameters, local variables or line info at the moment, but could be extended in the future.

Fix also make sure linker will emit PDB files including information that can be picked up by debuggers. It is possible to disable
codeview info by passing "nodebug" to AOT compiler, this will also disable the generation of PDB files, if a DLL would have been build.
2017-10-06 17:16:18 +02:00
lateralusX 925c2dc632 Adding native unwind info support in Windows x64 full AOT builds.
Emit needed sections when building Windows x64 full AOT targeting Clang for MS codegen in order for linker to
include entries in process unwind tables for full AOT:ed managed functions and trampolines. Implementation also includes
a cache used to minimize the number of duplicated unwind data section in each object file, reducing final image size.
2017-10-06 17:16:17 +02:00
Marek Safar 72c86fe6cc [corlib] Makes GetReferencedAssemblies test more reliable 2017-10-06 16:09:00 +02:00
Marek Safar f0ce7bc289 Merge pull request #5327 from marek-safar/corefx-bump
Bump corefx
2017-10-06 12:07:58 +02:00
Alexander Kyte 410bb8a57e [runtime] Fix Empty generic enumerator equality
On the CLR, two enumerators containing zero elements will
have reference equality if they are inflated with the same
generic type.

If comparing two enumerators which are not inflated (Array.Empty, for
instance), they are not equal when they contain zero elements.

This reference equality behavior is not compatible with treating
the enumerators as structs, as value types will not have reference
equality.
2017-10-06 11:35:17 +02:00
monojenkins f165a0dc3f Bump API snapshot submodule 2017-10-06 06:45:43 +00:00
Rolf Bjarne Kvinge 74a87af7f5 [appletls] Trust SecTrustResult.Proceed as well. Fixes #58411.
Apple states clearly in their documentation about SecTrustResult.Proceed [1]:

    The user explicitly chose to trust a certificate in the chain (usually by
    clicking a button in a certificate trust panel).

    Your app should trust the chain.

This fixes bug #[58411][2], where SecTrustEvaluate returns
SecTrustResult.Proceed starting with iOS 11.

[1]: https://developer.apple.com/documentation/security/1394363-sectrustevaluate
[2]: https://bugzilla.xamarin.com/show_bug.cgi?id=58411
2017-10-05 23:43:34 +02:00
Aleksey Kliger (λgeek) a984f20e23 Initial set of Ward sgen annotations (#5705)
* [ward] Expand MONO_PERMIT to empty string when not running Ward
  See https://github.com/evincarofautumn/Ward#annotating-your-code for the Ward
  permissions syntax
* sgen_gc_locked
* sgen_world_stopped
* sgen_lock_gc
* sgen_stop_world
2017-10-05 17:31:11 -04:00
Marek Safar 411a37af27 Bump corefx 2017-10-05 22:43:54 +02:00
Marek Safar 3e9d7d6e9c [mcs] Fixes codegen for pattern probing with value-type variables 2017-10-05 22:42:07 +02:00
Zoltan Varga caa9ed689f [aot] Don't error out if a method fails to JIT in full-aot mode. This was a regression caused by 9302c31f81. Fixes #59832. (#5686) 2017-10-05 17:54:16 +02:00
Zoltan Varga baac94e4b7 [runtime] Coverage profiler fixes (#5698)
* [runtime] Avoid collecting coverage data for wrappers.

* [runtime] Return sensible information for methods which have no coverage info in mono_profiler_get_coverage_data ().

* [profiler] Emit coverage info for uncovered methods as well.
2017-10-05 17:15:36 +02:00
Marek Safar 44e0631618 [corlib] Fixes array enumerator to match .net behaviour 2017-10-05 16:51:56 +02:00
Zoltan Varga 012f861023 [jit] In native-to-managed wrappers, emit the initlocals code for vtypes after the code for CEE_JIT_ATTACH, since the init code can make calls to methods like memset () which can go through the trampoline code. Fixes #59182. (#5678) 2017-10-05 14:10:20 +02:00
Alexander Köplinger b2a11ac756 Add new profile for monodroid tools (#5699)
* Add new profile for monodroid tools

This allows the XA build to use these instead of needing to build net_4_x.
We build the assemblies against the .NET 4.6 reference assemblies.

* Skip monodroid_tools in verify (aka mcs-compileall)

Exclude it from the test_profiles since running tests makes no sense there.

Also refactor to exclude binary_reference_assemblies as well,
it was already excluded manually in mcs-compileall before.
2017-10-05 02:37:24 +02:00
Marek Habersack f77270c633 [monodroid] Fix Mono.Posix tests build (#5697)
TestHelper was previously excluded because the XA tests weren't built
as part of Mono but rather as part of XA test suite which included
its own version of the helper. Now, however (https://github.com/xamarin/xamarin-android/commit/e9daf5ea35709ce1bc6ba81c7c37d72d385bace2),
XA uses BCL+friends test assemblies built by Mono itself and so
we need to restore TestHelper in the build.
2017-10-04 19:18:32 +02:00
Marek Safar 135dbb9c6d [mcs] Allows shadowing of probing pattern variables 2017-10-04 14:49:36 +02:00
Alexander Köplinger b683b3dc74 [System] Ignore FtpWebRequestTest.DownloadFile2_v6 test when IPv6 isn't available (#5695)
It fails on some systems otherwise. The other tests already had this check.
2017-10-04 11:51:48 +02:00
Johan Lorensson dbf70d1083 Merge pull request #5693 from lateralusX/lateralusX/disable-stack-overflow-win-x64
[Windows] Temporary disable none-working stack overflow implementation on Windows x64 full AOT.
2017-10-04 10:21:02 +02:00
Zoltan Varga f0f4a22ae1 [coverage-profiler] Collect coverage data at IL seq point locations. (#5667)
* [coverage-profiler] Collect coverage data at IL seq point locations.

* [coverage-profiler] Emit IL offsets instead of offsets between IL offsets. Bump format version.
2017-10-04 08:34:31 +02:00
Johan Lorensson f86145e558 Merge pull request #5664 from lateralusX/lateralusX/mkbundle-windows-toolchains
[Windows] Major improvement of Visual Studio toolchain and Windows SDK support in mkbundle.
2017-10-04 08:22:29 +02:00
Ludovic Henry d7c22488d7 Bump version to 5.9.0 (#5692) 2017-10-03 22:52:32 +02:00
Marek Habersack ef7a4c0620 Prepare Mono for Android NDK with unified headers (#5680)
Up until NDK release 14 Android SDK included a separate set of C header
files for each supported platform. NDK 14 introduced a new set of those
headers (they are NOT the same as the old ones) which unifies support
for all of the platforms so that bug fixes are available for all the
API levels without having to backport etc. With NDK 15 the unified headers
become the default ones (including when creating standalone toolchains)
and with NDK 16 (in beta currently) the old per-platform headers are removed.

Unfortunately, the new headers introduce breaking changes which made it
impossible to build Mono with NDK configured to use them. This commit makes
a handful of changes to Mono which make it build with unified headers.
2017-10-03 20:17:26 +02:00
Marek Safar 4f673eac74 [System.Net.Http] Updates range check from 3741d16503 2017-10-03 18:32:59 +02:00
Vlad Brezae 66205238fc Merge pull request #5636 from BrzVlad/fix-xmm-scan
[sgen] Scan simd registers on linux amd64 + apple arm64
2017-10-03 18:51:20 +03:00
Marek Safar 1004d95b6b [mcs] Implements C# 7.2 readonly structs 2017-10-03 17:01:58 +02:00
lateralusX 4db06151be Disable none-working stack overflow implementation on Windows x64 full AOT.
Temporary disable stack overflow implementation on Windows x64 full AOT until
we have a proper fix for:

https://bugzilla.xamarin.com/show_bug.cgi?id=59913
2017-10-03 17:01:43 +02:00
Ludovic Henry 1bcf21e048 [w32file] Push win32 specific error to win32 specific implementation (#5665)
ERROR_SHARING_VIOLATION can only happen on win32, so pushing the code to deal with this error to w32file-win32.c file.
2017-10-03 10:38:09 -04:00
Marek Safar abcca89bd4 [mcs] Adds minor langversion support 2017-10-03 15:24:12 +02:00
Johan Lorensson 56247cecbd Merge pull request #5656 from lateralusX/lateralusX/dynamic-static-windows-build
[Windows] Mono build project restructure dropping .def file enabling full static and dynamic mono builds.
2017-10-03 14:20:14 +02:00
Bernhard Urban 3d47b20c62 [interp] fix using conv.u with string 2017-10-03 12:17:44 +02:00
Rodrigo Kumpera 3aeeae6230 [jit] Fix using conv.u with string. 2017-10-03 12:17:44 +02:00
Marek Safar adaf7fd65b [mcs] Allow properties and indexers of by-ref values to be set without setter 2017-10-03 11:23:18 +02:00
Zoltan Varga 9369ed6e23 [runtime] Store implmap_idx as a guint32 to avoid overflows if the implmap table has more than 64k rows. Fixes #59881. 2017-10-03 10:40:26 +02:00
lateralusX 199d4da9ac Merged changes in master libmonoruntime into PR. 2017-10-03 09:26:11 +02:00
lateralusX 216b92db17 Updated with review feedback. 2017-10-03 09:20:12 +02:00
lateralusX 0f3ca07b42 Update msvc README file. 2017-10-03 09:20:11 +02:00
lateralusX 8ae01a69f2 Add missing dependency for libmini. 2017-10-03 09:20:11 +02:00
lateralusX 4c144cfacf Align libgc vcxproj with makefile. 2017-10-03 09:20:11 +02:00
lateralusX 1091bd94fd Align libgcmonosgen vcxproj with makefile. 2017-10-03 09:20:11 +02:00
lateralusX 8d22c47199 Align eglib vcxproj with makefile. 2017-10-03 09:20:11 +02:00
lateralusX 975d820a75 Align libmonoruntime vcxproj with makefile. 2017-10-03 09:20:11 +02:00
lateralusX df03eb3fac Align libmonoutils vcxproj with makefile. 2017-10-03 09:20:11 +02:00
lateralusX 6cb544f91d Fix libmini targets and filters. 2017-10-03 09:20:11 +02:00
lateralusX 17392d380c Added labels to eglib and libmonoutils. 2017-10-03 09:20:10 +02:00
lateralusX 05a3f528f7 Fix libmonoruntime targets and filters. 2017-10-03 09:20:10 +02:00
lateralusX fde8978893 Fix libmonoutils targets and filters. 2017-10-03 09:20:10 +02:00
lateralusX 43e9ddc1fc Fix eglib targets and filters. 2017-10-03 09:20:10 +02:00
lateralusX 52418d713f Drop use of def files for x86, x64 mono-2.0-sgen|boehm.dll Windows build. 2017-10-03 09:20:10 +02:00
lateralusX 52e98abd6e Restructure of mono.sln and build properties to better fix static/dynamic library support. 2017-10-03 09:20:10 +02:00
lateralusX 92576e31d2 Merge all static runtime libs into libmono-static.
Make libmono-static lib file include all needed runtime libs making it easier to
link and distribute as part of Mono SDK.

Commit also updates linking of vcxprojs in mono.sln to use merged static lib.
2017-10-03 09:12:14 +02:00
lateralusX 233bbcaaa3 Review feedback + drop VS2013 support. 2017-10-03 08:56:07 +02:00
Rodrigo Kumpera 098e88f3a8 Merge pull request #5668 from kumpera/wasm-work-p4
More WASM fixes.
2017-10-02 16:36:39 -07:00
vkargov 02a9ceaebb [ci] Small improvements for run-jenkins and collect-coverage. (#5669)
* [ci] Allow setting custom mono flags for test runs via MONO_TEST_FLAGS.

* [ci] Make the handling of CFLAGS a bit more flexible in run-jenkins.sh.

* [ci] Generalize collect-coverage to handle more targets.
2017-10-03 00:16:39 +02:00
Alexander Kyte 4b2d74f1a1 [runtime] Remove overridable allocator flag 2017-10-02 16:11:29 -04:00
Alexis Christoforides edbc5c2334 Merge pull request #5675 from mono/glib-debug-symbols
Add glib to the list of packages with debugging symbols.
2017-10-02 13:46:14 -04:00
Alexander Köplinger 7751545573 Bump mono-extensions to fix build break (#5677)
The driver.c patch from mono-extensions no longer applied after https://github.com/mono/mono/commit/30cddad5fb4c3d290906a6e6c33ecd8b07d8b48c
2017-10-02 19:45:13 +02:00
Ankit Jain d8be089964 Bump NuGet.BuildTasks to get new updates and switch to dev branch (#5566) 2017-10-02 12:18:08 -04:00
Cody Russell f99b88b812 Add glib to the list of packages with debugging symbols. 2017-10-02 10:08:47 -05:00
Uri Simchoni bfc76bafbf [profiler] log profiler: limit method instrumentation to selected methods (#5517)
* [trace] remove code that has no effect

* [trace] move program assembly out of MonoTraceSpec

The assembly member represents the program assembly. It's
information the trace spec is matched against, not part of
the trace spec per-se (if two trace specs exist for two purposes
we would still have one program assembly)

* [trace] remove side effects from get_string()

On the way towards supporting multiple trace specs,
remove side effects from get_string() function.

* [trace] remove side effects from get_token()

Remove side effects from get_token() to allow handling
multiple trace specs.

* [trace] fix handling of double exclusion and disabled

When encountering "disabled", do not add an entry to
the trace spec

Fix error handling around double "-" - get_spec()
never returns TOKEN_EXCLUDE and the recursion can
be easily avoided.

* [trace] remove side effects from get_spec()

Another step in making the trace options reusable.

* [trace] rename mono_trace_parse_options() to mono_trace_set_options()

This routine actually sets the tracing options, not just parses an
option string, so set_ is more suitable. This frees up the
mono_trace_parse_options() name for pure parsing, when we later
reuse the parsing code.

* [trace] make tracing options API reusable

Add APIs that parse tracing options and evaluate a method
against the parsed options. The tracing functionality now uses
this API, but other components can use this to apply an operation
to a method based on policy (e.g. profiling)

* [trace] rename MonoTraceSpec to MonoCallSpec

In preparation for reusing call specification beyond the
tracer, rename the data structure - it now only specifies
a set of calls, without indication what should be done with
them.

* [trace] rename mono_trace_set_assembly to mono_callspec_set_assembly

As it becoming a reuse candidate, we remove the "trace" component
from the name.

* [trace-metadata] move callspec code into its own module

Introduce callspec.c/h which encapsulate the call specification
functionality.

* [profiler] add "callspec" option to log profiler

The callspec option define which methods get instrumented
at JIT time with entry/exit calls to the profiler. The
syntax is same as the tracer (--trace=) syntax. To
distinguish between profiler options and callspec, wrap the
callspec with double quotes, as in:
--profile=log:callspec="all-mscorlib",calls

Since this typically runs from a shell, the double quotes have to be
escaped or wrapped in single quotes, as in:
mono '--profile=log:callspec="all-mscorlib",calls' prog.exe

* [metadata] add an error return string to callspec parsing

Instead of printing parsing error messages to standard error,
return an error string. That allows the client to do the right thing
with the error.
2017-10-02 16:29:49 +02:00
Zoltan Varga 30cddad5fb [jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to FALSE before it was saved, causing invalid code to be generated in some cases when doing nested inlining. Fixes #59608. (#5654) 2017-10-02 16:26:17 +02:00
Marek Safar 34866ac4c2 [mcs] Initial by ref returns and variables support 2017-10-02 16:23:04 +02:00
lateralusX 56779410e8 Major improvement of Visual Studio toolchain and Windows SDK support in mkbundle.
Current implementation of Windows builds in mkbundle is not supporting
Visual Studio toolchains and Windows SDK's in a working way. Windows version
of mkbundle also lacked support for 64-bit builds together with a dependency on
GCC assembler etc.

This commit improves things in many different areas. The following toolchains
are intended to work together with this commit:

VS2013, VS2015, VS2017.

NOTE, default Mono SDK distribution is build targeting VS2015/VS2017 and static
version of libmono-static.lib won’t work with VS2013. If static use case is needed
with VS2013, a custom build mono under VS2013 must be used.  Dynamic use case is
working as expected for all three versions.

The commit also improves the support for Cygwin GCC compatible toolchains on Windows.

The commit adds support to use installed versions of both Windows 8.1 as well
as Windows 10 SDK's together with all above VS toolchains.

The commit extends support to include 64-bit mkbundle builds (using all supported
Windows toolchains). The target is decided based on mkbundle process type, 32-bit
mono builds 32-bit bundle and 64-bit mono builds 64-bit bundle.

mkbundle might still need to have a working GCC as.exe when running, but this commit
also adds support for Clang for VS CodeGen as assembler available in VS2015 Update3
and VS2017 (separate option in VS setup). When using this option there is no needed
for available GCC toolchains when running mkbundle on Windows.

A recommended way of running mkbundle on Windows is by using one of the targeted toolchains
development consoles. This way mkbundle will get all needed paths and installation folders
directly from the development consoles environment, matching a predefined setup.

Old mkbundle environment variables on Windows will continue to work. There are also a number
of new variables that can be set (or are set by the VS development consoles). The important ones
are:

VisualStudioVersion: set to pick a specific VS version, like 12.0, 14.0 or 15.0. If a none existing
version is specified, mkbundle will fallback to latest installed version.

WindowsSdkVersion: set to pick a specific Windows SDK version, like 8.1, 10.0.10240.0, 10.0.15063.0 etc.
If a none existing version is specified, mkbundle will fallback to latest installed version.

AS: If Clang for VS CodeGen is not installed this must point to a working as.exe assembler.

MONOPREFIX: set to pick a custom Mono SDK install root directory (need to match the architecture of mkbundle
process running). If not set, mkbundle will look for installed Mono SDK’s matching targeted architecture.

MONOLIB: if a different library name is used, it can be specified here. It is also possible to add an absolute
path to the mono library used in linking. NOTE, correct library needs to be supplied for static/dynamic use cases.

INCLUDE: override all custom include path handling, normally set by VS developer consoles.

LIB: override all custom lib path handling, normally set by VS developer consoles.

VCCRT: Gives possibility to use static or dynamic C-Runtime linking. By default mkbundle will use dynamic C-Runtime
linking on Windows to be compatible with default Mono SDK distribution. If a custom build Mono
using static C-Runtime linkage is used, setting this variable to MT (default MD), will link using static
C-Runtime.

VCSUBSYSTEM: mkbundle will by default use windows subsystem. If console subsystem is preferred this variable
can be set to console.

Should resolve:

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

and partial resolves (needs https://github.com/mono/mono/pull/5656 as well):

https://bugzilla.xamarin.com/show_bug.cgi?id=57892
2017-10-02 12:50:02 +02:00
Rodrigo Kumpera fe1eeb0724 [wasm] We can't free memory in wasm as it uses the malloc mmap backend. 2017-09-29 16:14:22 -07:00
Rodrigo Kumpera 22187e8df1 [wasm] Add new missing signature. 2017-09-29 15:45:00 -07:00
Rodrigo Kumpera 6f20e306e0 [wasm] Disable test that doesn't work with WASM 2017-09-29 15:44:41 -07:00
Vlad Brezae f84533a8de [amd64] Save missing register 2017-09-27 21:30:43 +03:00
Vlad Brezae c334db5e2c [arm64] Scan simd registers on apple
Fix for #50190
2017-09-27 21:30:42 +03:00
Vlad Brezae ef8bc5028e [runtime] Avoid indirection when building MonoContext on darwin 2017-09-27 21:30:42 +03:00
Vlad Brezae c889057d64 [arm64] Add the full neon regs to the context
The full regs are still not handled in the trampolines. Only the lower half is saved.
2017-09-27 21:30:40 +03:00
Vlad Brezae 161c807083 [amd64] Add XMM registers to MonoContext on linux
Fix for #50189
2017-09-27 21:27:59 +03:00
Etienne CHAMPETIER 1057d0329a System.Web.SessionState: simplify sessions retrival polling
When using "fat" session (~2MB) and multiple (~20) simultaneous calls
the retrieval sometimes fails and lock the session.
The original code blocks on the calling thread (AutoResetEvent.WaitOne())
and uses another thread with the timer to do the polling.
If the polling succeeds, the TimerCallback AutoResetEvent.Set(),
with no guarantes that it will wake up the thread.
(see Remarks in http://msdn.microsoft.com/en-us/system.threading.eventwaithandle.set%28v=vs.110%29)

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

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

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@ file in this directory.
CLA
=======
Contributions are now taken under the [.NET Foundation CLA](https://cla2.dotnetfoundation.org/).
Contributions are now taken under the [.NET Foundation CLA](https://cla.dotnetfoundation.org/).
Code Review
=======
+45
View File
@@ -0,0 +1,45 @@
## Steps to Reproduce
1.
2.
3.
<!--
You may drag & drop the attachment (repro code/solution, screenshot, etc.) onto the issue.
-->
## Current Behavior
<!--
What is the current behavior?
-->
## Expected Behavior
<!--
Please describe the behavior you are expecting
-->
### On which platforms did you notice this
[ ] macOS
[ ] Linux
[ ] Windows
**Version Used**:
<!--
You can use `mono --version` or About dialog to obtain this information.
-->
### Stacktrace
```
Please paste the stack trace here if available.
```
<!--
You can join us at https://gitter.im/mono/mono to discuss your reported issue
-->
+9
View File
@@ -0,0 +1,9 @@
<!--
Thank you for your Pull Request!
If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.
Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
+2
View File
@@ -40,10 +40,12 @@ Ankh.NoLoad
*.gpState
.vscode/
*.exp
.vs/
# Tooling
_ReSharper*/
*.resharper
.idea/*
[Tt]est[Rr]esult*
*.orig
*.rej
+91
View File
@@ -0,0 +1,91 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"/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",
"${workspaceRoot}/support"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"/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",
"${workspaceRoot}/support"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
]
},
{
"name": "Linux",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
"${workspaceRoot}/support"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
"${workspaceRoot}/support"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "Win32",
"includePath": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
"${workspaceRoot}/support"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
"${workspaceRoot}/support"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 3
}
+21 -16
View File
@@ -17,7 +17,7 @@
/acceptance-tests @akoeplinger
/acceptance-tests/profiler-stress* @alexrp
/data @marek-safar @akoeplinger
/data @marek-safar @akoeplinger @luhenry
/data/gdb @vargaz
/data/lldb @lewurm @vargaz
@@ -30,14 +30,14 @@
/external/boringssl @baulig
/external/nuget-buildtasks @radical @akoeplinger
/libgc @BrzVlad @vargaz
/libgc @BrzVlad @vargaz @luhenry
/llvm @vargaz
/llvm @vargaz @luhenry
/man @marek-safar @miguel
/man/mprof-report.1 @alexrp
/man @marek-safar @miguel @luhenry
/man/*prof* @alexrp
/mcs @marek-safar
/mcs @marek-safar @luhenry
/mcs/build @marek-safar @akoeplinger
@@ -58,7 +58,7 @@
/mcs/errors @marek-safar
/mcs/ilasm @marek-safar
/mcs/jay @marek-safar
/mcs/mcs @marek-safar
/mcs/mcs @marek-safar @lewurm
/mcs/tests @marek-safar
/mcs/tools @marek-safar @akoeplinger
@@ -83,13 +83,13 @@
/mono/mini/*exceptions* @lewurm
/mono/mini/*ppc* @lewurm
/mono/mini/*type-check* @lewurm
/mono/mini/interp/* @lewurm
/mono/mini/interp/* @lewurm @BrzVlad
/mono/mini/*profiler* @alexrp
/mono/mini/debugger-agent.c @DavidKarlas
/mono/profiler @alexrp @kumpera
/mono/sgen @brzvlad @kumpera
/mono/sgen @BrzVlad @kumpera
/mono/utils @kumpera @vargaz
/mono/utils/atomic* @alexrp
@@ -98,26 +98,31 @@
/mono/utils/mono-threads* @luhenry @kumpera
/mono/utils/*-win* @lateralusX @kumpera
/msvc @lateralusX
/msvc @lateralusX @luhenry
/msvc/*profiler* @alexrp
/msvc/scripts @akoeplinger
/msvc/scripts @akoeplinger @kg
/packaging/ @alexischr @akoeplinger
/packaging/ @alexischr @akoeplinger @luhenry
/packaging/MacSDK/msbuild.py @radical @akoeplinger
/runtime @akoeplinger @marek-safar
/runtime @akoeplinger @marek-safar @luhenry
/samples @luhenry
/samples/profiler @alexrp
/samples/size @alexrp
/scripts @akoeplinger
/scripts/ci @akoeplinger
/scripts @akoeplinger @luhenry
/scripts/ci @akoeplinger @alexischr
/scripts/ci/run-test-profiler-stress-tests.sh @alexrp
/sdks @marek-safar @luhenry
/sdks/wasm @kumpera @lrz
/sdks/ios @vargaz @rolfbjarne
/sdks/android @luhenry @jonpryor
/support @luhenry @vargaz
/tools @kumpera
/tools @kumpera @luhenry
/tools/checker @tritao
/tools/crash-bisector @kumpera
/tools/locale-builder @marek-safar
+1 -1
View File
@@ -46,7 +46,7 @@ embeddable runtime:
* mono/utils/bsearch.c: BSD license.
* mono/io-layer/wapi_glob.h, wapi_glob.c: BSD license
* mono/metadata/w32file-unix-glob.c, w32file-unix-glob.h: BSD license
Class Library code
==================
+6 -5
View File
@@ -44,6 +44,7 @@ dist-hook:
rm -rf `find $(top_distdir)/external -path '*\.git'`
rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*'`
rm -rf "$(top_distdir)/external/linker/linker/Tests"
pkgconfigdir = $(libdir)/pkgconfig
noinst_DATA = mono-uninstalled.pc
@@ -114,7 +115,7 @@ update-csproj:
-rm msvc/scripts/order.xml
-rm -rf msvc/scripts/inputs
-mkdir msvc/scripts/inputs
(cd runtime; make V=1 extra_targets=csproj-local)
(cd runtime; $(MAKE) V=1 extra_targets=csproj-local)
package-inputs:
echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
@@ -143,9 +144,9 @@ update-llvm-version:
update-solution-files:
make update-csproj
make package-inputs
(cd msvc/scripts; make genproj.exe; mono genproj.exe $(GENPROJ_ARGS))
$(MAKE) update-csproj
$(MAKE) package-inputs
(cd msvc/scripts; $(MAKE) genproj.exe; mono genproj.exe $(GENPROJ_ARGS))
update-solution-files-with-tests:
make "GENPROJ_ARGS=2012 true true" update-solution-files
$(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files
+61 -38
View File
@@ -19,30 +19,30 @@ The Mono project is part of the [.NET Foundation](http://www.dotnetfoundation.or
| OS | Architecture | Status |
|--------------|--------------------|------------------------------|
| Ubuntu 14.04 | amd64 | [![ubuntu-1404-amd64][1]][2] |
| Ubuntu 14.04 | i386 | [![ubuntu-1404-i386][3]][4] |
| Debian 8 | armel | [![debian-8-armel][5]][6] |
| Debian 8 | armhf | [![debian-8-armhf][7]][8] |
| Debian 8 | arm64 | [![debian-8-arm64][9]][10] |
| Debian 9 | amd64 | [![debian-9-amd64][1]][2] |
| Debian 9 | i386 | [![debian-9-i386][3]][4] |
| Debian 9 | armel | [![debian-9-armel][5]][6] |
| Debian 9 | armhf | [![debian-9-armhf][7]][8] |
| Debian 9 | arm64 | [![debian-9-arm64][9]][10] |
| OS X | amd64 | [![osx-amd64][11]][12] |
| OS X | i386 | [![osx-i386][13]][14] |
| Windows | amd64 | [![windows-amd64][15]][16] |
| Windows | i386 | [![windows-amd64][17]][18] |
| Windows | i386 | [![windows-i386][17]][18] |
| CentOS | s390x (cs) | [![centos-s390x][19]][20] |
| Debian 8 | ppc64el (cs) | [![debian-8-ppc64el][21]][22]|
| Debian 9 | ppc64el (cs) | [![debian-9-ppc64el][21]][22]|
_(cs) = community supported architecture_
[1]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64/badge/icon
[2]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64
[3]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-i386/badge/icon
[4]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-i386/
[5]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armel/badge/icon
[6]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armel/
[7]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armhf/badge/icon
[8]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armhf/
[9]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/badge/icon
[10]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/
[1]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-amd64/badge/icon
[2]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-amd64
[3]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-i386/badge/icon
[4]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-i386/
[5]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armel/badge/icon
[6]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armel/
[7]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armhf/badge/icon
[8]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armhf/
[9]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-arm64/badge/icon
[10]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-arm64/
[11]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/badge/icon
[12]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/
[13]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/badge/icon
@@ -53,8 +53,8 @@ _(cs) = community supported architecture_
[18]: https://jenkins.mono-project.com/job/z/label=w32/
[19]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=centos-s390x/badge/icon
[20]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=centos-s390x
[21]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-8-ppc64el/badge/icon
[22]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-8-ppc64el
[21]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-9-ppc64el/badge/icon
[22]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-9-ppc64el
Compilation and Installation
============================
@@ -111,7 +111,7 @@ Once you have installed the software, you can run a few programs:
* `mono program.exe` runtime engine
* `mcs program.cs` C# compiler
* `mcs program.cs` C# compiler
* `monodis program.exe` CIL Disassembler
@@ -128,6 +128,14 @@ Directory Roadmap
* `external/` - Git submodules for external libraries (Newtonsoft.Json, ikvm, etc).
* `ikvm-native/` - Glue code for ikvm.
* `libgc/` - The (deprecated) Boehm GC implementation.
* `llvm/` - Utility Makefiles for integrating the Mono LLVM fork.
* `m4/` - General utility Makefiles.
* `man/` - Manual pages for the various Mono commands and programs.
* `mcs/` - The class libraries, compiler and tools
@@ -142,26 +150,52 @@ Directory Roadmap
* `arch/` - Architecture specific portions.
* `benchmark/` - A collection of benchmarks.
* `btls/` - Build files for the BTLS library which incorporates BoringSSL.
* `cil/` - Common Intermediate Representation, XML
definition of the CIL bytecodes.
* `dis/` - CIL executable Disassembler
* `dis/` - CIL executable Disassembler.
* `io-layer/` - The I/O layer and system abstraction for
emulating the .NET IO model.
* `eglib/` - Independent implementation of the glib API.
* `metadata/` - The object system and metadata reader.
* `mini/` - The Just in Time Compiler.
* `profiler/` - The profiler implementation.
* `sgen/` - The SGen Garbage Collector implementation.
* `tests/` - The main runtime tests.
* `unit-tests/` - Additional runtime unit tests.
* `utils/` - Utility functions used across the runtime codebase.
* `msvc/` - Logic for the MSVC / Visual Studio based runtime and BCL build system.
The latter is experimental at the moment.
* `packaging/` - Packaging logic for the OS X and Windows Mono packages.
* `po/` - Translation files.
* `runtime/` - A directory that contains the Makefiles that link the
mono/ and mcs/ build systems.
* `samples/` -Some simple sample programs on uses of the Mono
runtime as an embedded library.
* `samples/` - Some simple sample programs on uses of the Mono
runtime as an embedded library.
* `scripts/` - Scripts used to invoke Mono and the corresponding program.
* `sdks/` - A new way of embedding Mono into Xamarin.iOS, Xamarin.Android and other products.
* `support/` - Various support libraries.
* `tools/` - A collection of tools, mostly used during Mono development.
Contributing to Mono
====================
@@ -174,8 +208,7 @@ section.
Reporting bugs
==============
To submit bug reports, please use [Xamarin's
Bugzilla](https://bugzilla.xamarin.com/)
To submit bug reports, please [open an issue on the mono GitHub repo](https://github.com/mono/mono/issues/new).
Please use the search facility to ensure the same bug hasn't already
been submitted and follow our
@@ -308,16 +341,6 @@ should be used.
* Or you can specify a path to a libgdiplus.
* `--disable-shared-memory`
* Use this option to disable the use of shared memory in
Mono (this is equivalent to setting the MONO_DISABLE_SHM
environment variable, although this removes the feature
completely).
* Disabling the shared memory support will disable certain
features like cross-process named mutexes.
* `--enable-minimal=LIST`
* Use this feature to specify optional runtime
@@ -552,7 +575,7 @@ file for information about Microsoft's patent grant.
Mono Trademark Use Policy
=========================
The use of trademarks and logos for Mono can be found [here] (http://www.dotnetfoundation.org/legal/mono-tm).
The use of trademarks and logos for Mono can be found [here](http://www.dotnetfoundation.org/legal/mono-tm).
Maintaining the Class Library Solution Files
============================================
+1
View File
@@ -14,6 +14,7 @@ RUNTIME = MONO_PATH=$(CLASS) $(abs_top_builddir)/runtime/mono-wrapper --debug
TOOLS_RUNTIME = MONO_PATH=$(TOOLS_CLASS) $(abs_top_builddir)/runtime/mono-wrapper --debug
MCS = $(TOOLS_RUNTIME) $(CSC) -nologo -noconfig -lib:$(CLASS) -r:System.dll -r:System.Core.dll -r:System.Xml.dll -r:Microsoft.CSharp.dll
ILASM = $(TOOLS_RUNTIME) $(TOOLS_CLASS)/ilasm.exe
XUNIT = $(RUNTIME) $(abs_top_builddir)/external/xunit-binaries/xunit.console.exe
include versions.mk
include profiler-stress.mk
+6 -6
View File
@@ -1,16 +1,16 @@
[
{
"name": "roslyn",
"url": "git://github.com/dotnet/roslyn.git",
"rev": "322bd5b2bbf07df6a67de35cbcb2365484412f70",
"remote-branch": "origin/master",
"branch": "master",
"url": "git://github.com/mono/roslyn.git",
"rev": "1d9895045041925490038c5df0d8f947d8dcbd7f",
"remote-branch": "origin/mono-testing",
"branch": "mono-testing",
"directory": "roslyn"
},
{
"name": "coreclr",
"url": "git://github.com/mono/coreclr.git",
"rev": "d0e6a36f782f5ee1ca0b7d3ec0c55725c3571b1f",
"rev": "83d8279997d8ce4ad344ff9b937b2d13d074dcaa",
"remote-branch": "origin/mono",
"branch": "mono",
"directory": "coreclr"
@@ -18,7 +18,7 @@
{
"name": "ms-test-suite",
"url": "[email protected]:xamarin/ms-test-suite.git",
"rev": "25f495326e141163d59e52ef499227a2f38fe036",
"rev": "67f29dfc0741b5311dd746c75760963a2915e648",
"remote-branch": "origin/master",
"branch": "master",
"directory": "ms-test-suite"
+5 -2
View File
@@ -32,7 +32,7 @@ coreclr-runtest-coremanglib: coreclr-validate test-runner.exe $(CORECLR_COREMANG
check-coreclr: coreclr-compile-tests coreclr-runtest-basic coreclr-runtest-coremanglib
coreclr-gcstress: coreclr-validate GCStressTests.exe $(CORECLR_STRESSTESTSI_CS)
BVT_ROOT=$(realpath $(CORECLR_PATH)/tests/src/GC/Stress/Tests) $(RUNTIME) GCStressTests.exe $(CORECLR_PATH)/tests/src/GC/Stress/testmix_gc.config; if [ $$? -ne 100 ]; then exit 1; fi
BVT_ROOT=$(realpath $(CORECLR_PATH)/tests/src/GC/Stress/Tests) $(RUNTIME) GCStressTests.exe $(CORECLR_PATH)/tests/src/GC/Stress/$(if $(CI_PR),testmix_gc_pr.config,testmix_gc.config); if [ $$? -ne 100 ]; then exit 1; fi
# Output a variable in $(2) to the file $(1), separated by newline characters
# we need to do it in groups of 100 entries to make sure we don't exceed shell char limits
@@ -2217,7 +2217,6 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcgettotalmemory.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gckeepalive.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcmaxgeneration.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcsuppressfinalize.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcwaitforpendingfinalizers.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/calendarweekrule/calendarweekrulefirstday.cs \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/calendarweekrule/calendarweekrulefirstfourdayweek.cs \
@@ -3982,6 +3981,10 @@ CORECLR_DISABLED_TEST_CS_SRC += \
$(CORECLR_PATH)/tests/src/JIT/Directed/newarr/newarr.cs \
$(CORECLR_PATH)/tests/src/baseservices/exceptions/sharedexceptions/emptystacktrace/oomexception01.cs
# https://github.com/mono/mono/issues/7432
CORECLR_DISABLED_TEST_CS_SRC += \
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcsuppressfinalize.cs
CORECLR_TEST_IL_SRC = \
$(CORECLR_PATH)/tests/src/JIT/BBT/Scenario4/Not-Int32.il \
$(CORECLR_PATH)/tests/src/JIT/Directed/Convert/implicitConv.il \
+68 -40
View File
@@ -57,21 +57,21 @@ namespace Mono.Profiling.Tests.Stress {
"jit",
};
static readonly TimeSpan _timeout = TimeSpan.FromHours (9);
static readonly TimeSpan _timeout = TimeSpan.FromHours (6);
const RegexOptions _regexOptions = RegexOptions.Compiled | RegexOptions.Singleline;
static readonly Dictionary<string, Predicate<Benchmark>> _filters = new Dictionary<string, Predicate<Benchmark>> {
{ "ironjs-v8", FilterArmArchitecture },
{ "ironjs-v8", FilterNotOnArm },
{ "msbiology", FilterNever },
};
static readonly Dictionary<string, Action<TestResult>> _processors = new Dictionary<string, Action<TestResult>> {
{ "msbiology", Process32BitOutOfMemory },
};
static string FilterInvalidXmlChars (string text) {
return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", string.Empty);
static bool FilterNever (Benchmark benchmark)
{
return false;
}
static bool FilterArmArchitecture (Benchmark benchmark)
static bool FilterNotOnArm (Benchmark benchmark)
{
#if ARCH_arm || ARCH_arm64
return false;
@@ -80,45 +80,66 @@ namespace Mono.Profiling.Tests.Stress {
#endif
}
static void Process32BitOutOfMemory (TestResult result)
{
if (Environment.Is64BitProcess)
return;
if (result.ExitCode == null || result.ExitCode == 0)
return;
if (result.StandardError.Contains ("OutOfMemoryException"))
result.ExitCode = 0;
}
static bool IsSupported (Benchmark benchmark)
{
return _filters.TryGetValue (benchmark.Name, out var filter) ? filter (benchmark) : true;
}
static string ReplaceInvalidXmlChars (string text) {
return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", string.Empty);
}
static int Main ()
{
var regex = new Regex (".*", _regexOptions);
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_REGEX") is string envRegex)
regex = new Regex (envRegex, _regexOptions);
var depDir = Path.Combine ("..", "external", "benchmarker");
var benchDir = Path.Combine (depDir, "benchmarks");
var testDir = Path.Combine (depDir, "tests");
var benchmarks = Directory.EnumerateFiles (benchDir, "*.benchmark")
.Select (Benchmark.Load)
.Where (b => !b.OnlyExplicit && b.ClientCommandLine == null && IsSupported (b))
.Where (b => !b.OnlyExplicit && b.ClientCommandLine == null && IsSupported (b) && regex.IsMatch (b.Name))
.OrderBy (b => b.Name)
.ToArray ();
var monoPath = Path.GetFullPath (Path.Combine ("..", "..", "runtime", "mono-wrapper"));
var classDir = Path.GetFullPath (Path.Combine ("..", "..", "mcs", "class", "lib", "net_4_x"));
var rand = new Random ();
var seed = Environment.TickCount;
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_SEED") is string envSeed)
seed = int.Parse (envSeed);
var timeout = (int) _timeout.TotalMilliseconds;
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_TIMEOUT") is string envTimeout)
timeout = (int) TimeSpan.Parse (envTimeout).TotalMilliseconds;
string options = null;
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_OPTIONS") is string envOptions)
options = envOptions;
var suspend = false;
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_SUSPEND") is string envSuspend)
suspend = bool.Parse (envSuspend);
var rand = new Random (seed);
var cpus = Environment.ProcessorCount;
var results = new List<TestResult> (benchmarks.Length);
var sw = Stopwatch.StartNew ();
Console.ForegroundColor = ConsoleColor.Magenta;
Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] Starting test session with seed: {seed}");
Console.ResetColor ();
var results = new List<TestResult> (benchmarks.Length);
for (var i = 0; i < benchmarks.Length; i++) {
var bench = benchmarks [i];
@@ -127,17 +148,24 @@ namespace Mono.Profiling.Tests.Stress {
var maxSamples = rand.Next (0, cpus * 2000 + 1);
var heapShotFreq = rand.Next (-10, 11);
var maxFrames = rand.Next (0, 33);
var options = _options.ToDictionary (x => x, _ => rand.Next (0, 2) == 1)
.Select (x => (x.Value ? string.Empty : "no") + x.Key)
.ToArray ();
var flags = _options.ToDictionary (x => x, _ => rand.Next (0, 2) == 1)
.Select (x => (x.Value ? string.Empty : "no") + x.Key)
.ToArray ();
var profOptions = $"maxframes={maxFrames},{string.Join (",", options)},output=/dev/null";
var profOptions = "nodefaults,output=/dev/null,";
if (sampleFreq > 0)
profOptions += $",sample{sampleMode}={sampleFreq},maxsamples={maxSamples}";
if (options == null) {
profOptions += $"maxframes={maxFrames},";
if (heapShotFreq > 0)
profOptions += $",heapshot={heapShotFreq}gc";
if (sampleFreq > 0)
profOptions += $"sample{sampleMode}={sampleFreq},maxsamples={maxSamples},";
if (heapShotFreq > 0)
profOptions += $"heapshot={heapShotFreq}gc,";
profOptions += string.Join (",", flags);
} else
profOptions += options;
var info = new ProcessStartInfo {
UseShellExecute = false,
@@ -151,6 +179,9 @@ namespace Mono.Profiling.Tests.Stress {
info.EnvironmentVariables.Clear ();
info.EnvironmentVariables.Add ("MONO_PATH", classDir);
if (suspend)
info.EnvironmentVariables.Add ("MONO_DEBUG", "suspend-on-native-crash,suspend-on-unhandled");
var progress = $"({i + 1}/{benchmarks.Length})";
Console.ForegroundColor = ConsoleColor.Blue;
@@ -187,7 +218,7 @@ namespace Mono.Profiling.Tests.Stress {
proc.BeginOutputReadLine ();
proc.BeginErrorReadLine ();
if (!proc.WaitForExit ((int) _timeout.TotalMilliseconds)) {
if (!proc.WaitForExit (timeout)) {
// Force a thread dump.
Syscall.kill (proc.Id, Signum.SIGQUIT);
Thread.Sleep (1000);
@@ -227,9 +258,6 @@ namespace Mono.Profiling.Tests.Stress {
Console.WriteLine (result.StandardError);
}
if (_processors.TryGetValue (bench.Name, out var processor))
processor (result);
results.Add (result);
}
@@ -246,7 +274,7 @@ namespace Mono.Profiling.Tests.Stress {
using (var writer = XmlWriter.Create ("TestResult-profiler-stress.xml", settings)) {
writer.WriteStartDocument ();
writer.WriteComment ("This file represents the results of running a test suite");
writer.WriteComment ($"This file represents the results of running a test suite (seed: {seed})");
writer.WriteStartElement ("test-results");
writer.WriteAttributeString ("name", "profiler-stress-tests.dummy");
@@ -307,11 +335,11 @@ namespace Mono.Profiling.Tests.Stress {
writer.WriteStartElement ("failure");
writer.WriteStartElement ("message");
writer.WriteCData (FilterInvalidXmlChars (result.StandardOutput));
writer.WriteCData (ReplaceInvalidXmlChars (result.StandardOutput));
writer.WriteEndElement ();
writer.WriteStartElement ("stack-trace");
writer.WriteCData (FilterInvalidXmlChars (result.StandardError));
writer.WriteCData (ReplaceInvalidXmlChars (result.StandardError));
writer.WriteEndElement ();
writer.WriteEndElement ();
+2 -15
View File
@@ -1,18 +1,5 @@
check-roslyn:
@$(MAKE) validate-roslyn RESET_VERSIONS=1
@if [ -z $$PREFIX ]; then echo "You need to set PREFIX to the prefix of the Mono installation that should be used for testing Roslyn." && exit 1; fi
sed -i -e 's/\\4.5-api"/\\4.5"/g' $$PREFIX/lib/mono/xbuild-frameworks/.NETFramework/v4.5/RedistList/FrameworkList.xml; \
export MSBuildExtensionsPath=$$PREFIX/lib/mono/xbuild; \
MONO_DOTNET_PORTABLE_DIR=$$PREFIX/lib/mono/xbuild-frameworks/.NETPortable/; \
if [ ! -d "$$MONO_DOTNET_PORTABLE_DIR/v4.6" ]; then \
mkdir -p $$MONO_DOTNET_PORTABLE_DIR; \
curl -SL "http://download.mono-project.com/third-party/RoslynBuildDependencies.zip" > /tmp/RoslynBuildDependencies.zip; \
unzip -o /tmp/RoslynBuildDependencies.zip -d /tmp/RoslynBuildDependencies; \
cp -r /tmp/RoslynBuildDependencies/PortableReferenceAssemblies/* $$MONO_DOTNET_PORTABLE_DIR; \
fi; \
cd $(ROSLYN_PATH); \
sed -i -e 'N; s/bootstrapArg=".*\n.*"/bootstrapArg=""/g' cibuild.sh; \
sed -i -e 's#-xml Binaries/\$$BUILD_CONFIGURATION/xUnitResults/#-nunit $(abs_top_builddir)/acceptance-tests/TestResult-#g' cibuild.sh; \
./cibuild.sh --mono-path $$PREFIX/bin || EXIT_CODE=1; \
sed -i -e 's/\\4.5"/\\4.5-api"/g' $$PREFIX/lib/mono/xbuild-frameworks/.NETFramework/v4.5/RedistList/FrameworkList.xml; \
exit $$EXIT_CODE
./mono-testing.sh "$(XUNIT)" || exit; \
echo "done"
+408 -77
View File
@@ -1,8 +1,8 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [5.7.0],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_INIT(mono, [5.13.0],
[https://github.com/mono/mono/issues/new])
AC_CONFIG_SRCDIR([README.md])
AC_CONFIG_MACRO_DIR([m4])
@@ -40,7 +40,7 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
# This can be reset to 0 when Mono's version number is bumped
# since it's part of the corlib version (the prefix '1' in the full
# version number is to ensure the number isn't treated as octal in C)
MONO_CORLIB_COUNTER=1
MONO_CORLIB_COUNTER=3
MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR 0 $MONO_CORLIB_COUNTER`
AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
@@ -100,7 +100,7 @@ extra_runtime_ldflags=""
# Hack for WASM
# Current autotools (v1.15) doesn't have a triplet we can use for wasm so the kludge we do is to
# work around it by using a feature flag instead
AC_ARG_ENABLE(wasm,[ --enable-wasm Hack to set the current runtime to target wasm], enable_wasm=$enableval)
AC_ARG_ENABLE(wasm,[ --enable-wasm Hack to set the current runtime to target wasm], enable_wasm=$enableval)
# Thread configuration inspired by sleepycat's db
AC_MSG_CHECKING([host platform characteristics])
@@ -113,6 +113,8 @@ ikvm_native=yes
host_win32=no
target_win32=no
platform_android=no
platform_tizen=no
platform_ios=no
host_darwin=no
@@ -121,6 +123,7 @@ CFLAGS="$CFLAGS -D_REENTRANT -D_GNU_SOURCE -DNO_UNALIGNED_ACCESS -s WASM=1"
CPPFLAGS="$CPPFLAGS -D_REENTRANT -DUSE_MMAP -D_GNU_SOURCE -DNO_UNALIGNED_ACCESS -s WASM=1"
libdl="-ldl"
libgc_threads=pthreads
platform_wasm=yes
else
@@ -204,6 +207,7 @@ case "$host" in
;;
*-*-*openbsd*)
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DHOST_BSD -D_REENTRANT -DUSE_MMAP"
LDFLAGS="${LDFLAGS} -Wl,-zwxneeded"
if test "x$disable_munmap" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
@@ -213,6 +217,7 @@ case "$host" in
AC_DEFINE(PTHREAD_POINTER_ID)
libdl=
libgc_threads=pthreads
with_tls=pthread
with_sigaltstack=no
use_sigposix=yes
with_sgen_default_concurrent=yes
@@ -267,6 +272,11 @@ case "$host" in
mono_cv_uscore=no
fi
case "$host" in
*-tizen-linux-*)
platform_tizen=yes
;;
esac
case "$host" in
aarch64-*)
support_boehm=no
with_gc=sgen
@@ -344,8 +354,12 @@ case "$host" in
with_sgen_default_concurrent=yes
;;
arm*-darwin*)
platform_ios=yes
has_dtrace=no
;;
;;
aarch64*-darwin*)
platform_ios=yes
;;
esac
;;
*-*-haiku*)
@@ -357,11 +371,32 @@ case "$host" in
AC_DEFINE(PTHREAD_POINTER_ID)
dnl Haiku does not support static TLS with __thread
with_tls=pthread
dnl Boehm is too much work to backport Haiku support for
support_boehm=no
libgc_threads=pthreads
use_sigposix=yes
;;
*-*-aix*|*-*-os400*)
dnl Set up a 64-bit build
CPPFLAGS="$CPPFLAGS -maix64 -DGC_AIX_THREADS -D_ALL_SOURCE -D_THREAD_SAFE -D_LARGE_FILES -D_REENTRANT"
LDFLAGS="-maix64"
libmono_cflags="-D_THREAD_SAFE -D_REENTRANT"
dnl Would you believe GNU nm doesn't know how to process AIX libraries?
dnl Hardcode IBM binutils in case GNU ones end up on our path. Also
dnl specifiy 64-bit mode for tools.
AR="/usr/bin/ar -X64"
NM="/usr/bin/nm -X64"
dnl SGen is the future (changes to Boehm support code would be
dnl required if you wish to re-enable Boehm)
support_boehm=no
with_gc=sgen
need_link_unlink=yes
use_sigposix=yes
dnl the valloc call to alloc the guard page bombs out, even with extending the data area
with_sigaltstack=no
dnl use pthread TLS, __thread has issues with the compiler flags we use
with_tls=pthread
dnl ppc Linux is the same? test further
disable_munmap=yes
;;
*)
AC_MSG_WARN([*** Please add $host to configure.ac checks!])
libdl="-ldl"
@@ -400,6 +435,9 @@ AM_CONDITIONAL(HOST_LINUX, echo x$target_os | grep -q linux)
AM_CONDITIONAL(HOST_DARWIN, test x$host_darwin = xyes)
AM_CONDITIONAL(HOST_SIGPOSIX, test x$use_sigposix = xyes)
AM_CONDITIONAL(HOST_ANDROID, test x$platform_android = xyes)
AM_CONDITIONAL(HOST_TIZEN, test x$platform_tizen = xyes)
AM_CONDITIONAL(HOST_IOS, test x$platform_ios = xyes)
AM_CONDITIONAL(HOST_WASM, test x$platform_wasm = xyes)
if test -z "$HOST_DARWIN_TRUE"; then :
PLATFORM_AOT_SUFFIX=.dylib
@@ -503,7 +541,6 @@ AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
if test x$have_zlib = xyes; then
AC_TRY_COMPILE([#include <zlib.h>], [
#if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
return 0;
#else
#error No good zlib found
#endif
@@ -530,6 +567,7 @@ AC_CHECK_HEADERS(sys/poll.h)
AC_CHECK_HEADERS(sys/wait.h)
AC_CHECK_HEADERS(grp.h)
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_FUNCS(vsyslog)
# for mono/dis
AC_CHECK_HEADERS(wchar.h)
@@ -554,6 +592,72 @@ AC_CHECK_FUNCS(_finite, , AC_MSG_CHECKING(for _finite in math.h)
# for Linux statfs support
AC_CHECK_HEADERS(linux/magic.h)
# For Android NDK unified headers
if test x$platform_android = xyes; then
AC_CHECK_HEADERS(machine/endian.h sys/endian.h)
AC_CHECK_HEADERS(android/legacy_signal_inlines.h, [have_android_signal_inlines=yes], [have_android_signal_inlines=no])
# Make sure SIGRT{MIN,MAX} work - they will fail to work with unified headers if building for
# API level < 21 *and* android/legacy_signal_inlines.h doesn't declare (and define) the required
# libc APIs to obtain values for SIGRT{MIN,MAX}. We perform the check only if android/legacy_signal_inlines.h
# is found because in other cases the macros will either work (for NDK < 14) or fail if the legacy header
# doesn't contain the required definitions (NDK 14)
if test x$have_android_signal_inlines = xyes; then
AC_MSG_CHECKING([Whether Android SIGRTMIN/SGRTMAX macros are valid])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([#include <android/legacy_signal_inlines.h>],[
int i;
for (i = SIGRTMIN + 1; i < SIGRTMAX; ++i) {
}
])],[
AC_MSG_RESULT(yes)
android_sigrtminmax_work=yes
],[
AC_MSG_RESULT(no)
android_sigrtminmax_work=no
]
)
if test x$android_sigrtminmax_work = xno; then
AC_MSG_ERROR([Android SIGRTMIN/SIGRTMAX macros don't work in this NDK])
fi
fi
# Attempt to detect whether we're using Android NDK unified headers
AC_CHECK_HEADERS(android/api-level.h, [have_android_api_level=yes], [have_android_api_level=no])
AC_CHECK_HEADERS(android/versioning.h, [have_android_versioning=yes], [have_android_versioning=no])
android_unified_headers=no
if test x$have_android_api_level = xyes; then
if test x$have_android_versioning = xyes; then
AC_MSG_CHECKING([whether using Android NDK unified headers])
# Both macros are defined only in the NDK unified headers
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([
#include <android/api-level.h>
#include <android/versioning.h>
],[
#if __ANDROID_API_O__ == 26 && defined(__INTRODUCED_IN)
#else
#error __ANDROID_API_O__ != 26 or the __INTRODUCED_IN macro not defined
#endif
])],[
AC_MSG_RESULT(yes)
android_unified_headers=yes
],[
AC_MSG_RESULT(no)
android_unified_headers=no
]
)
fi
fi
if test x$android_unified_headers = xyes; then
AC_DEFINE(ANDROID_UNIFIED_HEADERS, 1, [Whether Android NDK unified headers are used])
fi
fi # Android
# not 64 bit clean in cross-compile
if test "x$enable_wasm" = "xyes"; then
AC_DEFINE(SIZEOF_VOID_P,4)
@@ -575,7 +679,6 @@ AC_CACHE_CHECK([for clang],
#else
#error "FAILED"
#endif
return 0;
],
[mono_cv_clang=yes],
[mono_cv_clang=no],
@@ -611,7 +714,6 @@ if test x"$GCC" = xyes; then
CFLAGS="$CFLAGS -Wunused-but-set-variable -Werror"
AC_MSG_CHECKING(for -Wno-unused-but-set-variable option to gcc)
AC_TRY_COMPILE([],[
return 0;
], [
AC_MSG_RESULT(yes)
CFLAGS="$ORIG_CFLAGS -Wno-unused-but-set-variable"
@@ -722,8 +824,9 @@ AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir Chan
fi
)
AC_CHECK_PROG(ninja, ninja, yes, no)
AM_CONDITIONAL(NINJA, test x$ninja != xno)
AC_ARG_ENABLE(ninja,[ --enable-ninja Enable using ninja where available], enable_ninja=$enableval)
AC_CHECK_PROG(HAVE_NINJA, ninja, yes, no)
AM_CONDITIONAL(NINJA, test x$enable_ninja = xyes -a x$HAVE_NINJA != xno)
AC_ARG_ENABLE(werror, [ --enable-werror Pass -Werror to the C compiler], werror_flag=$enableval, werror_flag=no)
if test x$werror_flag = xyes; then
@@ -773,6 +876,7 @@ fi
AM_CONDITIONAL(STATIC_MONO, test x$with_static_mono != xno)
AM_CONDITIONAL(SHARED_MONO, test x$with_shared_mono != xno)
AC_ARG_ENABLE(mcs-build, [ --disable-mcs-build disable the build of the mcs directory], try_mcs_build=$enableval, enable_mcs_build=yes)
AC_ARG_ENABLE(support-build, [ --disable-support-build disable the build of the support directory], try_support_build=$enableval, enable_support_build=yes)
AC_ARG_WITH(xen_opt, [ --with-xen_opt=yes,no Enable Xen-specific behaviour (defaults to yes)],[],[with_xen_opt=yes])
if test "x$with_xen_opt" = "xyes" -a "x$mono_cv_clang" = "xno"; then
@@ -781,7 +885,6 @@ if test "x$with_xen_opt" = "xyes" -a "x$mono_cv_clang" = "xno"; then
CFLAGS="$CFLAGS -mno-tls-direct-seg-refs"
AC_MSG_CHECKING(for -mno-tls-direct-seg-refs option to gcc)
AC_TRY_COMPILE([], [
return 0;
], [
AC_MSG_RESULT(yes)
# Pass it to libgc as well
@@ -832,6 +935,51 @@ if test $csc_compiler = default; then
fi
AC_MSG_RESULT($csc_compiler)
AC_ARG_WITH(jemalloc, [ --with-jemalloc=yes,no If jemalloc is enabled (defaults to no)], [], [with_jemalloc=no])
AC_ARG_WITH(jemalloc-always, [ --with-jemalloc_always=yes,no If jemalloc is enabled and always used (defaults to yes)], [], [with_jemalloc_always=no])
AC_ARG_WITH(jemalloc-assert, [ --with-jemalloc_assert=yes,no If jemalloc performs runtime checks for memory correctness (defaults to no)], [], [with_jemalloc_assert=no])
if test x$target_win32 = xyes; then
with_jemalloc=no
with_jemalloc_assert=no
with_jemalloc_always=no
fi
AM_CONDITIONAL(MONO_JEMALLOC_ASSERT, [test "x$with_jemalloc_assert" = "xyes"])
if test "x$with_jemalloc_assert" = "xyes"; then
JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_ASSERT"
AC_DEFINE(MONO_JEMALLOC_ASSERT, 1, [Make jemalloc assert for mono])
AC_SUBST(MONO_JEMALLOC_ASSERT, 1)
fi
AM_CONDITIONAL(MONO_JEMALLOC_DEFAULT, [test "x$with_jemalloc_always" = "xyes"])
if test "x$with_jemalloc_always" = "xyes"; then
with_jemalloc=yes
JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_DEFAULT"
AC_DEFINE(MONO_JEMALLOC_DEFAULT, 1, [Make jemalloc default for mono])
AC_SUBST(MONO_JEMALLOC_DEFAULT, 1)
fi
AM_CONDITIONAL(MONO_JEMALLOC_ENABLED, [test "x$with_jemalloc" = "xyes"])
if test "x$with_jemalloc" = "xyes"; then
JEMALLOC_LDFLAGS="-L`pwd`/mono/utils/jemalloc/jemalloc/lib -ljemalloc_pic"
JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_ENABLED -I `pwd`/mono/utils/jemalloc/jemalloc/include"
JEMALLOC_AUTOCONF_FLAGS=" --build=$target --host=$host"
if test "x$target_mach" = "xyes"; then
JEMALLOC_CPPFLAGS=" -stdlib=libc++ "
fi
AC_DEFINE(MONO_JEMALLOC_ENABLED, 1, [Enable jemalloc usage for mono])
AC_SUBST(MONO_JEMALLOC_ENABLED, 1)
AC_SUBST(JEMALLOC_CFLAGS)
AC_SUBST(JEMALLOC_CPPFLAGS)
AC_SUBST(JEMALLOC_LDFLAGS)
AC_SUBST(JEMALLOC_AUTOCONF_FLAGS)
fi
#
# Set the build profiles and options before things which use them
#
@@ -848,9 +996,56 @@ AC_ARG_WITH(testing_aot_full, [ --with-testing_aot_full=yes,no If you w
AC_ARG_WITH(winaot, [ --with-winaot=yes,no If you want to build the Windows friendly AOT assemblies (defaults to no)], [], [with_winaot=default])
AC_ARG_WITH(orbis, [ --with-orbis=yes,no If you want to build the Orbis assemblies (defaults to no)], [], [with_orbis=default])
AC_ARG_WITH(unreal, [ --with-unreal=yes,no If you want to build the Unreal assemblies (defaults to no)], [], [with_unreal=default])
AC_ARG_WITH(wasm, [ --with-wasm=yes,no If you want to build the WebAssembly (defaults to no)], [], [with_wasm=default])
AC_ARG_WITH(runtime_preset, [ --with-runtime_preset=net_4_x,all,aot,hybridaot,fullaot,bitcode,unreal Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
AC_ARG_WITH(spectre-mitigation, [ --with-spectre-mitigation=yes,no If you want to build the runtime with compiler flags that enable Spectre mitigation (defaults to no)], [], [with_spectre_mitigation=default])
AC_ARG_WITH(spectre-indirect-branch-choice, [ --with-spectre-indirect-branch-choice=keep,thunk,inline,extern Convert indirect branches to the specified kind of thunk (defaults to inline)], [], [with_spectre_indirect_branch_choice=inline])
AC_ARG_WITH(spectre-function-return-choice, [ --with-spectre-function-return-choice=keep,thunk,inline,extern Convert function return instructions to the specified kind of thunk (defaults to inline)], [], [with_spectre_function_return_choice=inline])
dnl
dnl Spectre compiler mitigation flag checks
dnl
if test "x$with_spectre_mitigation" = "xyes"; then
AC_MSG_NOTICE([Compiler Spectre mitigation support checks])
SPECTRE_CFLAGS=
SPECTRE_INDIRECT_BRANCH_KIND=
case "x$with_spectre_indirect_branch_choice" in
xkeep) SPECTRE_INDIRECT_BRANCH_KIND=keep ;;
xthunk) SPECTRE_INDIRECT_BRANCH_KIND=thunk ;;
xinline) SPECTRE_INDIRECT_BRANCH_KIND=thunk-inline ;;
xextern) SPECTRE_INDIRECT_BRANCH_KIND=thunk-extern ;;
*) AC_MSG_ERROR([Invalid indirect jump thunk kind ($with_spectre_indirect_branch_choice)]) ;;
esac
SPECTRE_FUNCTION_RETURN_KIND=""
case "x$with_spectre_function_return_choice" in
xkeep) SPECTRE_FUNCTION_RETURN_KIND=keep ;;
xthunk) SPECTRE_FUNCTION_RETURN_KIND=thunk ;;
xinline) SPECTRE_FUNCTION_RETURN_KIND=thunk-inline ;;
xextern) SPECTRE_FUNCTION_RETURN_KIND=thunk-extern ;;
*) AC_MSG_ERROR([Invalid function return thunk kind ($with_spectre_function_return_choice)]) ;;
esac
AX_CHECK_COMPILE_FLAG(
[ -mindirect-branch=$SPECTRE_INDIRECT_BRANCH_KIND ],
[ SPECTRE_CFLAGS="$SPECTRE_CFLAGS -mindirect-branch=$SPECTRE_INDIRECT_BRANCH_KIND" ]
)
AX_CHECK_COMPILE_FLAG(
[ -mfunction-return=$SPECTRE_FUNCTION_RETURN_KIND ],
[ SPECTRE_CFLAGS="$SPECTRE_CFLAGS -mfunction-return=$SPECTRE_FUNCTION_RETURN_KIND" ]
)
if test "x$SPECTRE_CFLAGS" != "x" ; then
CFLAGS="$CFLAGS $SPECTRE_CFLAGS"
CXXFLAGS="$CXXFLAGS $SPECTRE_CFLAGS"
spectre_mitigation_status="mitigation enabled"
fi
else
spectre_mitigation_status="no mitigation"
fi
dnl
dnl Profile defaults
@@ -869,11 +1064,14 @@ with_testing_aot_full_default=no
with_winaot_default=no
with_orbis_default=no
with_unreal_default=no
with_wasm_default=no
with_bitcode_default=no
with_cooperative_gc_default=no
INVARIANT_AOT_OPTIONS=nimt-trampolines=2000,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=4000
INVARIANT_AOT_OPTIONS=nimt-trampolines=2000,ntrampolines=10000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=4000
AOT_BUILD_ATTRS=$INVARIANT_AOT_OPTIONS
if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
DISABLE_MCS_DOCS_default=yes
@@ -889,6 +1087,7 @@ elif test x$with_runtime_preset = xall; then
with_winaot_default=yes
with_orbis_default=yes
with_unreal_default=yes
with_wasm_default=yes
elif test x$with_runtime_preset = xfullaot; then
DISABLE_MCS_DOCS_default=yes
with_testing_aot_full_default=yes
@@ -901,8 +1100,8 @@ elif test x$with_runtime_preset = xfullaot; then
mono_feature_disable_appdomains='yes'
AOT_BUILD_FLAGS="--runtime=mobile -O=gsharedvt --aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --full-aot"
AOT_MODE="full"
elif test x$with_runtime_preset = xbitcode; then
DISABLE_MCS_DOCS_default=yes
with_testing_aot_full_default=yes
@@ -919,6 +1118,7 @@ elif test x$with_runtime_preset = xbitcode; then
AOT_BUILD_FLAGS="--runtime=mobile --aot=llvmonly,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --llvmonly"
AOT_MODE="llvmonly"
elif test x$with_runtime_preset = xhybridaot; then
DISABLE_MCS_DOCS_default=yes
with_testing_aot_hybrid_default=yes
@@ -946,6 +1146,7 @@ elif test x$with_runtime_preset = xwinaot; then
AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --full-aot"
AOT_MODE="llvmonly"
elif test x$with_runtime_preset = xorbis; then
DISABLE_MCS_DOCS_default=yes
with_orbis_default=yes
@@ -959,6 +1160,7 @@ elif test x$with_runtime_preset = xorbis; then
AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --full-aot"
AOT_MODE="full"
elif test x$with_runtime_preset = xunreal; then
DISABLE_MCS_DOCS_default=yes
with_unreal_default=yes
@@ -970,6 +1172,19 @@ elif test x$with_runtime_preset = xunreal; then
AOT_BUILD_FLAGS="--runtime=mobile --aot=hybrid,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --hybrid-aot"
elif test x$with_runtime_preset = xwasm; then
DISABLE_MCS_DOCS_default=yes
with_wasm_default=yes
TEST_PROFILE=wasm
mono_feature_disable_com='yes'
mono_feature_disable_remoting='yes'
mono_feature_disable_reflection_emit_save='yes'
mono_feature_disable_reflection_emit='yes'
mono_feature_disable_appdomains='yes'
AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --full-aot"
else
with_profile4_x_default=yes
fi
@@ -1019,6 +1234,9 @@ fi
if test "x$with_unreal" = "xdefault"; then
with_unreal=$with_unreal_default
fi
if test "x$with_wasm" = "xdefault"; then
with_wasm=$with_wasm_default
fi
AM_CONDITIONAL(INSTALL_4_x, [test "x$with_profile4_x" = "xyes"])
@@ -1033,7 +1251,8 @@ AM_CONDITIONAL(INSTALL_TESTING_AOT_FULL, [test "x$with_testing_aot_full" != "xno
AM_CONDITIONAL(INSTALL_WINAOT, [test "x$with_winaot" != "xno"])
AM_CONDITIONAL(INSTALL_ORBIS, [test "x$with_orbis" != "xno"])
AM_CONDITIONAL(INSTALL_UNREAL, [test "x$with_unreal" != "xno"])
AM_CONDITIONAL(FULL_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_full"] || [test "x$TEST_PROFILE" = "xwinaot"] || [test "x$TEST_PROFILE" = "xorbis"])
AM_CONDITIONAL(INSTALL_WASM, [test "x$with_wasm" != "xno"])
AM_CONDITIONAL(FULL_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_full"] || [test "x$TEST_PROFILE" = "xwinaot"] || [test "x$TEST_PROFILE" = "xorbis"] || [test "x$TEST_PROFILE" = "xwasm"])
AM_CONDITIONAL(HYBRID_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_hybrid"] || [test "x$TEST_PROFILE" = "xunreal"])
default_profile=net_4_x
@@ -1061,6 +1280,9 @@ fi
if test -z "$INSTALL_UNREAL_TRUE"; then :
default_profile=unreal
fi
if test -z "$INSTALL_WASM_TRUE"; then :
default_profile=wasm
fi
if test -z "$INSTALL_4_x_TRUE"; then :
default_profile=net_4_x
fi
@@ -1091,8 +1313,8 @@ fi
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, desktop_loader, shared_perfcounters, remoting,
security, lldb, mdb, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying.],
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, interpreter, simd, soft_debug, perfcounters, normalization, desktop_loader, shared_perfcounters, remoting,
security, lldb, mdb, sgen_marksweep_conc, sgen_split_nursery, sgen_gc_bridge, sgen_debug_helpers.],
[
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
eval "mono_feature_disable_$feature='yes'"
@@ -1187,12 +1409,25 @@ if test "x$mono_feature_disable_verifier" = "xyes"; then
fi
if test "x$mono_feature_disable_jit" = "xyes"; then
AC_DEFINE(DISABLE_JIT, 1, [Disable the JIT, only full-aot mode will be supported by the runtime.])
AC_MSG_NOTICE([Disabled the JIT engine, only full AOT will be supported])
AC_DEFINE(DISABLE_JIT, 1, [Disable the JIT, only full-aot mode or interpreter will be supported by the runtime.])
AC_MSG_NOTICE([Disabled the JIT engine, only full AOT or interpreter will be supported])
fi
AM_CONDITIONAL(DISABLE_JIT, test x$mono_feature_disable_jit = xyes)
if test "x$mono_feature_disable_interpreter" = "xyes"; then
AC_DEFINE(DISABLE_INTERPRETER, 1, [Disable the interpreter.])
AC_MSG_NOTICE([Disabled the interpreter])
fi
AM_CONDITIONAL(DISABLE_INTERPRETER, test x$mono_feature_disable_interpreter = xyes)
if test "x$mono_feature_disable_interpreter" != "xyes" -o "x$mono_feature_disable_jit" != "xyes"; then
AC_DEFINE(ENABLE_ILGEN, 1, [Some VES is available at runtime])
fi
AM_CONDITIONAL(ENABLE_ILGEN, test x$mono_feature_disable_interpreter != xyes -o x$mono_feature_disable_jit != xyes)
if test "x$mono_feature_disable_simd" = "xyes"; then
AC_DEFINE(DISABLE_SIMD, 1, [Disable SIMD intrinsics related optimizations.])
AC_MSG_NOTICE([Disabled SIMD support])
@@ -1248,29 +1483,25 @@ if test "x$mono_feature_disable_mdb" = "xyes"; then
AC_MSG_NOTICE([Disabled support for .mdb symbol files.])
fi
if test "x$mono_feature_disable_sgen_remset" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_REMSET, 1, [Disable wbarrier=remset support in SGEN.])
AC_MSG_NOTICE([Disabled wbarrier=remset support in SGEN.])
if test "x$mono_feature_disable_sgen_marksweep_conc" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_MAJOR_MARKSWEEP_CONC, 1, [Disable concurrent gc support in SGEN.])
AC_MSG_NOTICE([Disabled concurrent gc support in SGEN.])
fi
if test "x$mono_feature_disable_sgen_marksweep_par" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_MAJOR_MARKSWEEP_PAR, 1, [Disable major=marksweep-par support in SGEN.])
AC_MSG_NOTICE([Disabled major=marksweep-par support in SGEN.])
if test "x$mono_feature_disable_sgen_split_nursery" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_SPLIT_NURSERY, 1, [Disable minor=split support in SGEN.])
AC_MSG_NOTICE([Disabled minor=split support in SGEN.])
fi
if test "x$mono_feature_disable_sgen_marksweep_fixed" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_MAJOR_MARKSWEEP_FIXED, 1, [Disable major=marksweep-fixed support in SGEN.])
AC_MSG_NOTICE([Disabled major=marksweep-fixed support in SGEN.])
if test "x$mono_feature_disable_sgen_gc_bridge" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_GC_BRIDGE, 1, [Disable gc bridge support in SGEN.])
AC_MSG_NOTICE([Disabled gc bridge support in SGEN.])
fi
if test "x$mono_feature_disable_sgen_marksweep_fixed_par" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_MAJOR_MARKSWEEP_FIXED_PAR, 1, [Disable major=marksweep-fixed-par support in SGEN.])
AC_MSG_NOTICE([Disabled major=marksweep-fixed-par support in SGEN.])
fi
if test "x$mono_feature_disable_sgen_copying" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_MAJOR_COPYING, 1, [Disable major=copying support in SGEN.])
AC_MSG_NOTICE([Disabled major=copying support in SGEN.])
if test "x$mono_feature_disable_sgen_debug_helpers" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_DEBUG_HELPERS, 1, [Disable debug helpers in SGEN.])
AC_MSG_NOTICE([Disabled debug helpers in SGEN.])
fi
AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes)
@@ -1429,6 +1660,33 @@ if test x$platform_android = xyes; then
fi
if test x$host_win32 = xno; then
dnl *************************************
dnl *** Checks for time capabilities ***
dnl *************************************
AC_MSG_CHECKING(for CLOCK_MONOTONIC)
AC_TRY_COMPILE([#include <time.h>], [
const int foo = CLOCK_MONOTONIC;
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CLOCK_MONOTONIC, 1, [CLOCK_MONOTONIC])
], [
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(for CLOCK_MONOTONIC_COARSE)
AC_TRY_COMPILE([#include <time.h>], [
const int foo = CLOCK_MONOTONIC_COARSE;
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CLOCK_MONOTONIC_COARSE, 1, [CLOCK_MONOTONIC_COARSE])
], [
AC_MSG_RESULT(no)
])
AC_CHECK_FUNC(mach_absolute_time, [AC_DEFINE(HAVE_MACH_ABSOLUTE_TIME, 1, [mach_absolute_time])])
AC_CHECK_FUNC(gethrtime, [AC_DEFINE(HAVE_GETHRTIME, 1, [gethrtime])])
AC_CHECK_FUNC(read_real_time, [AC_DEFINE(HAVE_READ_REAL_TIME, 1, [read_real_time])])
dnl hires monotonic clock support
AC_SEARCH_LIBS(clock_gettime, rt)
@@ -1528,7 +1786,6 @@ if test x$host_win32 = xno; then
AC_TRY_COMPILE([#include <sched.h>], [
int mask = 1;
sched_setaffinity(0, &mask);
return 0;
], [
# Yes, we have it...
AC_MSG_RESULT(yes)
@@ -2112,11 +2369,7 @@ if test x$host_win32 = xno; then
child ()
{
struct sigaction sa;
#ifdef __APPLE__
stack_t sas;
#else
struct sigaltstack sas;
#endif
pthread_t id;
pthread_attr_t attr;
@@ -2385,6 +2638,21 @@ if test x$host_win32 = xno; then
], [
AC_MSG_RESULT(no)
])
dnl **********************************
dnl *** Check for access ***
dnl **********************************
AC_MSG_CHECKING(for access)
AC_TRY_LINK([
#include <unistd.h>
], [
access(NULL,0);
], [
# Yes, we have it...
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ACCESS, 1, [Have access])
], [
AC_MSG_RESULT(no)
])
dnl **********************************
dnl *** Checks for proclib ***
@@ -2511,7 +2779,7 @@ if test x$host_win32 = xno; then
[#include <sys/types.h>
#include <sys/vfs.h>])
AC_CHECK_MEMBERS(
[struct stat.st_atim, struct stat.st_mtim, struct stat.st_ctim],,,
[struct stat.st_atim, struct stat.st_mtim, struct stat.st_atimespec, struct stat.st_ctim],,,
[#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>])
@@ -2553,6 +2821,14 @@ if test x$host_win32 = xno; then
#endif
])
AC_CHECK_HEADERS([termios.h])
dnl *********************************
dnl *** Checks for random ***
dnl *********************************
if test x$host_darwin = xno; then
AC_CHECK_HEADERS(sys/random.h)
AC_CHECK_FUNCS(getrandom getentropy)
fi
else
dnl *********************************
dnl *** Checks for Windows compilation ***
@@ -2772,8 +3048,11 @@ try_dev_random=$enableval, try_dev_random=yes)
AC_MSG_RESULT($try_dev_random)
case "{$build}" in
*-openbsd*)
NAME_DEV_RANDOM="/dev/srandom"
dnl IBM i does not have /dev/random, use unblocking only
*-*-os400*)
NAME_DEV_RANDOM="/dev/urandom"
;;
dnl Win32 does not have /dev/random, they have their own method...
@@ -2819,7 +3098,7 @@ if test "x$ac_cv_have_dev_random" = "xno" \
*** will throw a NotImplemented exception.
***
*** If you are seeing this message, and you know your system DOES have an
*** entropy collection in place, please contact <[email protected]> and
*** entropy collection in place, please report an issue on GitHub and
*** provide information about the system and how to access the random device.
***
*** Otherwise you can install either egd or prngd and set the environment
@@ -3097,7 +3376,6 @@ case "$host" in
#if _MIPS_SIM != _ABIN32
#error Not mips n32
#endif
return 0;
],[
AC_MSG_RESULT(yes)
sizeof_register=8
@@ -3147,6 +3425,9 @@ case "$host" in
BTLS_PLATFORM=i386
;;
openbsd*|freebsd*|kfreebsd-gnu*)
AOT_SUPPORTED="yes"
BTLS_SUPPORTED=yes
BTLS_PLATFORM=i386
;;
esac
;;
@@ -3171,6 +3452,9 @@ case "$host" in
boehm_supported=false
;;
openbsd*|freebsd*|kfreebsd-gnu*)
AOT_SUPPORTED="yes"
BTLS_SUPPORTED=yes
BTLS_PLATFORM=x86_64
;;
mingw*)
;;
@@ -3204,7 +3488,8 @@ case "$host" in
INTL="intl"
;;
macppc-*-openbsd* | powerpc*-*-linux* | powerpc-*-openbsd* | \
powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* | powerpc-*-freebsd* )
powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* | \
powerpc-*-freebsd* | powerpc-*-aix* | powerpc-*-os400* )
if test "x$ac_cv_sizeof_void_p" = "x8"; then
TARGET=POWERPC64;
CPPFLAGS="$CPPFLAGS -D__mono_ppc__ -D__mono_ppc64__"
@@ -3215,7 +3500,18 @@ case "$host" in
fi
arch_target=ppc;
case $host_os in
linux*|darwin*)
aix*|os400*)
BTLS_SUPPORTED=yes
BTLS_PLATFORM=powerpc
dnl on AIX/PASE, shared libraries can be inside archives
dnl if they are, we specify them by lib.a(lib.so)
dnl we may hardcode 64-bit names at times, but we don't do 32-bit AIX, so
LIBC="libc.a(shr_64.o)"
INTL="libintl.a(libintl.so.8)"
;;
linux*)
BTLS_SUPPORTED=yes
BTLS_PLATFORM=powerpc
;;
esac
;;
@@ -3278,6 +3574,7 @@ HOST=$TARGET
if test "x$host" != "x$target"; then
AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
enable_mcs_build=no
enable_support_build=no
BTLS_SUPPORTED=no
case "$target" in
arm*-darwin*)
@@ -3557,7 +3854,6 @@ if test "x$target_mach" = "xyes"; then
#if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
#error fail this for ios
#endif
return 0;
], [
AC_DEFINE(TARGET_OSX,1,[The JIT/AOT targets OSX])
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_OSX"
@@ -3602,14 +3898,6 @@ if test "x$have_deprecated" = "xyes"; then
AC_DEFINE(HAVE_DEPRECATED, 1, [Support for the deprecated attribute])
fi
AC_ARG_ENABLE(interpreter, [ --enable-interpreter Enable Interpreter], enable_interpreter=$enableval, enable_interpreter=no)
if test "x$enable_interpreter" = "xyes"; then
AC_DEFINE(ENABLE_INTERPRETER, 1, [Enable Interpreter])
fi
AM_CONDITIONAL(ENABLE_INTERPRETER, [test x$enable_interpreter = xyes])
dnl
dnl Simple Generational checks (sgen)
dnl
@@ -3799,7 +4087,19 @@ AC_SEARCH_LIBS(nanosleep, rt)
AC_SEARCH_LIBS(dlopen, dl)
old_ldflags="${LDFLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
# GNU specific option, this confuses IBM ld, but do offer alternatives when possible
if test $lt_cv_prog_gnu_ld = yes; then
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
else
case $host in
*-*-aix*|*-*-os400*)
;;
*)
dnl Try to use export-dynamic anyways
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
;;
esac
fi
AC_TRY_LINK(, [int i;], found_export_dynamic=yes, found_export_dynamic=no)
if test $found_export_dynamic = no; then
LDFLAGS="${old_ldflags}"
@@ -3821,7 +4121,7 @@ fi
AC_SUBST(G_HAVE_ISO_VARARGS)
AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h iconv.h localcharset.h sys/types.h sys/resource.h)
AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+="-liconv -lcharset"])])
AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+=" -liconv -lcharset"])])
AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
AC_SUBST(HAVE_ALLOCA_H)
@@ -3878,10 +4178,23 @@ case "$host" in
esac
case $with_libgdiplus in
no|installed)
no)
libgdiplus_loc=
;;
installed)
libgdiplus_loc=
if test x$cross_compiling = xno; then
if test x$host_darwin = xyes; then
a=/Library/Frameworks/Mono.framework/Versions/Current/lib/$libgdiplus_install_loc
if test -x $a; then
libgdiplus_install_loc=$a
libgdiplus_loc=$a
fi
fi
fi
;;
yes|sibling)
libgdiplus_loc=`cd ../libgdiplus && pwd`/src/libgdiplus.la
;;
@@ -3895,8 +4208,8 @@ case $with_libgdiplus in
libgdiplus_loc=`pwd`/$with_libgdiplus
;;
esac
AC_SUBST([libgdiplus_loc])
AC_SUBST([libgdiplus_install_loc])
AC_SUBST(libgdiplus_loc)
AC_SUBST(libgdiplus_install_loc)
AC_ARG_ENABLE(icall-symbol-map,[ --enable-icall-symbol-map Generate tables which map icall functions to their C symbols], icall_symbol_map=$enableval, icall_symbol_map=no)
if test "x$icall_symbol_map" = "xyes"; then
@@ -3913,6 +4226,8 @@ if test "x$icall_tables" = "xno"; then
AC_DEFINE(DISABLE_ICALL_TABLES, 1, [Icall tables disabled])
fi
AM_CONDITIONAL(DISABLE_ICALL_TABLES, test x$icall_tables = xno)
if test "x$with_tls" = "x__thread"; then
AC_DEFINE(HAVE_KW_THREAD, 1, [Have __thread keyword])
# Pass the information to libgc
@@ -3963,7 +4278,6 @@ if test ${TARGET} = ARM; then
#ifndef __ARM_PCS_VFP
#error "Float ABI is not 'hard'"
#endif
return 0;
], [
fpu=VFP_HARD
], [
@@ -3977,7 +4291,6 @@ if test ${TARGET} = ARM; then
#ifdef __SOFTFP__
#error "Float ABI is not 'softfp'"
#endif
return 0;
], [
fpu=VFP
], [
@@ -4002,7 +4315,6 @@ if test ${TARGET} = ARM; then
#if !defined(__ARM_ARCH_5T__) && !defined(__ARM_ARCH_5TE__) && !defined(__ARM_ARCH_5TEJ__)
#error Not on ARM v5.
#endif
return 0;
], [
arm_v5=yes
@@ -4013,7 +4325,6 @@ if test ${TARGET} = ARM; then
#if !defined(__ARM_ARCH_6J__) && !defined(__ARM_ARCH_6ZK__) && !defined(__ARM_ARCH_6K__) && !defined(__ARM_ARCH_6T2__) && !defined(__ARM_ARCH_6M__)
#error Not on ARM v6.
#endif
return 0;
], [
arm_v5=yes
arm_v6=yes
@@ -4025,7 +4336,6 @@ if test ${TARGET} = ARM; then
#if !defined(__ARM_ARCH_7A__) && !defined(__ARM_ARCH_7R__) && !defined(__ARM_ARCH_7EM__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7S__)
#error Not on ARM v7.
#endif
return 0;
], [
arm_v5=yes
arm_v6=yes
@@ -4178,7 +4488,7 @@ fi
AM_CONDITIONAL([ENABLE_COOP], [test x$with_cooperative_gc != xno])
AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable checked build (expensive asserts), configure with a comma-separated LIST of checked build modules and then include that same list in the environment variable MONO_CHECK_MODE at runtime. Recognized checked build modules: all, gc, metadata, thread],[
AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable checked build (expensive asserts), configure with a comma-separated LIST of checked build modules and then include that same list in the environment variable MONO_CHECK_MODE at runtime. Recognized checked build modules: all, gc, metadata, thread, private_types],[
if test x$enable_checked_build != x ; then
AC_DEFINE(ENABLE_CHECKED_BUILD,1,[Enable checked build])
@@ -4191,6 +4501,7 @@ AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable check
eval "mono_checked_build_test_enable_gc='yes'"
eval "mono_checked_build_test_enable_metadata='yes'"
eval "mono_checked_build_test_enable_thread='yes'"
eval "mono_checked_build_test_enable_private_types='yes'"
fi
if test "x$mono_checked_build_test_enable_gc" = "xyes"; then
@@ -4205,6 +4516,9 @@ AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable check
AC_DEFINE(ENABLE_CHECKED_BUILD_THREAD, 1, [Enable thread checked build])
fi
if test "x$mono_checked_build_test_enable_private_types" = "xyes"; then
AC_DEFINE(ENABLE_CHECKED_BUILD_PRIVATE_TYPES, 1, [Enable private types checked build])
fi
], [])
AC_CHECK_HEADER([malloc.h],
@@ -4277,23 +4591,31 @@ if test "x$enable_btls" = "xyes"; then
aarch64)
btls_arch=aarch64
;;
powerpc)
btls_arch=powerpc
case $host_os in
aix*|os400*)
btls_cflags="$btls_cflags -maix64 -mminimal-toc -pthread -D_ALL_SOURCE -D_THREAD_SAFE -D_REENTRANT"
BTLS_CMAKE_ARGS="-DCMAKE_AR=/usr/bin/ar -DCMAKE_C_ARCHIVE_CREATE=\"<CMAKE_AR> -X64 cr <TARGET> <LINK_FLAGS> <OBJECTS>\""
esac
;;
android-armv5)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=12"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=14"
;;
android-armv6)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=12"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=14"
;;
android-armv7)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=12"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=14"
;;
android-v8a)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=12"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=21"
;;
android-x86)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=12"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=14"
;;
android-x64)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=12"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=21"
;;
*)
AC_MSG_ERROR(Invalid BTLS platform)
@@ -4335,6 +4657,7 @@ AC_SUBST(docs_dir)
## Maybe should also disable if mcsdir is invalid. Let's punt the issue for now.
AM_CONDITIONAL(BUILD_MCS, [test x$cross_compiling = xno && test x$enable_mcs_build != xno])
AM_CONDITIONAL(BUILD_SUPPORT, [test x$enable_support_build != xno])
libmono_ldflags="$libmono_ldflags $LIBS"
@@ -4382,7 +4705,7 @@ AC_SUBST(mono_build_root)
mono_runtime=mono/mini/mono
AC_SUBST(mono_runtime)
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.2/tools/csc.exe
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.7.0/tools/csc.exe
if test $csc_compiler = mcs; then
CSC=$mcs_topdir/class/lib/build/mcs.exe
@@ -4578,6 +4901,7 @@ scripts/mono-find-requires
mono/Makefile
mono/btls/Makefile
mono/utils/Makefile
mono/utils/jemalloc/Makefile
mono/metadata/Makefile
mono/dis/Makefile
mono/cil/Makefile
@@ -4760,6 +5084,11 @@ fi
if test "x$AOT_BUILD_FLAGS" != "x" ; then
echo "AOT_RUN_FLAGS=$AOT_RUN_FLAGS" >> $srcdir/$mcsdir/build/config.make
echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS" >> $srcdir/$mcsdir/build/config.make
echo "AOT_BUILD_ATTRS=$AOT_BUILD_ATTRS" >> $srcdir/$mcsdir/build/config.make
fi
if test "x$AOT_MODE" != "x" ; then
echo "AOT_MODE=$AOT_MODE" >> $srcdir/$mcsdir/build/config.make
fi
if test "x$enable_btls" = "xyes"; then
@@ -4795,7 +5124,7 @@ echo "
BigArrays: $enable_big_arrays
DTrace: $enable_dtrace
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm)
Interpreter: $enable_interpreter
Spectre: $spectre_mitigation_status
Libraries:
.NET 4.x: $with_profile4_x
@@ -4807,11 +5136,13 @@ echo "
Windows AOT: $with_winaot
Orbis: $with_orbis
Unreal: $with_unreal
WebAssembly: $with_wasm
Test profiles: AOT Full ($with_testing_aot_full), AOT Hybrid ($with_testing_aot_hybrid)
JNI support: $jdk_headers_found
libgdiplus: $libgdiplus_msg
zlib: $zlib_msg
BTLS: $enable_btls$btls_platform_string
jemalloc: $with_jemalloc (always use: $with_jemalloc_always)
$disabled
"
if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
+1
View File
@@ -40,4 +40,5 @@
<dllmap dll="gdiplus.dll" target="@libgdiplus_install_loc@" os="!windows"/>
<dllmap dll="gdi32" target="@libgdiplus_install_loc@" os="!windows"/>
<dllmap dll="gdi32.dll" target="@libgdiplus_install_loc@" os="!windows"/>
<dllmap dll="System.Native" target="__Internal"/>
</configuration>
+2 -2
View File
@@ -11,9 +11,9 @@ def print_frames(thread, num_frames, current_thread):
pc = str(frame.addr)
var = frame
function_name = frame.GetFunctionName()
if function_name == "ves_exec_method_with_context":
if function_name == "interp_exec_method_full":
try:
s = 'frame->runtime_method->method'
s = 'frame->imethod->method'
klassname = frame.EvaluateExpression('(char*) ' + s + '->klass->name').summary[1:-1]
methodname = frame.EvaluateExpression('(char*) ' + s + '->name').summary[1:-1]
+1 -1
View File
@@ -11,11 +11,11 @@
<section name="assemblyBinding" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
<section name="satelliteassemblies" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
<section name="startup" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false"/>
<section name="system.codedom" type="System.CodeDom.Compiler.CodeDomConfigurationHandler, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.data" type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.diagnostics" type="System.Diagnostics.SystemDiagnosticsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.runtime.remoting" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
<section name="system.windows.forms" type="System.Windows.Forms.WindowsFormsSection, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.codedom" type="System.CodeDom.Compiler.CodeDomConfigurationHandler, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="windows" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
<section name="strongNames" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
<sectionGroup name="system.runtime.serialization" type="System.Runtime.Serialization.Configuration.SerializationSectionGroup, System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+10
View File
@@ -43,6 +43,16 @@
line-height: 0px;
}
.mapi-codeblock {
display: block;
padding: 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
border: 1px solid rgba(233,233,233,1);
background-color: rgba(249,249,249,1);
}
.mapi-entry code {
border: none;
background-color: transparent;
+2 -2
View File
@@ -13,10 +13,10 @@ ASSEMBLED_DOCS = \
monoapi.tree monoapi.zip
convert.exe: $(srcdir)/convert.cs AgilityPack.dll
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -out:$@ $< -r:AgilityPack.dll
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -out:$@ $< -r:AgilityPack.dll
AgilityPack.dll:
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
$(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
monoapi.zip: monoapi.tree
@test -f $@ || { rm -f $< && $(MAKE) $<; }
+1 -1
View File
@@ -69,5 +69,5 @@ object for filters is passed in a local variable (cfg->exvar).
throw: we first save all regs into a sigcontext struct and then call the stack
unwinding code.
catch handler: catch hanlders are always called from the stack unwinding
catch handler: catch handlers are always called from the stack unwinding
code. The exception object is passed in a local variable (cfg->exvar).
+20 -4
View File
@@ -124,6 +124,7 @@ sub process_function {
my $body = '';
my $returns = '';
my $prototype = '';
my $codeblock = 'false';
while (<$file>) {
@@ -156,7 +157,6 @@ sub process_function {
if (defined($deprecated)) {
process_formatting(\$deprecated, $file_path, $.);
}
$body =~ s/\n/ /g;
if (exists($docs->{body}->{$name})) {
my $origin = $docs->{origin}->{$name};
@@ -180,8 +180,16 @@ sub process_function {
chomp;
s/^ +\*//;
# Replace blank lines with paragraph breaks.
$_ = '<p>' if /^\s*$/;
if (/\s*\\code$/) {
$codeblock = 'true';
} elsif (/\s*\\endcode$/) {
$codeblock = 'false';
}
# Replace blank lines with paragraph breaks if we're not in a code block.
if (/^\s*$/) {
$_ = '<p>' if $codeblock eq 'false';
}
if ($section == $PARAMETER_SECTION) {
if (/\s*\\param +(\w+)(.*)/) {
@@ -210,7 +218,7 @@ sub process_function {
$returns = "\t$_\n";
$section = $RETURN_SECTION;
} else {
$body .= "\n\t$_";
$body .= "\n$_";
}
} elsif ($section == $RETURN_SECTION) {
$returns .= "\n\t$_";
@@ -227,6 +235,12 @@ sub process_formatting {
my ($content, $file_path, $current_line) = @_;
$_ = $$content;
# General formatting
s{\\b +(\w+)}{<strong>$1</strong>}g;
s{\\a +(\w+)}{<i>$1</i>}g;
s{\\e +(\w+)}{<i>$1</i>}g;
s{\\em +(\w+)}{<i>$1</i>}g;
# Constants
s{NULL}{<code>NULL</code>}g;
s{TRUE}{<code>TRUE</code>}g;
@@ -243,6 +257,8 @@ sub process_formatting {
warn "$file_path:$current_line: Old-style monodoc notation '`code`' used\n"
if s{\`((?!api:)[:.\w\*]+)\`}{<code>$1</code>}g && $WARNINGS;
s{\\c +(\S+(?<![.,:;]))}{<code>$1</code>}g;
s{\\code}{<pre><code class="mapi-codeblock">}g;
s{\\endcode}{</code></pre>}g;
$$content = $_;
}
+181 -61
View File
@@ -1,73 +1,193 @@
<h1>Profiling Interface</h1>
<h1>Runtime Profiler API</h1>
<h3>Profiler Operation</h3>
<p>The profiler API can be used by dynamically loaded profiler
modules to monitor different aspects of a running program. The
API is also usable by embedders without having to compile a
profiler module.
<p>The following methods can be used by dynamic profiler
methods to monitor different aspects of the program.
<h2>Profiler Modules</h2>
<p>A custom profiler will have one public method defined in
the shared library which is the entry point that Mono calls at
startup, it has the following signature:
<p>A profiler module is simply a shared library with a single
exported function which is the entry point that Mono calls at
startup. It must have the following signature:
<pre>
void mono_profiler_startup (const char *desc)
</pre>
<pre><code class="mapi-codeblock">
void mono_profiler_startup_example (const char *desc)
</code></pre>
<p>Where "desc" is the set of arguments that were passed from
the command line. This routine will call
<tt>mono_profiler_install</tt> to activate the profiler and
will install one or more filters (one of the various
<tt>mono_profiler_install_</tt> functions).
<p>Here, the <code>example</code> portion of the function name is
the name of the profiler module. It must match the shared library
name (i.e. <code>libmono-profiler-example.so</code>). <i>desc</i>
is the set of arguments that were passed from the command line.
<p>In addition, a profiler developer will typically call
<tt>mono_profiler_set_events</tt> to register which kinds of
traces should be enabled, these can be an OR-ed combination of
the following:
<p>For example, a bare bones profiler module might look like this
(<code>example.c</code>):
<pre>
MONO_PROFILE_NONE
MONO_PROFILE_APPDOMAIN_EVENTS
MONO_PROFILE_ASSEMBLY_EVENTS
MONO_PROFILE_MODULE_EVENTS
MONO_PROFILE_CLASS_EVENTS
MONO_PROFILE_JIT_COMPILATION
MONO_PROFILE_INLINING
MONO_PROFILE_EXCEPTIONS
MONO_PROFILE_ALLOCATIONS
MONO_PROFILE_GC
MONO_PROFILE_THREADS
MONO_PROFILE_REMOTING
MONO_PROFILE_TRANSITIONS
MONO_PROFILE_ENTER_LEAVE
MONO_PROFILE_COVERAGE
MONO_PROFILE_INS_COVERAGE
MONO_PROFILE_STATISTICAL
</pre>
<pre><code class="mapi-codeblock">
#include &lt;mono/metadata/profiler.h&gt;
#include &lt;stdio.h&gt;
<p>Developers can change the set of monitored events at
runtime by calling <tt>mono_profiler_set_events</tt>.
<h4><a name="api:mono_profiler_install">mono_profiler_install</a></h4>
<h4><a name="api:mono_profiler_install_allocation">mono_profiler_install_allocation</a></h4>
<h4><a name="api:mono_profiler_install_appdomain">mono_profiler_install_appdomain</a></h4>
<h4><a name="api:mono_profiler_install_assembly">mono_profiler_install_assembly</a></h4>
<h4><a name="api:mono_profiler_install_class">mono_profiler_install_class</a></h4>
<h4><a name="api:mono_profiler_install_coverage_filter">mono_profiler_install_coverage_filter</a></h4>
<h4><a name="api:mono_profiler_install_enter_leave">mono_profiler_install_enter_leave</a></h4>
<h4><a name="api:mono_profiler_install_jit_compile">mono_profiler_install_jit_compile</a></h4>
<h4><a name="api:mono_profiler_install_module">mono_profiler_install_module</a></h4>
<h4><a name="api:mono_profiler_install_thread">mono_profiler_install_thread</a></h4>
<h4><a name="api:mono_profiler_install_transition">mono_profiler_install_transition</a></h4>
<h4><a name="api:mono_profiler_install_gc">mono_profiler_install_gc</a></h4>
<h4><a name="api:mono_profiler_install_statistical">mono_profiler_install_statistical</a></h4>
<h4><a name="api:mono_profiler_set_events">mono_profiler_set_events</a></h4>
<h4><a name="api:mono_profiler_get_events">mono_profiler_get_events</a></h4>
struct _MonoProfiler {
int dummy;
}
<h3>Coverage</h3>
static MonoProfiler profiler;
<p>To support profiling modules that need to do code coverage
analysis, the following routines is provided:
<h4><a name="api:mono_profiler_coverage_get">mono_profiler_coverage_get</a></h4>
static void
runtime_inited (MonoProfiler *prof)
{
printf ("Hello World");
}
void
mono_profiler_init_example (const char *desc)
{
MonoProfilerHandle handle = mono_profiler_create (&amp;profiler);
mono_profiler_set_runtime_initialized_callback (handle, runtime_inited);
}
</code></pre>
<p>To compile this module, a C compiler must be invoked in a
similar fashion to this, on Linux:
<pre><code class="mapi-codeblock">
gcc -fPIC -shared -o libmono-profiler-example.so example.c `pkg-config --cflags mono-2`
</code></pre>
<p>Or on OS X:
<pre><code class="mapi-codeblock">
gcc -undefined suppress -flat_namespace -o libmono-profiler-example.so example.c `pkg-config --cflags mono-2`
</code></pre>
<p>You can then load the module using:
<pre><code class="mapi-codeblock">
mono --profile=example hello.exe
</code></pre>
<p>(Note that adjusting <code>LD_LIBRARY_PATH</code> may be
necessary in order for the dynamic linker to find the module.)
<h2>Profiler Functions</h2>
<p>These are the functions usable for profiling programs.
<p>Each function has a note indicating whether they're async
safe. An async safe function can be invoked in a signal handler
or when the world is stopped by the GC. Conversely, a function
that is not async safe must not be invoked in such a context or
undefined behavior can occur (crashes, deadlocks, etc).
<p>Some functions may only be invoked from a profiler module's
init function (or prior to running managed code in the case of
embedding). This is noted explicitly only if applicable to a
function.
<h3>Basic Functions</h3>
<p>These functions are used to load and install profilers.
<h4><a name="api:mono_profiler_load">mono_profiler_load</a></h4>
<h4><a name="api:mono_profiler_create">mono_profiler_create</a></h4>
<h4><a name="api:mono_profiler_set_cleanup_callback">mono_profiler_set_cleanup_callback</a></h4>
<h3>Code Coverage</h3>
<p>These functions provide access to the JIT compiler's code
coverage support. This functionality can be used to collect
information about how many times certain code paths have been
executed.
<h4><a name="api:mono_profiler_enable_coverage">mono_profiler_enable_coverage</a></h4>
<h4><a name="api:mono_profiler_set_coverage_filter_callback">mono_profiler_set_coverage_filter_callback</a></h4>
<h4><a name="api:mono_profiler_get_coverage_data">mono_profiler_get_coverage_data</a></h4>
<h3>Statistical Sampling</h3>
<p>Statistical sampling can be used to interrupt managed threads
based on a certain mode and frequency for the purpose of
collecting data about their current work.
<p>One common use case for this functionality, usually referred
to as call sampling, is to collect a backtrace from every thread
when a sampling hit event arrives. This data can then be compiled
into a report indicating where a program spends most of its time.
<h4><a name="api:mono_profiler_enable_sampling">mono_profiler_enable_sampling</a></h4>
<h4><a name="api:mono_profiler_set_sample_mode">mono_profiler_set_sample_mode</a></h4>
<h4><a name="api:mono_profiler_get_sample_mode">mono_profiler_get_sample_mode</a></h4>
<p>A callback must be registered to receive sample hit events.
Please see the <i>Callback Registration</i> section below.
<h3>GC Allocations</h3>
<p>Profilers can be notified about all GC allocations performed
by a program or the Mono runtime.
<h4><a name="api:mono_profiler_enable_allocations">mono_profiler_enable_allocations</a></h4>
<p>A callback must be registered to receive allocation events.
Please see the <i>Callback Registration</i> section below.
<h3>Call Instrumentation</h3>
<p>The JIT compiler supports instrumenting managed method entry
and exit points so that a profiler callback will be invoked.
<p>While such callbacks by themselves have traditionally only
been useful for call count profiling and the like, Mono gives
these callbacks access to the arguments, locals, and return
value of instrumented methods (together referred to as the 'call
context'). This enables many profiling scenarios that would
otherwise have required explicit hooks in the base class
libraries.
<h4><a name="api:mono_profiler_set_call_instrumentation_filter_callback">mono_profiler_set_call_instrumentation_filter_callback</a></h4>
<h4><a name="api:mono_profiler_enable_call_context_introspection">mono_profiler_enable_call_context_introspection</a></h4>
<h4><a name="api:mono_profiler_call_context_get_this">mono_profiler_call_context_get_this</a></h4>
<h4><a name="api:mono_profiler_call_context_get_argument">mono_profiler_call_context_get_argument</a></h4>
<h4><a name="api:mono_profiler_call_context_get_local">mono_profiler_call_context_get_local</a></h4>
<h4><a name="api:mono_profiler_call_context_get_result">mono_profiler_call_context_get_result</a></h4>
<h4><a name="api:mono_profiler_call_context_free_buffer">mono_profiler_call_context_free_buffer</a></h4>
<p>Callbacks must be registered to receive method entry and exit
events. Please see the <i>Callback Registration</i> section
below.
<h3>Callback Registration</h3>
<p>In addition to the above functions, there's a large set of
functions for installing generic profiler event callbacks. These
are generated from C macros and so are not documented here.
Please refer to the <code>mono/metadata/profiler.h</code> and
<code>mono/metadata/profiler-events.h</code> headers for a full
listing of these.
<p>Callback registration functions are all async safe and can be
safely invoked from multiple threads at the same time, with the
caveat that altering a registered callback from one thread will
not immediately affect another thread that is already invoking
the current callback.
<h2>API Stability</h2>
<p>The profiler API does not have the same API stability
garantees that the rest of the Mono embedding API does. While
a breaking change to the profiler API is extremely rare, it has
happened in the past when changing the API in a backwards
compatible way was deemed to be too much work for too little
gain.
<p>Therefore, developers of profiler modules may rarely need to
update their code to work with new versions of the profiler API.
<p>Developers who wish to support older versions of the API can
perform a compile time check of the
<code>MONO_PROFILER_API_VERSION</code> macro and maintain code
for both old and new versions.
<p>To aid with transitioning to a new version of the profiler
API, the Mono runtime will detect and reject loading profiler
modules which were compiled against older profiler API versions.
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
View File
@@ -49,7 +49,7 @@ obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
backgraph.c win32_threads.c \
pthread_support.c pthread_stop_world.c darwin_stop_world.c \
openbsd_stop_world.c mach_dep.c $(asm_libgc_sources)
mach_dep.c $(asm_libgc_sources)
# Include THREADDLLIBS here to ensure that the correct versions of
# linuxthread semaphore functions get linked:
+4
View File
@@ -104,6 +104,10 @@ case "$THREADS" in
AC_DEFINE(GC_AIX_THREADS)
AC_DEFINE(_REENTRANT)
;;
*-*-haiku*)
AC_DEFINE(GC_HAIKU_THREADS)
AC_DEFINE(_REENTRANT)
;;
*-*-hpux*)
AC_MSG_WARN("Only HP/UX 11 threads are supported.")
AC_DEFINE(GC_HPUX_THREADS)
+18 -1
View File
@@ -59,7 +59,7 @@
!(defined(FREEBSD) && defined(__ELF__)) && \
!(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) && \
!(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
!defined(DARWIN)
!defined(DARWIN) && !defined(HAIKU)
--> We only know how to find data segments of dynamic libraries for the
--> above. Additional SVR4 variants might not be too
--> hard to add.
@@ -1258,6 +1258,23 @@ GC_bool GC_register_main_static_data()
#endif /* DARWIN */
#if defined(HAIKU)
#include <kernel/image.h>
void GC_register_dynamic_libraries()
{
image_info info;
int32 cookie = 0;
while (get_next_image_info(0, &cookie, &info) == B_OK)
{
void *data = info.data;
GC_add_roots_inner(data, data + info.data_size, TRUE);
}
}
#endif /* HAIKU */
#else /* !DYNAMIC_LOADING */
#ifdef PCR
+12
View File
@@ -835,6 +835,18 @@ typedef GC_PTR (*GC_fn_type) GC_PROTO((GC_PTR client_data));
GC_API GC_PTR GC_call_with_alloc_lock
GC_PROTO((GC_fn_type fn, GC_PTR client_data));
/*
* These are similar to GC_do_blocking () in upstream bdwgc. The design is
* simpler in that there is no distinction between active and inactive stack
* frames; instead, while a thread is in blocking state, it promises to not
* interact with the GC at all, and to not keep any pointers to GC memory
* around from before entering blocking state. Additionally, these can be
* called unbalanced (they simply set a flag internally).
*/
GC_API void GC_start_blocking GC_PROTO((void));
GC_API void GC_end_blocking GC_PROTO((void));
/* The following routines are primarily intended for use with a */
/* preprocessor which inserts calls to check C pointer arithmetic. */
/* They indicate failure by invoking the corresponding _print_proc. */
+1 -1
View File
@@ -57,7 +57,7 @@
defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
defined(GC_AIX_THREADS) || defined(GC_NETBSD_THREADS) || \
defined(GC_OPENBSD_THREADS) || \
defined(GC_OPENBSD_THREADS) || defined(GC_HAIKU_THREADS) ||\
(defined(GC_WIN32_THREADS) && defined(__CYGWIN32__))
# define GC_PTHREADS
# endif
+2
View File
@@ -1979,6 +1979,8 @@ void GC_err_puts GC_PROTO((GC_CONST char *s));
/* Linuxthreads itself uses SIGUSR1 and SIGUSR2. */
# define SIG_SUSPEND SIGPWR
# endif
# elif defined(GC_OPENBSD_THREADS)
# define SIG_SUSPEND SIGXFSZ
# else /* !GC_LINUX_THREADS */
# if defined(_SIGRTMIN)
# define SIG_SUSPEND _SIGRTMIN + 6
+32 -1
View File
@@ -238,6 +238,16 @@
# define BEOS
# define mach_type_known
# endif
# if defined(__HAIKU__) && defined(_X86_)
# define I386
# define HAIKU
# define mach_type_known
# endif
# if defined(__HAIKU__) && defined(__amd64__)
# define X86_64
# define HAIKU
# define mach_type_known
# endif
# if defined(LINUX) && (defined(i386) || defined(__i386__))
# define I386
# define mach_type_known
@@ -1164,6 +1174,15 @@
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# endif
# ifdef HAIKU
# define OS_TYPE "HAIKU"
# include <OS.h>
# define GETPAGESIZE() B_PAGE_SIZE
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# define DYNAMIC_LOADING
# define MPROTECT_VDB
# endif
# ifdef SUNOS5
# define OS_TYPE "SUNOS5"
extern int _etext[], _end[];
@@ -2134,6 +2153,15 @@
/* There seems to be some issues with trylock hanging on darwin. This
should be looked into some more */
# endif
# ifdef HAIKU
# define OS_TYPE "HAIKU"
# include <OS.h>
# define GETPAGESIZE() B_PAGE_SIZE
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# define DYNAMIC_LOADING
# define MPROTECT_VDB
# endif
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
# ifndef GC_FREEBSD_THREADS
@@ -2251,7 +2279,7 @@
# if defined(SVR4) || defined(LINUX) || defined(IRIX5) || defined(HPUX) \
|| defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
|| defined(DGUX) || defined(BSD) || defined(SUNOS4) \
|| defined(_AIX) || defined(DARWIN) || defined(OSF1)
|| defined(_AIX) || defined(DARWIN) || defined(OSF1) || defined(HAIKU)
# define UNIX_LIKE /* Basic Unix-like system calls work. */
# endif
@@ -2507,6 +2535,9 @@
# if defined(SN_TARGET_PS3)
extern void *ps3_get_mem (size_t size);
# define GET_MEM(bytes) (struct hblk*) ps3_get_mem (bytes)
# elif defined(HAIKU)
ptr_t GC_haiku_get_mem(GC_word bytes);
# define GET_MEM(bytes) (struct hblk*)GC_haiku_get_mem(bytes)
# else
extern ptr_t GC_unix_get_mem(word size);
# define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes)
@@ -1,12 +0,0 @@
#ifndef GC_OPENBSD_STOP_WORLD_H
#define GC_OPENBSD_STOP_WORLD_H
#if !defined(GC_OPENBSD_THREADS)
#error openbsd_stop_world.h included without GC_OPENBSD_THREADS defined
#endif
struct thread_stop_info {
ptr_t stack_ptr; /* Valid only when stopped. */
};
#endif
-2
View File
@@ -8,8 +8,6 @@
#if defined(GC_DARWIN_THREADS)
# include "private/darwin_stop_world.h"
#elif defined(GC_OPENBSD_THREADS)
# include "private/openbsd_stop_world.h"
#else
# include "private/pthread_stop_world.h"
#endif
-161
View File
@@ -1,161 +0,0 @@
#include "private/pthread_support.h"
/* derived from pthread_stop_world.c */
# if defined(GC_OPENBSD_THREADS)
#define THREAD_EQUAL(id1, id2) pthread_equal(id1, id2)
/* We hold allocation lock. Should do exactly the right thing if the */
/* world is stopped. Should not fail if it isn't. */
void GC_push_all_stacks()
{
GC_bool found_me = FALSE;
size_t nthreads = 0;
int i;
GC_thread p;
ptr_t lo, hi;
pthread_t me = pthread_self();
if (!GC_thr_initialized) GC_thr_init();
# if DEBUG_THREADS
GC_printf("Pushing stacks from thread 0x%x\n", (unsigned) me);
# endif
for (i = 0; i < THREAD_TABLE_SZ; i++) {
for (p = GC_threads[i]; p != 0; p = p -> next) {
if (p -> flags & FINISHED) continue;
++nthreads;
if (THREAD_EQUAL(p -> id, me)) {
# ifdef SPARC
lo = (ptr_t)GC_save_regs_in_stack();
# else
lo = GC_approx_sp();
# endif
found_me = TRUE;
} else {
lo = p -> stop_info.stack_ptr;
}
if ((p -> flags & MAIN_THREAD) == 0) {
hi = p -> stack_end;
} else {
/* The original stack. */
hi = GC_stackbottom;
}
# if DEBUG_THREADS
GC_printf("Stack for thread 0x%x = [%p,%p)\n",
(unsigned)(p -> id), lo, hi);
# endif
if (0 == lo) ABORT("GC_push_all_stacks: sp not set!\n");
# ifdef STACK_GROWS_UP
/* We got them backwards! */
GC_push_all_stack(hi, lo);
# else
GC_push_all_stack(lo, hi);
# endif
}
}
if (!found_me && !GC_in_thread_creation)
ABORT("Collecting from unknown thread.");
}
/* We hold the allocation lock. Suspend all threads that might */
/* still be running. */
void GC_suspend_all()
{
int i;
GC_thread p;
int result;
pthread_t my_thread = pthread_self();
for (i = 0; i < THREAD_TABLE_SZ; i++) {
for (p = GC_threads[i]; p != 0; p = p -> next) {
if (!THREAD_EQUAL(p -> id, my_thread)) {
if (p -> flags & FINISHED) continue;
if (p -> thread_blocked) /* Will wait */ continue;
# if DEBUG_THREADS
GC_printf("Suspending thread 0x%x\n",
(unsigned)(p -> id));
# endif
if (pthread_suspend_np(p -> id) != 0)
ABORT("pthread_suspend_np failed");
/*
* This will only work for userland pthreads. It will
* fail badly on rthreads. Perhaps we should consider
* a pthread_sp_np() function that returns the stack
* pointer for a suspended thread and implement in
* both pthreads and rthreads.
*/
p -> stop_info.stack_ptr = *(ptr_t*)((char *)p -> id + UTHREAD_SP_OFFSET);
}
}
}
}
void GC_stop_world()
{
int i;
GC_ASSERT(I_HOLD_LOCK());
# if DEBUG_THREADS
GC_printf("Stopping the world from 0x%x\n", (unsigned)pthread_self());
# endif
/* Make sure all free list construction has stopped before we start. */
/* No new construction can start, since free list construction is */
/* required to acquire and release the GC lock before it starts, */
/* and we have the lock. */
# ifdef PARALLEL_MARK
GC_acquire_mark_lock();
GC_ASSERT(GC_fl_builder_count == 0);
/* We should have previously waited for it to become zero. */
# endif /* PARALLEL_MARK */
GC_suspend_all();
# ifdef PARALLEL_MARK
GC_release_mark_lock();
# endif
#if DEBUG_THREADS
GC_printf("World stopped from 0x%x\n", (unsigned)pthread_self());
#endif
}
/* Caller holds allocation lock, and has held it continuously since */
/* the world stopped. */
void GC_start_world()
{
pthread_t my_thread = pthread_self();
register int i;
register GC_thread p;
register int result;
# if DEBUG_THREADS
GC_printf("World starting\n");
# endif
for (i = 0; i < THREAD_TABLE_SZ; i++) {
for (p = GC_threads[i]; p != 0; p = p -> next) {
if (!THREAD_EQUAL(p -> id, my_thread)) {
if (p -> flags & FINISHED) continue;
if (p -> thread_blocked) continue;
#if DEBUG_THREADS
GC_printf("Resuming thread 0x%x\n",
(unsigned)(p -> id));
#endif
if (pthread_resume_np(p -> id) != 0)
ABORT("pthread_kill failed");
}
}
}
# if DEBUG_THREADS
GC_printf("World started\n");
# endif
}
void GC_stop_init() {
}
#endif
+31 -9
View File
@@ -609,7 +609,7 @@ void GC_enable_signals(void)
&& !defined(MACOS) && !defined(DJGPP) && !defined(DOS4GW) \
&& !defined(NOSYS) && !defined(ECOS) && !defined(SN_TARGET_PS3)
# if defined(sigmask) && !defined(UTS4) && !defined(HURD)
# if defined(sigmask) && !defined(UTS4) && !defined(HURD) && !defined(HAIKU)
/* Use the traditional BSD interface */
# define SIGSET_T int
# define SIG_DEL(set, signal) (set) &= ~(sigmask(signal))
@@ -764,14 +764,14 @@ ptr_t GC_get_stack_base()
# endif /* MS Windows */
# ifdef BEOS
# ifdef HAIKU
# include <kernel/OS.h>
ptr_t GC_get_stack_base(){
thread_info th;
get_thread_info(find_thread(NULL),&th);
return th.stack_end;
}
# endif /* BEOS */
# endif /* HAIKU */
# ifdef OS2
@@ -1122,7 +1122,7 @@ void *GC_set_stackbottom = NULL;
#endif /* FREEBSD_STACKBOTTOM */
#if !defined(BEOS) && !defined(AMIGA) && !defined(MSWIN32) \
#if !defined(HAIKU) && !defined(AMIGA) && !defined(MSWIN32) \
&& !defined(MSWINCE) && !defined(OS2) && !defined(NOSYS) && !defined(ECOS) \
&& !defined(GC_OPENBSD_THREADS)
@@ -1182,7 +1182,7 @@ ptr_t GC_get_stack_base()
# endif /* STACKBOTTOM */
}
# endif /* ! AMIGA, !OS 2, ! MS Windows, !BEOS, !NOSYS, !ECOS */
# endif /* ! AMIGA, !OS 2, ! MS Windows, !HAIKU, !NOSYS, !ECOS */
#if defined(GC_OPENBSD_THREADS)
@@ -1957,6 +1957,19 @@ word bytes;
}
# endif
#if defined(HAIKU)
#include <stdlib.h>
ptr_t GC_haiku_get_mem(word bytes)
{
void* mem;
if (posix_memalign(&mem, GC_page_size, bytes) == 0)
return mem;
else
return NULL;
}
#endif
#ifdef USE_MUNMAP
/* For now, this only works on Win32/WinCE and some Unix-like */
@@ -2393,7 +2406,9 @@ GC_bool is_ptrfree;
# include <sys/mman.h>
# include <signal.h>
# include <sys/syscall.h>
# if !defined(HAIKU)
# include <sys/syscall.h>
# endif
# define PROTECT(addr, len) \
if (mprotect((caddr_t)(addr), (size_t)(len), \
@@ -2450,13 +2465,13 @@ GC_bool is_ptrfree;
#endif /* SUNOS4 || (FREEBSD && !SUNOS5SIGS) */
#if defined(SUNOS5SIGS) || defined(OSF1) || defined(LINUX) \
|| defined(HURD)
|| defined(HURD) || defined(HAIKU)
# ifdef __STDC__
typedef void (* SIG_PF)(int);
# else
typedef void (* SIG_PF)();
# endif
#endif /* SUNOS5SIGS || OSF1 || LINUX || HURD */
#endif /* SUNOS5SIGS || OSF1 || LINUX || HURD || HAIKU */
#if defined(MSWIN32)
typedef LPTOP_LEVEL_EXCEPTION_FILTER SIG_PF;
@@ -2634,6 +2649,13 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
/* architectures. */
# endif /* LINUX */
# if defined(HAIKU)
# include <errno.h>
# define CODE_OK TRUE
# define SIG_OK (sig == SIGSEGV)
void GC_write_failt_handler(int sig, siginfo_t *scp, void * context)
#endif /* HAIKU */
# if defined(SUNOS5SIGS)
# ifdef __STDC__
void GC_write_fault_handler(int sig, SIGINFO_T *scp, void * context)
@@ -2679,7 +2701,7 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
# if defined(OSF1) && defined(ALPHA)
char * addr = (char *) (scp -> sc_traparg_a0);
# endif
# ifdef SUNOS5SIGS
# if defined(SUNOS5SIGS) || defined(HAIKU)
char * addr = (char *) (scp -> si_addr);
# endif
# ifdef LINUX
+1 -2
View File
@@ -2,8 +2,7 @@
#if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
&& !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS) \
&& !defined(GC_DARWIN_THREADS) && !defined(GC_AIX_THREADS) \
&& !defined(GC_OPENBSD_THREADS)
&& !defined(GC_DARWIN_THREADS) && !defined(GC_AIX_THREADS)
#include <signal.h>
#include <semaphore.h>
+1 -3
View File
@@ -1135,7 +1135,7 @@ void GC_thr_init()
# if defined(GC_HPUX_THREADS)
GC_nprocs = pthread_num_processors_np();
# endif
# if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS)
# if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) || defined(GC_HAIKU_THREADS)
GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN);
if (GC_nprocs <= 0) GC_nprocs = 1;
# endif
@@ -1245,7 +1245,6 @@ void GC_start_blocking(void) {
GC_thread me;
LOCK();
me = GC_lookup_thread(pthread_self());
GC_ASSERT(!(me -> thread_blocked));
# ifdef SPARC
me -> stop_info.stack_ptr = (ptr_t)GC_save_regs_in_stack();
# else
@@ -1273,7 +1272,6 @@ void GC_end_blocking(void) {
GC_thread me;
LOCK(); /* This will block if the world is stopped. */
me = GC_lookup_thread(pthread_self());
GC_ASSERT(me -> thread_blocked);
me -> thread_blocked = FALSE;
UNLOCK();
}
+47 -1
View File
@@ -48,6 +48,7 @@ struct GC_thread_Rep {
/* 0 ==> entry not valid. */
/* !in_use ==> stack_base == 0 */
GC_bool suspended;
GC_bool thread_blocked;
# ifdef CYGWIN32
void *status; /* hold exit value until join in case it's a pointer */
@@ -174,6 +175,7 @@ static GC_thread GC_new_thread(void) {
/* the world, wait here. Hopefully this can't happen on any */
/* systems that don't allow us to block here. */
while (GC_please_stop) Sleep(20);
GC_ASSERT(!thread_table[i]->thread_blocked);
return thread_table + i;
}
@@ -223,7 +225,6 @@ static void GC_delete_thread(DWORD thread_id) {
}
}
#ifdef CYGWIN32
/* Return a GC_thread corresponding to a given pthread_t. */
@@ -245,6 +246,20 @@ static GC_thread GC_lookup_thread(pthread_t id)
return thread_table + i;
}
#else
static GC_thread GC_lookup_thread(DWORD id)
{
int i;
LONG max = GC_get_max_thread_index();
for (i = 0; i <= max; i++)
if (thread_table[i].in_use && thread_table[i].id == id)
return &thread_table[i];
return NULL;
}
#endif /* CYGWIN32 */
void GC_push_thread_structures GC_PROTO((void))
@@ -264,6 +279,35 @@ void GC_push_thread_structures GC_PROTO((void))
# endif
}
/* Wrappers for functions that are likely to block for an appreciable */
/* length of time. Must be called in pairs, if at all. */
/* Nothing much beyond the system call itself should be executed */
/* between these. */
void GC_start_blocking(void) {
GC_thread me;
LOCK();
#ifdef CYGWIN32
me = GC_lookup_thread(pthread_self());
#else
me = GC_lookup_thread(GetCurrentThreadId());
#endif
me->thread_blocked = TRUE;
UNLOCK();
}
void GC_end_blocking(void) {
GC_thread me;
LOCK(); /* This will block if the world is stopped. */
#ifdef CYGWIN32
me = GC_lookup_thread(pthread_self());
#else
me = GC_lookup_thread(GetCurrentThreadId());
#endif
me->thread_blocked = FALSE;
UNLOCK();
}
/* Defined in misc.c */
extern CRITICAL_SECTION GC_write_cs;
@@ -281,6 +325,8 @@ void GC_stop_world()
for (i = 0; i <= GC_get_max_thread_index(); i++)
if (thread_table[i].stack_base != 0
&& thread_table[i].id != thread_id) {
if (thread_table [i].thread_blocked)
continue;
# ifdef MSWINCE
/* SuspendThread will fail if thread is running kernel code */
while (SuspendThread(thread_table[i].handle) == (DWORD)-1)
+74
View File
@@ -0,0 +1,74 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the current language's compiler
# or gives an error. (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <[email protected]>
# Copyright (c) 2011 Maarten Bosmans <[email protected]>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 5
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.63)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_VAR_IF(CACHEVAR,yes,
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS
+3 -1
View File
@@ -13,6 +13,7 @@ man_MANS = \
genxs.1 \
httpcfg.1 \
ilasm.1 \
illinkanalyzer.1 \
lc.1 \
macpack.1 \
makecert.1 \
@@ -58,6 +59,7 @@ man_MANS = \
mono-configuration-crypto.1 \
ccrewrite.1 \
cccheck.1 \
mono-symbolicate.1
mono-symbolicate.1 \
mono-profilers.1
EXTRA_DIST = $(man_MANS)
@@ -1,41 +1,74 @@
.TH illinkanalyzer 1
.SH NAME
illinkanalyzer \- Mono's linker analyzer tool
.SH SYNOPSIS
.B illinkanalyzer
\fR[\fIoptions\fR] <\fIlinker-dependency-file.xml.gz\fR>
.SH DESCRIPTION
Linker analyzer is a command line tool to analyze dependencies, which
were recorded during linker processing, and led linker to mark an item
to keep it in the resulting linked assembly.
.PP
It works on an oriented graph of dependencies, which are collected and
dumped during the linker run. The vertices of this graph are the items
of interest like assemblies, types, methods, fields, linker steps,
etc. The edges represent the dependencies.
How to dump dependencies
------------------------
.SH HOW TO DUMP DEPENDENCIES
The linker analyzer needs a linker dependencies file as an input. It
can be retrieved by enabling dependencies dumping during linking of a
Xamarin.Android or a Xamarin.iOS project.
That can be done on the command line by setting
`LinkerDumpDependencies` property to `true` and building the
project. (make sure the LinkAssemblies task is called, it might
require cleaning the project sometimes) Usually it is enough to build
the project like this:
```msbuild /p:LinkerDumpDependencies=true /p:Configuration=Release YourAppProject.csproj```
.PP
That can be done on the command line by setting LinkerDumpDependencies
property to true and building the project. (make sure the
LinkAssemblies task is called, it might require cleaning the project
sometimes) Usually it is enough to build the project like this:
.PP
.nf
.RS
rm -f obj/Release/link.flag
msbuild /p:LinkerDumpDependencies=true /p:Configuration=Release YourAppProject.csproj
.RE
.fi
.PP
After a successful build, there will be a linker-dependencies.xml.gz
file created, containing the information for the analyzer.
How to use the analyzer
-----------------------
.SH OPTIONS
.nf
.RS
-a, --alldeps show all dependencies
--csvoutput=VALUE outputs types and optionally size analysis to CSV
file
-h, --help show this message and exit.
-l, --linkedpath=VALUE sets the linked assemblies directory path. Enables
displaying size estimates.
-r, --rawdeps=VALUE show raw vertex dependencies. Raw vertex VALUE is
in the raw format written by linker to the
dependency XML file. VALUE can be regular
expression
--roots show root dependencies.
--stat show statistic of loaded dependencies.
--tree reduce the dependency graph to the tree.
--types show all types dependencies.
-t, --typedeps=VALUE show type dependencies. The VALUE can be regular
expression
-f, --flat show all dependencies per vertex and their distance
-v, --verbose be more verbose. Enables stat and roots options.
.RE
.fi
.SH EXAMPLES
Let say you would like to know, why a type, Android.App.Activity for
example, was marked by the linker. So run the analyzer like this:
```mono linkeranalyzer.exe -t Android.App.Activity linker-dependencies.xml.gz```
.PP
.nf
.RS
illinkanalyzer -t Android.App.Activity linker-dependencies.xml.gz
.fi
.RE
.PP
Output:
```
.PP
.nf
.RS
Loading dependency tree from: linker-dependencies.xml.gz
--- Type dependencies: 'Android.App.Activity' -----------------------
@@ -46,34 +79,38 @@ Dependency #1
| TypeDef:XA.App.MainActivity [2 deps]
| Assembly:XA.App, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [3 deps]
| Other:Mono.Linker.Steps.ResolveFromAssemblyStep
```
.fi
.RE
.PP
The output contains dependencies string(s), starting with the type and
continuing with the item of interest, which depends on the type. The
dependency could be result of multiple reasons. For example the type
was referenced from a method, or the type was listed in the linker xml
file to be protected.
In our example there is only one dependency string called `Dependency
#1`. It shows us that the type `Android.App.Activity` was marked
during processing of type `XA.App.MainActivity` by the linker. In this
case because the `MainActivity` type is based on the `Activity` type
and thus the linker marked it and kept it in the linked assembly. We
can also see that there are 2 dependencies for the `MainActivity`
class. Note that in the string (above) we see only 1st dependency of
the 2, the dependency on the assembly `XA.App`. And finally the
assembly vertex depends on the `ResolveFromAssemblyStep` vertex. So we
see that the assembly was processed in the `ResolveFromAssembly`
linker step.
Now we might want to see the `MainActivity` dependencies. That could
be done by the following analyzer run:
```mono linkeranalyzer.exe -r TypeDef:XA.App.MainActivity linker-dependencies.xml.gz```
.PP
In our example there is only one dependency string called Dependency
#1. It shows us that the type Android.App.Activity was marked during
processing of type XA.App.MainActivity by the linker. In this case
because the MainActivity type is based on the Activity type and thus
the linker marked it and kept it in the linked assembly. We can also
see that there are 2 dependencies for the MainActivity class. Note
that in the string (above) we see only 1st dependency of the 2, the
dependency on the assembly XA.App. And finally the assembly vertex
depends on the ResolveFromAssemblyStep vertex. So we see that the
assembly was processed in the ResolveFromAssembly linker step.
.PP
Now we might want to see the MainActivity dependencies. That could be done by the following analyzer run:
.PP
.nf
.RS
illinkanalyzer -r TypeDef:XA.App.MainActivity linker-dependencies.xml.gz
.fi
.RE
.PP
Output:
```
.PP
.nf
.RS
Loading dependency tree from: linker-dependencies.xml.gz
--- Raw dependencies: 'TypeDef:XA.App.MainActivity' -----------------
@@ -89,37 +126,7 @@ Dependency #2
| TypeDef:XA.App.MainActivity [2 deps]
| Assembly:XA.App, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [3 deps]
| Other:Mono.Linker.Steps.ResolveFromAssemblyStep
```
Known issues
------------
Sometimes the linker processing is not straight forward and the
marking is postponed, like processing of some of the methods. They are
queued to be processed later. In such case the dependencies are
"interrupted" and the dependecy string for the method usually shows
just dependency on the Mark step.
Command line help
-----------------
```
Usage:
linkeranalyzer [Options] <linker-dependency-file.xml.gz>
Options:
-a, --alldeps show all dependencies
-h, --help show this message and exit.
-r, --rawdeps=VALUE show raw vertex dependencies. Raw vertex VALUE is
in the raw format written by linker to the
dependency XML file. VALUE can be regular
expression
--roots show root dependencies.
--stat show statistic of loaded dependencies.
--tree reduce the dependency graph to the tree.
--types show all types dependencies.
-t, --typedeps=VALUE show type dependencies. The VALUE can be regular
expression
-v, --verbose be more verbose. Enables stat and roots options.
```
.fi
.RE
.SH SEE ALSO
\fBmsbuild\fR(1)
+114 -17
View File
@@ -111,10 +111,11 @@ directory.
.SH OPTIONS
.TP
.I "--config FILE"
Specifies that a machine.config file must be bundled as well.
Typically this is $prefix/etc/mono/1.0/machine.config or
$prefix/etc/mono/2.0/machine.config depending on the profile that you
are using (1.0 or 2.0)
Specifies that a DLLMAP Mono config file must be bundled as well. In
the simple and cross compiler modes, if no config file is specified
the one for the current target is picked (either the system one in the
case of the simple mode, or the one that came from the cross
compilation target for the cross compiling mode).
.TP
.I "--config-dir DIR"
When passed, DIR will be set for the MONO_CFG_DIR environment variable
@@ -188,15 +189,45 @@ as precompiled binaries on the Mono distribution server.
.I "--local-targets"
Lists all of the available local cross compilation targets.
.TP
.I "--cil-strip PATH"
Provides a CIL stripper that mkbundle will use if able to.
The intended use is to help reduce file size on AOT.
.TP
.I "--in-tree path/to/mono/source/root"
Provides mkbundle with a mono source repository from which to pull the necessary headers for compilation.
This allows mkbundle to run out of the project's source tree, useful for working with multiple runtimes and for
testing without installing.
.TP
.I "--managed-linker PATH"
Provides mkbundle access to a managed linker to preprocess the assemblies.
.TP
.I "--machine-config FILE"
Uses the given FILE as the machine.config file for the generated
application.
application. The machine config contains an XML file that is used by
System.Configuration APIs to configure the .NET stack. Typically this
is
.I $prefix/etc/mono/4.5/machine.config.
.Sp
If you want to disable this automatic bundling, you can use the
.I "--no-machine-config"
flag. In the simple and cross compiler modes, if no machine.config file is specified
the one for the current target is picked (either the system one in the
case of the simple mode, or the one that came from the cross
compilation target for the cross compiling mode).
.TP
.I "--no-config"
In simple or cross compiling mode, this prevents mkbundle from
automatically bundling a config file.
.TP
.I "--nodeps"
This is the default: \fImkbundle\fP will only include the assemblies that
were specified on the command line to reduce the size of the resulting
image created.
.TP
.I "--no-machine-config"
In simple or cross compiling mode, this prevents mkbundle from
automatically bundling a machine.config file.
.TP
.I "-o filename"
Places the output on `out'. If the flag -c is specified, this is the
C host program. If not, this contains the resulting executable.
@@ -308,34 +339,100 @@ causes it to statically link instead.
Compresses the assemblies before embedding. This results in smaller
executable files, but increases startup time and requires zlib to be
installed on the target system.
.SH AOT Options
These options support an mkbundle using AOT compilation with static linking. A native compiler
toolchain is required.
.TP
.I "--aot-runtime PATH"
Provide the path to the mono runtime to use for AOTing assemblies.
.TP
.I "--aot-dedup"
(Experimental) Deduplicate AOT'ed methods based on a unique mangling of method names.
.TP
.I "--aot-mode MODE"
MODE can be either "full" or "llvmonly" at this time.
Currently, mkbundle supports three AOT modes. The default mode (this option unset)
will AOT methods but will fall back on runtime codegen where it is much faster or offers
a more full compatibility profile. The "full" setting will generate the necessary stubs to
not require runtime code generation. The "llvmonly" setting does the same, but forces all codegen
to go through the llvm backend.
.SH WINDOWS
If you are using the old embedding on Windows systems, it it necessary
to have Unix-like toolchain to be installed for \fImkbundle\fP to
work. You can use cygwin's and install gcc, gcc-mingw and as
packages.
If you are using the old embedding on Windows systems, it possible to use
a Unix-like toolchain like cygwin's and install gcc, gcc-mingw packages or
use Visual Studio 2015/2017 VC toolchain together with Clang for Visual Studio as assembler.
Clang can be installed as an individual component, "Clang/C2", using Visual Studio installer.
.PP
Using Visual Studio toolchain, mkbundle will, by default, use latest installed Visual Studio compiler
and linker as well as Windows SDK. If executed from one of the Visual Studio developer command prompts,
mkbundle will retrieve information directly from that build environment.
.SH ENVIRONMENT VARIABLES
.TP
.I "AS"
Assembler command. The default is "as".
Assembler command. The default is "as". For Visual Studio, default is "clang.exe".
If "clang.exe" for Visual Studio is not installed, mkbundle will fall back using "as".
.TP
.I "CC"
C compiler command. The default is "cc" under Linux and "gcc"
under Windows.
C compiler command. The default is "cc" for Linux, "gcc"
for cygwin and "cl.exe" for Visual Studio.
.TP
.I "MONO_BUNDLED_OPTIONS"
Options to be passed to the bundled
Mono runtime, separated by spaces. See the mono(1) manual page or run mono --help.
.SH WINDOWS VISUAL STUDIO ENVIRONMENT VARIABLES
.TP
.I "VisualStudioVersion"
Visual Studio version used in mkbundle build.
Default, latest installed Visual Studio version.
Values, "14.0" for Visual Studio 2015 or "15.0" for Visual Studio 2017.
.TP
.I "WindowsSdkVersion"
Windows SDK version used in mkbundle build.
Default/unknown, latest installed Windows SDK.
Values, "8.1", "10.0.10240.0", "10.0.15063.0" etc.
.TP
.I "VSCMD_ARG_TGT_ARCH"
Output target architecture used in mkbundle build.
Default/unknown, use architecture of .NET runtime executing mkbundle.
Values, "x86" or "x64".
NOTE, when running from a Visual Studio command prompt, this variable should already be set
by the command prompt and match the rest of that build environment.
.TP
.I "INCLUDE"
Override all custom include paths passed to "cl.exe".
Predefined by Visual Studio developer command prompt or auto detected by mkbundle when undefined.
.TP
.I "LIB"
Override all custom library paths passed to "link.exe".
Predefined by Visual Studio developer command prompt or auto detected by mkbundle when undefined.
.TP
.I "MONOPREFIX"
Use a custom Mono SDK install root matching the output target architecture (x86/x64).
Default, mkbundle will look for installed Mono SDK’s matching targeted architecture.
.TP
.I "MONOLIB"
Use a different mono library name or an absolute path to the mono library passed to linker.
Default, mkbundle will use default mono library name depending on mkbundle dynamic/static use case.
NOTE, supplied mono library needs to match mkbundle dynamic/static use case and target architecture.
.TP
.I "VCCRT"
Override C-runtime library linker settings.
Default "MD", mkbundle will use dynamic C-runtime linking on Windows compatible with Mono SDK distribution.
If a custom built Mono runtime using static C-Runtime linkage is used, setting this variable to "MT"
will link using static C-runtime libraries.
.TP
.I "VCSUBSYSTEM"
Override Windows subsystem.
Default, "windows". If console subsystem is preferred, use "console".
NOTE, if console output is expected from output target process then
set this variable to "console".
.SH FILES
This program will load referenced assemblies from the Mono assembly
cache.
.PP
Targets are loaded from ~/.mono/targets/TARGETNAME/mono
.SH BUGS
The option "--static" is not supported under Windows when using the
old embedding.
Moreover, a full cygwin environment containing at least "gcc" and "as"
is required for the build process. The generated executable does not
depend on cygwin.
.SH MAILING LISTS
Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
.SH WEB SITE
+375
View File
@@ -0,0 +1,375 @@
.TH mono-profilers 1
.SH NAME
mono\-profilers \- Mono's bundled profiler modules
.SH SYNOPSIS
\fBmono\ \-\-profile=log\fR[:\fIoption\fR,...] \fIprogram.exe\fR [\fIargs\fR]...
.PP
\fBmono\ \-\-profile=coverage\fR[:\fIoption\fR,...] \fIprogram.exe\fR [\fIargs\fR]...
.PP
\fBmono\ \-\-profile=aot\fR[:\fIoption\fR,...] \fIprogram.exe\fR [\fIargs\fR]...
.SH DESCRIPTION
Mono ships with a few profiler modules that enable most typical
profiling scenarios. This page describes each of them in the sections
below.
.SH LOG PROFILER
The log profiler is Mono's general-purpose performance profiler. It
can collect a wide variety of data that can be analyzed by tools such
as \fBmprof\-report\fR(1) or the Xamarin Profiler.
.PP
By default, the log profiler writes its output to \fIoutput.mlpd\fR.
Refer to the \fImono/profiler/log.h\fR file in the Mono source tree
for documentation on the log profiler's file format.
.PP
A default invocation of the log profiler gathers only basic data:
Metadata load and unload events, thread start and stop events,
performance counter samples, exception throws, etc. Most users will
want to enable some of the heavier features such as GC allocation
recording, statistical sampling, heap snapshotting (heapshots), or
method entry and exit instrumentation. See the \fBOptions\fR
sub-section.
.PP
Note that, in most realistic scenarios, the log profiler will record
a vast amount of data. This can lead to very large log files. (The
\fBzip\fR and \fBreport\fR options can help deal with this.)
.SS Options
The log profiler supports the following options:
.TP
\fBhelp\fR
Print usage instructions.
.TP
\fBoutput\fR=[\fI+\fR|\fI#\fR|\fI|\fR]\fIfile\fR
Write log data to \fIfile\fR. The optional modifiers are:
.RS
.ne 8
.TP
\fB+\fR
The program PID is appended to the file name. For example,
\fBoutput=+out.mlpd\fR outputs to \fIout.mlpd.1234\fR if the PID is
\fB1234\fR.
.TP
\fB#\fR
\fIfile\fR is parsed as a file descriptor number, which is opened
with \fBfdopen\fR(3). This is mainly useful in embedding scenarios.
.TP
\fB|\fR
\fIfile\fR is treated as a program name. It will be started with
\fBpopen\fR(3) and the log data will be piped to its standard input.
.RE
.TP
\fBreport\fR
Generate a report directly instead of writing the log data to a file.
If this option is used together with the \fBoutput\fR option, the
report will be written to the specified file instead of the log data.
.TP
\fBzip\fR
Compress the output file with \fBgzip\fR(1).
.TP
\fBport\fR=\fIport\fR
Use \fIport\fR to listen for command server connections. See the
\fBCommand server\fR sub-section.
.TP
\fBnodefaults\fR
Disables pre Mono 5.6 compatibility. In particular, this disables
exception events and performance counter sampling by default. It also
makes it so that GC move events won't be enabled by default when
heapshots are enabled. To use this option, it must be the first
option given to the log profiler.
.IP
This option will be the default in a future version of the log
profiler.
.TP
[\fBno\fR]\fIevent\fR
Enable or disable gathering data for \fIevent\fR, which can be one
of:
.RS
.TP
\fBexception\fR
Exception throw and clause (\fBcatch\fR, \fBfinally\fR, etc)
evaluation events. Enabled by default unless \fBnodefaults\fR is
used.
.TP
\fBmonitor\fR
Monitor lock contention, acquisition, and release events.
.TP
\fBgc\fR
GC start, progress, stop, and resize events.
.TP
\fBgcalloc\fR
GC allocation events.
.TP
\fBgcmove\fR
GC move events.
.TP
\fBgcroot\fR
GC root report events. Generated on every collection if enabled,
unless \fBnodefaults\fR is used, in which case, they're only
generated on heapshots.
.TP
\fBgchandle\fR
GC handle creation and deletion events.
.TP
\fBfinalization\fR
Object finalization events.
.TP
\fBcounter\fR
Performance counter sample events. Enabled by default unless
\fBnodefaults\fR is used.
.TP
\fBjit\fR
JIT code buffer events.
.TP
\fBalloc\fR
Alias for \fBgc\fR, \fBgcalloc\fR, and \fBgcmove\fR.
.TP
\fBlegacy\fR
Alias for \fBexception\fR, \fBmonitor\fR, \fBgc\fR, \fBgcmove\fR,
\fBgcroot\fR, \fBgchandle\fR, \fBfinalization\fR, and \fBcounter\fR.
.RE
.TP
\fBsample\fR[\fB\-real\fR][=\fIfreq\fR]
Enable statistical sampling. The default is to sample at a frequency
of 100 Hz, but \fIfreq\fR can be used to override this.
.IP
By default, sampling uses process time (i.e., the more work a process
does, the more samples are collected). The \fB-real\fR variant uses
wall clock time instead. Wall clock time is better for programs that
are I/O-bound.
.TP
\fBmaxsamples\fR=\fInum\fR
Limit the number of reusable sample events to \fInum\fR allocations.
A value of zero means no limit. By default, the value of this setting
is based on the number of CPU cores. Some tinkering with this setting
may be necessary for programs with an unusually high amount of
threads.
.TP
\fBcalls\fR
Enable method entry and exit instrumentation. This is an alternative
to statistical sampling when you need more precise information. Note
that this mode is extremely heavy and can slow most programs to a
crawl.
.TP
\fBcallspec\fR=\fIspec\fR
Limit method entry and exit instrumentation to methods matching the
specified call spec. This uses the same syntax as the \fB--trace\fR
option for \fBmono\fR(1), so refer to that page for more information.
.TP
\fBcalldepth\fR=\fInum\fR
Limit method entry and exit event collection to a call depth of
\fInum\fR.
.TP
\fBmaxframes\fR=\fInum\fR
Limit backtraces in various events (including statistical samples) to
\fInum\fR frames.
.TP
\fBheapshot\fR[=\fImode\fR]
Enable heap snapshots. \fImode\fR, if given, can be one of:
.RS
.TP
\fBondemand\fR
Only perform a heapshot when receiving a command via the command
server or when triggered through the managed library.
.TP
\fInum\fR\fBgc\fR
Perform a heapshot on every \fInum\fR collections of the major
generation.
.TP
\fInum\fR\fBms\fR
Perform a heapshot on a major generation collection if \fInum\fR
milliseconds have passed since the last heapshot.
.RE
.IP
If \fImode\fR is not given, a heapshot will be performed on every
collection of the major generation.
.TP
\fBheapshot-on-shutdown\fR
In addition to any other heapshot settings, also perform a heapshot
on runtime shutdown.
.TP
\fBdebug\fR
Print detailed debugging information. Most users should not use this
option.
.SS Command server
The log profiler features a simple command server that currently is
only used to trigger manual heapshots (typcally when using the
on-demand mode, but also usable with the other modes). A random port
will be used to listen for connections unless the \fBport\fR option
is used. To trigger a heapshot, open a TCP connection to the command
server and send the C string \fB"heapshot\\n"\fR.
.PP
The command server supports multiple simultaneous connections.
.SS Managed library
The log profiler comes with a managed library called
\fBMono.Profiler.Log\fR. This library allows easily reading log files
in managed code (e.g., C#) as well as interacting with the profiler
at run-time.
.PP
With the ability to easily read log files, users can write all sorts
of interesting analyses that might not be provided by the standard
tools (e.g., \fBmprof\-report\fR(1)).
.PP
The \fBLogProfiler\fR class allows users to reconfigure profiler
settings at run-time. For example, certain event types can be toggled
on or off, the mode and frequency of heapshots and sampling can be
changed, etc. Heapshots can also be triggered manually.
.PP
To use this library, simply pass \fB\-r:Mono.Profiler.Log\fR when
compiling your code.
.SS Example
Collect GC allocation and sampling data for a program, then generate
a report:
.PP
.nf
.RS
mono \-\-profile=log:alloc,sample program.exe
mprof\-report output.mlpd
.RE
.fi
.PP
Perform a heapshot on every 5th collection and generate a report
directly:
.PP
.nf
.RS
mono \-\-profile=log:heapshot=5gc,report program.exe
.RE
.fi
.PP
.SH COVERAGE PROFILER
The code coverage profiler collects information about how often code
paths are executed. This is done by instrumenting JIT-compiled code
at all sequence points. On program exit, the coverage profiler
collects all execution count information and outputs it to an XML
file. The main use case for the coverage profiler is unit testing: By
running unit test suites with the coverage profiler, it is possible
to determine whether the unit tests actually cover all the code that
they should.
.PP
By default, the coverage profiler writes its output to
\fIcoverage.xml\fR. Refer to the \fImono/profiler/coverage.c\fR file
in the Mono source tree for documentation on the schema.
.PP
Please note that the coverage profiler currently does not support
instrumenting AOT-compiled code. When collecting coverage data, one
may wish to run Mono with the \fB-O=-aot\fR option to disable loading
AOT-compiled code.
.SS Options
The coverage profiler supports the following options:
.TP
\fBhelp\fR
Print usage instructions.
.TP
\fBoutput\fR=[\fI+\fR|\fI#\fR|\fI|\fR]\fIfile\fR
Write coverage data to \fIfile\fR. The optional modifiers are:
.RS
.ne 8
.TP
\fB+\fR
The program PID is appended to the file name. For example,
\fBoutput=+cov.xml\fR outputs to \fIcov.xml.1234\fR if the PID is
\fB1234\fR.
.TP
\fB#\fR
\fIfile\fR is parsed as a file descriptor number, which is opened
with \fBfdopen\fR(3). This is mainly useful in embedding scenarios.
.TP
\fB|\fR
\fIfile\fR is treated as a program name. It will be started with
\fBpopen\fR(3) and the coverage data will be piped to its standard
input.
.RE
.TP
\fBcovfilter-file\fR=\fIfile\fR
Supply a coverage filter file. This option can be given multiple
times. See the \fBFilter files\fR sub-section.
.SS Filter files
Filter files can be used to pick and choose which types should be
considered for coverage instrumentation. A filter file consists of a
series of lines of the form:
.PP
.nf
.RS
\fB+\fR|\fB\-\fR\fB[\fR\fIimage_name\fR\fB]\fR\fItype_name_prefix\fR
.RE
.fi
.PP
Here, \fIimage_name\fR is something like \fBmscorlib\fR.
\fItype_name_prefix\fR can be something like \fBSystem.Int32\fR for
a specific type or \fBSystem.App\fR to pick all types starting with
\fBApp\fR in the \fBSystem\fR namespace.
.PP
Lines starting with \fB+\fR indicate that a type should be
instrumented for coverage, whereas lines starting with \fB\-\fR
indicate the opposite. Lines starting with \fB+\fR always override
lines starting with \fB\-\fR regardless of the order they appear in.
.PP
Lines not starting with either character are ignored. This can be
used to write comments. For example, this is a valid file:
.PP
.nf
.RS
# Ignore coverage in network-related code, except HTTP client code.
-[MyProgram]MyProgram.Net
+[MyProgram]MyProgram.Net.Http.HttpClient
.RE
.fi
.SS Example
Coverage data for a program can be collected like this:
.PP
.nf
.RS
mono \-O=\-aot \-\-profile=coverage:output=cov.xml program.exe
.RE
.fi
.PP
\fIcov.xml\fR will now contain the coverage data.
.SH AOT PROFILER
The AOT profiler will record which generic instantiations a program
makes use of and save the information to a specified file. This data
can then be used by the AOT compiler to compile those generic
instantiations ahead of time to reduce program startup time.
.PP
By default, the AOT profiler writes its output to
\fIoutput.aotprofile\fR. Refer to the \fImono/profiler/aot.h\fR file
in the Mono source tree for documentation on the AOT profiler's file
format.
.SS Options
The AOT profiler supports the following options:
.TP
\fBhelp\fR
Print usage instructions.
.TP
\fBoutput\fR=[\fI+\fR|\fI#\fR|\fI|\fR]\fIfile\fR
Write output data to \fIfile\fR. The optional modifiers are:
.RS
.ne 8
.TP
\fB+\fR
The program PID is appended to the file name. For example,
\fBoutput=+out.aotprofile\fR outputs to \fIout.aotprofile.1234\fR if
the PID is \fB1234\fR.
.TP
\fB#\fR
\fIfile\fR is parsed as a file descriptor number, which is opened
with \fBfdopen\fR(3). This is mainly useful in embedding scenarios.
.TP
\fB|\fR
\fIfile\fR is treated as a program name. It will be started with
\fBpopen\fR(3) and the log data will be piped to its standard input.
.RE
.TP
\fBverbose\fR
Print detailed debugging information. Most users should not use this
option.
.SS Example
A profile can be collected and used like this:
.PP
.nf
.RS
mono \-\-profile=aot:output=program.aotprofile program.exe
mono \-\-aot=profile=program.aotprofile program.exe
mono program.exe
.RE
.fi
.PP
.SH SEE ALSO
\fBmono\fR(1), \fBmprof\-report\fR(1)
-5
View File
@@ -26,11 +26,6 @@ and execution can be resumed by sending the SIGUSR2 signal. The
service can be cleanly shutdown by sending the SIGTERM signal to the
process.
.PP
Mono programs started with mono-service run with the
.B MONO_DISABLE_SHM
variable set. This means that certain Mono features that depend on
it are not available to services.
.PP
The following options can be used to control the service:
.TP
.I "-d:DIRECTORY"
+148 -172
View File
@@ -65,6 +65,45 @@ and
See the description for
.B MONO_IOMAP
in the environment variables section for more details.
.SH METHOD DESCRIPTIONS
A number of diagnostic command line options take as argument a method
description. A method description is a textual representation that
can be used to uniquely identify a method. The syntax is as follows:
.nf
[namespace]classname:methodname[(arguments)]
.fi
.PP
The values in brackets are optional, like the namespace and the
arguments. The arguments themselves are either empty, or a
comma-separated list of arguments. Both the
\fBclassname\fR
and
\fBmethodname\fR
can be set to the special value '*' to match any values (Unix shell
users should escape the argument to avoid the shell interpreting
this).
.PP
The arguments, if present should be a comma separated list of types
either a full typename, or for built-in types it should use the
low-level ILAsm type names for the built-in types,
like 'void', 'char', 'bool', 'byte', 'sbyte', 'uint16', 'int16', 'uint',
'int', 'ulong', 'long', 'uintptr', 'intptr', 'single', 'double', 'string', 'object'.
.PP
Pointer types should be the name of the type, followed by a '*',
arrays should be the typename followed by '[' one or more commas (to
indicate the rank of the array), and ']'.
.PP
Generic values should use '<', one or more type names, separated by
both a comma and a space and '>'.
.PP
By-reference arguments should include a "&" after the typename.
.PP
Examples:
.nf
*:ctor(int) // All constructors that take an int as an argument
*:Main // Methods named Main in any class
*:Main(string[]) // Methods named Main that take a string array in any class
.fi
.SH RUNTIME OPTIONS
The following options are available:
.TP
@@ -177,6 +216,17 @@ options. This feature is experimental.
.TP
.I llvm-outfile=[filename]
Gives the path for the temporary LLVM bitcode file created during AOT.
.I dedup
Each AOT module will typically contain the code for inflated methods and wrappers that
are called by code in that module. In dedup mode, we identify and skip compiling all of those
methods. When using this mode with fullaot, dedup-include is required or these methods will
remain missing.
.TP
.I dedup-include=[filename]
In dedup-include mode, we are in the pass of compilation where we compile the methods
that we had previously skipped. All of them are emitted into the assembly that is passed
as this option. We consolidate the many duplicate skipped copies of the same method into one.
.TP
.TP
.I info
Print the architecture the AOT in this copy of Mono targets and quit.
@@ -251,14 +301,14 @@ If the AOT compiler cannot compile a method for any reason, enabling this flag
will output the skipped methods to the console.
.TP
.I profile=[file]
Specify a file to use for profile-guided optimization. See the "AOT PROFILING" section. To specify multiple files, include the
Specify a file to use for profile-guided optimization. See the \fBAOT profiler\fR sub-section. To specify multiple files, include the
.I profile
option multiple times.
.TP
.I profile-only
AOT *only* the methods described in the files specified with the
.I profile
option. See the "AOT PROFILING" section.
option. See the \fBAOT profiler\fR sub-section.
.TP
.I readonly-value=namespace.typename.fieldname=type/value
Override the value of a static readonly field. Usually, during JIT
@@ -444,6 +494,11 @@ will switch to '/bin/mono64' iff '/bin/mono' is a 32-bit build).
\fB--help\fR, \fB-h\fR
Displays usage instructions.
.TP
\fB--interpreter\fR
The Mono runtime will use its interpreter to execute a given assembly.
The interpreter is usually slower than the JIT, but it can be useful on
platforms where code generation at runtime is not allowed.
.TP
\fB--hybrid-aot\fR
This flag allows the Mono runtime to run assemblies
that have been stripped of IL, for example using mono-cil-strip. For this to
@@ -625,14 +680,12 @@ platforms, and only when using gdb 7.0 or later.
.ne
.RE
.TP
\fB--profile[=profiler[:profiler_args]]\fR
Turns on profiling. For more information about profiling applications
and code coverage see the sections "PROFILING" and "CODE COVERAGE"
below.
\fB\-\-profile\fR[=\fIprofiler\fR[:\fIprofiler_args\fR]]\fR
Loads a profiler module with the given arguments. For more information,
see the \fBPROFILING\fR section.
.Sp
This option can be used multiple times, each time will load an
additional profiler. This allows developers to use modules that
extend the JIT through the Mono profiling interface.
This option can be used multiple times; each time will load an additional
profiler module.
.TP
\fB--trace[=expression]\fR
Shows method names as they are invoked. By default all methods are
@@ -811,128 +864,81 @@ create its own threads and return after invocation.
This support allows for example debugging applications by having the
csharp shell attach to running processes.
.SH PROFILING
The mono runtime includes a profiler that can be used to explore
various performance related problems in your application. The
profiler is activated by passing the --profile command line argument
to the Mono runtime, the format is:
.nf
--profile[=profiler[:profiler_args]]
.fi
Mono has a built-in profiler called 'default' (and is also the default
if no arguments are specified), but developers can write custom
profilers, see the section "CUSTOM PROFILERS" for more details.
The Mono runtime includes a profiler API that dynamically loaded
profiler modules and embedders can use to collect performance-related
data about an application. Profiler modules are loaded by passing the
\fB\-\-profile\fR command line argument to the Mono runtime.
.PP
If a
.I profiler
is not specified, the default profiler is used.
.Sp
The
.I profiler_args
is a profiler-specific string of options for the profiler itself.
.Sp
The default profiler accepts the following options 'alloc' to profile
memory consumption by the application; 'time' to profile the time
spent on each routine; 'jit' to collect time spent JIT-compiling methods
and 'stat' to perform sample statistical profiling.
If no options are provided the default is 'alloc,time,jit'.
.PP
By default the
profile data is printed to stdout: to change this, use the 'file=filename'
option to output the data to filename.
.Sp
For example:
.nf
mono --profile program.exe
.fi
.Sp
That will run the program with the default profiler and will do time
and allocation profiling.
.Sp
.nf
mono --profile=default:stat,alloc,file=prof.out program.exe
.fi
Will do sample statistical profiling and allocation profiling on
program.exe. The profile data is put in prof.out.
.Sp
Note that the statistical profiler has a very low overhead and should
be the preferred profiler to use (for better output use the full path
to the mono binary when running and make sure you have installed the
addr2line utility that comes from the binutils package).
.SH LOG PROFILER
This is the most advanced profiler.
.PP
The Mono \f[I]log\f[] profiler can be used to collect a lot of
information about a program running in the Mono runtime.
This data can be used (both while the process is running and later)
to do analyses of the program behaviour, determine resource usage,
performance issues or even look for particular execution patterns.
Mono ships with a few profiler modules, of which the \fBlog\fR profiler
is the most feature-rich. It is also the default profiler if the
\fIprofiler\fR argument is not given, or if \fBdefault\fR is given.
It is possible to write your own profiler modules; see the
\fBCustom profilers\fR sub-section.
.SS Log profiler
The log profiler can be used to collect a lot of information about
a program running in the Mono runtime. This data can be used (both
while the process is running and later) to do analyses of the
program behavior, determine resource usage, performance issues or
even look for particular execution patterns.
.PP
This is accomplished by logging the events provided by the Mono
runtime through the profiling interface and periodically writing
them to a file which can be later inspected with the mprof-report(1)
tool.
runtime through the profiler API and periodically writing them to a
file which can later be inspected with the \fBmprof\-report\fR(1)
tool.
.PP
More information about how to use the log profiler is available on the
mprof-report(1) page.
.SH CUSTOM PROFILERS
Mono provides a mechanism for loading other profiling modules which in
the form of shared libraries. These profiling modules can hook up to
various parts of the Mono runtime to gather information about the code
being executed.
More information about how to use the log profiler is available on
the \fBmono\-profilers\fR(1) page, under the \fBLOG PROFILER\fR
section, as well as the \fBmprof\-report\fR(1) page.
.SS Coverage profiler
The code coverage profiler can instrument a program to help determine
which classes, methods, code paths, etc are actually executed. This
is most useful when running a test suite to determine whether the
tests actually cover the code they're expected to.
.PP
More information about how to use the coverage profiler is available
on the \fBmono\-profilers\fR(1) page, under the \fBCOVERAGE
PROFILER\fR section.
.SS AOT profiler
The AOT profiler can help improve startup performance by logging
which generic instantiations are used by a program, which the AOT
compiler can then use to compile those instantiations ahead of time
so that they won't have to be JIT compiled at startup.
.PP
More information about how to use the AOT profiler is available on
the \fBmono\-profilers\fR(1) page, under the \fBAOT PROFILER\fR
section.
.SS Custom profilers
Custom profiler modules can be loaded in exactly the same way as the
standard modules that ship with Mono. They can also access the same
profiler API to gather all kinds of information about the code being
executed.
.PP
For example, to use a third-party profiler called \fBcustom\fR, you
would load it like this:
.PP
To use a third party profiler you must pass the name of the profiler
to Mono, like this:
.nf
mono --profile=custom program.exe
.RS
mono --profile=custom program.exe
.RE
.fi
.PP
In the above sample Mono will load the user defined profiler from the
shared library `mono-profiler-custom.so'. This profiler module must
be on your dynamic linker library path.
.PP
A list of other third party profilers is available from Mono's web
site (www.mono-project.com/docs/advanced/performance-tips/)
You could also pass arguments to it:
.PP
Custom profiles are written as shared libraries. The shared library
must be called `mono-profiler-NAME.so' where `NAME' is the name of
your profiler.
.PP
For a sample of how to write your own custom profiler look in the
Mono source tree for in the samples/profiler.c.
.SH CODE COVERAGE
Mono ships with a code coverage module in the \f[I]coverage\f[] profiler.
To enable it, pass \fB--profile=coverage\fR to your mono invocation. It
will by default output a coverage.xml in the current directory. Use
\fBmono --profile=coverage:help sample.exe\fR for more information on the
different options.
.SH AOT PROFILING
You can improve startup performance by using the AOT profiler.
.PP
Typically the AOT compiler (\fBmono --aot\fR) will not generate code
for generic instantiations. To solve this, you can run Mono with the
AOT profiler to find out all the generic instantiations that are used,
and then instructing the AOT compiler to produce code for these.
.PP
This command will run the specified app.exe and produce the
\fBout.aotprof\fR file with the data describing the generic
instantiations that are needed:
.nf
$ mono --profile=aot:output=out.aotprof app.exe
.RS
mono --profile=custom:arg1,arg2=arg3 program.exe
.RE
.fi
.PP
Once you have this data, you can pass this to Mono's AOT compiler to
instruct it to generate code for it:
.nf
$ mono --aot=profile=out.aotprof
.fi
In the above example, Mono will load the profiler from the shared
library called \fIlibmono\-profiler\-custom.so\fR (name varies based
on platform, e.g., \fIlibmono\-profiler\-custom.dylib\fR on OS X).
This profiler module must be on your dynamic linker library path
(\fBLD_LIBRARY_PATH\fR on most systems, \fBDYLD_LIBRARY_PATH\fR on
OS X).
.PP
For a sample of how to write your own custom profiler, look at the
\fIsamples/profiler/sample.c\fR file in the Mono source tree.
.SH DEBUGGING AIDS
To debug managed applications, you can use the
.B mdb
@@ -983,8 +989,10 @@ If set, the log mask is changed to the set value. Possible values are
"asm" (assembly loader), "type", "dll" (native library loader), "gc"
(garbage collector), "cfg" (config file loader), "aot" (precompiler),
"security" (e.g. Moonlight CoreCLR support), "threadpool" (thread pool generic),
"io-threadpool" (thread pool I/O), "io-layer" (I/O layer - sockets, handles, shared memory etc)
and "all".
"io-selector" (async socket operations), "io-layer" (I/O layer - processes, files,
sockets, events, semaphores, mutexes and handles), "io-layer-process",
"io-layer-file", "io-layer-socket", "io-layer-event", "io-layer-semaphore",
"io-layer-mutex", "io-layer-handle" and "all".
The default value is "all". Changing the mask value allows you to display only
messages for a certain component. You can use multiple masks by comma
separating them. For example to see config file messages and assembly loader
@@ -1118,14 +1126,12 @@ When Mono is built with a soft float fallback on ARM and this variable is set to
"1", Mono will always emit soft float code, even if a VFP unit is
detected.
.TP
\fBMONO_DARWIN_WATCHER_MAXFDS\fR
This is a debugging aid used to force limits on the FileSystemWatcher
implementation in Darwin. There is no limit by default.
\fBMONO_DARWIN_USE_KQUEUE_FSW\fR
Fall back on the kqueue FileSystemWatcher implementation in Darwin. The default is the FSEvent implementation.
.TP
\fBMONO_DISABLE_AIO\fR
If set, tells mono NOT to attempt using native asynchronous I/O services. In
that case, a default select/poll implementation is used. Currently only epoll()
is supported.
\fBMONO_DARWIN_WATCHER_MAXFDS\fR
This is a debugging aid used to force limits on the kqueue FileSystemWatcher
implementation in Darwin. There is no limit by default.
.TP
\fBMONO_DISABLE_MANAGED_COLLATION\fR
If this environment variable is `yes', the runtime uses unmanaged
@@ -1134,18 +1140,6 @@ internally disables managed collation functionality invoked via the
members of System.Globalization.CompareInfo class. Collation is
enabled by default.
.TP
\fBMONO_DISABLE_SHM\fR
Unix only: If set, disables the shared memory files used for
cross-process handles: process have only private handles. This means
that process and thread handles are not available to other processes,
and named mutexes, named events and named semaphores are not visible
between processes.
.Sp
This is can also be enabled by default by passing the
"--disable-shared-handles" option to configure.
.Sp
This is the default from mono 2.8 onwards.
.TP
\fBMONO_DISABLE_SHARED_AREA\fR
Unix only: If set, disable usage of shared memory for exposing
performance counters. This means it will not be possible to both
@@ -1164,6 +1158,11 @@ For platforms that do not otherwise have a way of obtaining random bytes
this can be set to the name of a file system socket on which an egd or
prngd daemon is listening.
.TP
\fBMONO_ENABLE_AIO\fR
If set, tells mono to attempt using native asynchronous I/O services. If not
set, a default select/poll implementation is used. Currently epoll and kqueue
are supported.
.TP
\fBMONO_ENABLE_COOP\fR
This makes the Mono runtime and the SGen garbage collector run in cooperative
mode as opposed to run on preemptive mode. Preemptive mode is the mode
@@ -1529,29 +1528,6 @@ directive instead, like this:
.fi
See mod_mono(8) for more details.
Additionally. Mono includes a profiler module which allows one to track what
adjustements to file paths IOMAP code needs to do. The tracking code reports
the managed location (full stack trace) from which the IOMAP-ed call was made and,
on process exit, the locations where all the IOMAP-ed strings were created in
managed code. The latter report is only approximate as it is not always possible
to estimate the actual location where the string was created. The code uses simple
heuristics - it analyzes stack trace leading back to the string allocation location
and ignores all the managed code which lives in assemblies installed in GAC as well as in the
class libraries shipped with Mono (since they are assumed to be free of case-sensitivity
issues). It then reports the first location in the user's code - in most cases this will be
the place where the string is allocated or very close to the location. The reporting code
is implemented as a custom profiler module (see the "PROFILING" section) and can be loaded
in the following way:
.fi
.Sp
.nf
mono --profile=iomap yourapplication.exe
.fi
Note, however, that Mono currently supports only one profiler module
at a time.
.TP
\fBMONO_LLVM\fR
When Mono is using the LLVM code generation backend you can use this
@@ -1623,12 +1599,6 @@ home directories that might be shared over the network.
If set, extra checks are made during IO operations. Currently, this
includes only advisory locks around file writes.
.TP
\fBMONO_THEME\fR
The name of the theme to be used by Windows.Forms. Available themes today
include "clearlooks", "nice" and "win32".
.Sp
The default is "win32".
.TP
\fBMONO_TLS_SESSION_CACHE_TIMEOUT\fR
The time, in seconds, that the SSL/TLS session cache will keep it's entry to
avoid a new negotiation between the client and a server. Negotiation are very
@@ -1892,7 +1862,10 @@ for example, to see managed frame names on gdb backtraces.
\fBMONO_VERBOSE_METHOD\fR
Enables the maximum JIT verbosity for the specified method. This is
very helpfull to diagnose a miscompilation problems of a specific
method.
method. This can be a comma-separated list of method names to
match. If the name is simple, this applies to any method with that
name, otherwise you can use a mono method description (see the section
METHOD DESCRIPTIONS).
.TP
\fBMONO_JIT_DUMP_METHOD\fR
Enables sending of the JITs intermediate representation for a specified
@@ -2008,8 +1981,11 @@ http://www.mono-project.com/community/help/mailing-lists/
http://www.mono-project.com
.SH SEE ALSO
.PP
certmgr(1), cert-sync(1), csharp(1), gacutil(1), mcs(1), mdb(1), monodis(1),
mono-config(5), mprof-report(1), pdb2mdb(1), xsp(1), mod_mono(8).
\fBcertmgr\fR(1), \fBcert-sync\fR(1), \fBcsharp\fR(1),
\fBgacutil\fR(1), \fBmcs\fR(1), \fBmonodis\fR(1),
\fBmono-config\fR(5), \fBmono\-profilers\fR(1),
\fBmprof\-report\fR(1), \fBpdb2mdb\fR(1), \fBxsp\fR(1),
\fBmod_mono\fR(8)
.PP
For more information on AOT:
http://www.mono-project.com/docs/advanced/aot/
+1 -1
View File
@@ -202,7 +202,7 @@ Specify a parameter for a custom step.
.SH COPYRIGHT
Copyright (C) 2007 Novell, Inc (http://www.novell.com)
.SH BUGS
Bugs report are welcome at http://bugzilla.xamarin.com
Bugs report are welcome at https://github.com/mono/linker/issues
.PP
Product Mono Tools, Component linker.
.SH MAILING LISTS
+151 -523
View File
@@ -1,531 +1,159 @@
.de Sp
.if t .sp .5v
.if n .sp
..
.TH mprof-report 1 ""
.SH The Mono log profiler
.TH mprof-report 1
.SH NAME
mprof\-report \- report generator for Mono's log profiler
.SH SYNOPSIS
\fBmprof\-report\fR [\fIoption\fR]... \fIfile.mlpd\fR
.SH DESCRIPTION
\fBmprof\-report\fR is the report generator for Mono's \fBlog\fR
profiler. It reads the MLPD log files produced by the log profiler
and generates a report based on the options passed to it. The
output is based on individual reports which can be turned on or off.
By default, all reports are generated in summary form (i.e.,
non-verbose output).
.PP
The Mono \f[I]log\f[] profiler can be used to collect a lot of
information about a program running in the Mono runtime.
This data can be used (both while the process is running and later)
to do analyses of the program behaviour, determine resource usage,
performance issues or even look for particular execution patterns.
\fBmprof\-report\fR can read both normal and \fBgzip\fR(1)-compressed
log files transparently.
.PP
This is accomplished by logging the events provided by the Mono
runtime through the profiling interface and periodically writing
them to a file which can be later inspected with the command line
\f[I]mprof-report\f[] program or with a GUI (not developed yet).
.PP
The events collected include (among others):
.IP \[bu] 2
method enter and leave
.IP \[bu] 2
object allocation
.IP \[bu] 2
garbage collection
.IP \[bu] 2
JIT compilation
.IP \[bu] 2
metadata loading
.IP \[bu] 2
lock contention
.IP \[bu] 2
exceptions
.PP
In addition, the profiler can periodically collect info about all
the objects present in the heap at the end of a garbage collection
(this is called heap shot and currently implemented only for the
sgen garbage collector).
Another available profiler mode is the \f[I]sampling\f[] or
\f[I]statistical\f[] mode: periodically the program is sampled and
the information about what the program was busy with is saved.
This allows to get information about the program behaviour without
degrading its performance too much (usually less than 10%).
.SS Basic profiler usage
.PP
The simpler way to use the profiler is the following:
.PP
\f[B]mono\ --profile=log\ program.exe\f[]
.PP
At the end of the execution the file \f[I]output.mlpd\f[] will be
found in the current directory.
A summary report of the data can be printed by running:
.PP
\f[B]mprof-report\ output.mlpd\f[]
.PP
With this invocation a huge amount of data is collected about the
program execution and collecting and saving this data can
significantly slow down program execution.
If saving the profiling data is not needed, a report can be
generated directly with:
.PP
\f[B]mono\ --profile=log:report\ program.exe\f[]
.PP
If the information about allocations is not of interest, it can be
excluded:
.PP
\f[B]mono\ --profile=log:noalloc\ program.exe\f[]
.PP
On the other hand, if method call timing is not important, while
allocations are, the needed info can be gathered with:
.PP
\f[B]mono\ --profile=log:nocalls\ program.exe\f[]
.PP
You will still be able to inspect information about the sequence of
calls that lead to each allocation because at each object
allocation a stack trace is collected if full enter/leave
information is not available.
.PP
To periodically collect heap shots (and exclude method and
allocation events) use the following options (making sure you run
with the sgen garbage collector):
.PP
\f[B]mono\ --gc=sgen\ --profile=log:heapshot\ program.exe\f[]
.PP
To perform a sampling profiler run, use the \f[I]sample\f[] option:
.PP
\f[B]mono\ --profile=log:sample\ program.exe\f[]
.SS Profiler option documentation
.PP
By default the \f[I]log\f[] profiler will gather all the events
provided by the Mono runtime and write them to a file named
\f[I]output.mlpd\f[].
When no option is specified, it is equivalent to using:
.PP
\f[B]--profile=log:calls,alloc,output=output.mlpd,maxframes=32,calldepth=100\f[]
.PP
The following options can be used to modify this default behaviour.
Each option is separated from the next by a \f[B],\f[] character,
with no spaces and all the options are included after the
\f[I]log:\f[] profile module specifier.
.IP \[bu] 2
\f[I]help\f[]: display concise help info about each available
option
.IP \[bu] 2
\f[I][no]alloc\f[]: \f[I]noalloc\f[] disables collecting object
allocation info, \f[I]alloc\f[] enables it if it was disabled by
another option like \f[I]heapshot\f[].
.IP \[bu] 2
\f[I][no]calls\f[]: \f[I]nocalls\f[] disables collecting method
enter and leave events.
When this option is used at each object allocation and at some
other events (like lock contentions and exception throws) a stack
trace is collected by default.
See the \f[I]maxframes\f[] option to control this behaviour.
\f[I]calls\f[] enables method enter/leave events if they were
disabled by another option like \f[I]heapshot\f[].
.IP \[bu] 2
\f[I]heapshot[=MODE]\f[]: collect heap shot data at each major
collection.
The frequency of the heap shots can be changed with the
\f[I]MODE\f[] parameter.
When this option is used allocation events and method enter/leave
events are not recorded by default: if they are needed, they need
to be enabled explicitly.
The optional parameter \f[I]MODE\f[] can modify the default heap
shot frequency.
heapshot can be used multiple times with different modes: in that
case a heap shot is taken if either of the conditions are met.
MODE can be one of:
.RS 2
.IP \[bu] 2
\f[I]NUM\f[]ms: perform a heap shot if at least \f[I]NUM\f[]
milliseconds passed since the last one.
.IP \[bu] 2
\f[I]NUM\f[]gc: perform a heap shot every \f[I]NUM\f[] major
garbage collections
.IP \[bu] 2
\f[I]ondemand\f[]: perform a heap shot when such a command is sent
to the control port
For information about how to use the log profiler with a program,
see the \fBmono\-profilers\fR(1) page, under the \fBLOG PROFILER\fR
section.
.SH OPTIONS
The following options are available:
.TP
\fB\-\-help\fR
Displays usage instructions.
.TP
\fB\-\-out\fR=\fIfile\fR
Write the report output to \fIfile\fR instead of standard output.
.TP
\fB\-\-traces\fR
Show backtraces in reports when available.
.TP
\fB\-\-maxframes\fR=\fInum\fR
Limit backtraces to \fInum\fR frames.
.TP
\fB\-\-reports\fR=\fIreports\fR
Generate only the specified reports. \fIreports\fR is a
comma-separated list of reports. See the \fBREPORTS\fR section.
.TP
\fB\-\-method\-sort\fR=\fImode\fR
Sort methods according to \fImode\fR, which can be one of:
.RS
.TP
\fBtotal\fR (default)
Sort by the total amount of time spent in a method and its callees.
.TP
\fBself\fR
Sort by the amount of time spent only within a method itself.
.TP
\fBcalls\fR
Sort by the total amount of calls made to a method.
.RE
.IP \[bu] 2
\f[I]sample[=FREQ]\f[]: collect statistical samples of the
program behaviour.
The default is to collect a 100 times per second (100 Hz) the
instruction pointer.
This is equivalent to the value \[lq]100\[rq].
A value of zero for \f[I]FREQ\f[] effectively disables sampling.
.IP \[bu] 2
\f[I]heapshot-on-shutdown\f[]: collect heap shot data when the runtime
shuts down.
.IP \[bu] 2
\f[I]maxframes=NUM\f[]: when a stack trace needs to be performed,
collect \f[I]NUM\f[] frames at the most.
The default is 32.
.IP \[bu] 2
\f[I]maxsamples=NUM\f[]: stop allocating reusable sample events
once \f[I]NUM\f[] events have been allocated (a value of zero for
all intents and purposes means unlimited). By default, the value
of this setting is the number of CPU cores multiplied by 1000. This
is usually a good enough value for typical desktop and mobile apps.
If you're losing too many samples due to this default (which is
possible in apps with an unusually high amount of threads), you
may want to tinker with this value to find a good balance between
sample hit rate and performance impact on the app. The way it works
is that sample events are enqueued for reuse after they're flushed
to the output file; if a thread gets a sampling signal but there are
no sample events in the reuse queue and the profiler has reached the
maximum number of sample allocations, the sample gets dropped. So a
higher number for this setting will increase the chance that a
thread is able to collect a sample, but also necessarily means that
there will be more work done by the profiler. You can run Mono with
the \f[I]--stats\f[] option to see statistics about sample events.
.IP \[bu] 2
\f[I]calldepth=NUM\f[]: ignore method enter/leave events when the
call chain depth is bigger than NUM.
.IP \[bu] 2
\f[I]zip\f[]: automatically compress the output data in gzip
format.
.IP \[bu] 2
\f[I]output=OUTSPEC\f[]: instead of writing the profiling data to
the output.mlpd file, substitute \f[I]%p\f[] in \f[I]OUTSPEC\f[]
with the current process id and \f[I]%t\f[] with the current date
and time, then do according to \f[I]OUTSPEC\f[]:
.RS 2
.IP \[bu] 2
If \f[I]OUTSPEC\f[] begins with a \f[I]|\f[] character, execute the
rest as a program and feed the data to its standard input.
.IP \[bu] 2
If \f[I]OUTSPEC\f[] begins with a \f[I]#\f[] character, parse the
rest as a file descriptor number, and feed the data to this file
descriptor.
.IP \[bu] 2
otherwise write the data the the named file: note that is a file by
that name already exists, it is truncated.
.TP
\fB\-\-alloc\-sort\fR=\fImode\fR
Sort allocations according to \fImode\fR, which can be one of:
.RS
.TP
\fBbytes\fR (default)
Sort by the amount of heap bytes occupied by all allocated objects of
a type.
.TP
\fBcount\fR
Sort by the total amount of allocations of a type.
.RE
.IP \[bu] 2
\f[I]report\f[]: the profiling data is sent to mprof-report, which
will print a summary report.
This is equivalent to the option: \f[B]output=mprof-report\ -\f[].
If the \f[I]output\f[] option is specified as well, the report will
be written to the output file instead of the console.
.IP \[bu] 2
\f[I]port=PORT\f[]: specify the tcp/ip port to use for the
listening command server.
Currently not available for windows.
This server is started for example when heapshot=ondemand is used:
it will read commands line by line.
The following commands are available:
.RS 2
.IP \[bu] 2
\f[I]heapshot\f[]: perform a heapshot as soon as possible
.TP
\fB\-\-counters\-sort\fR=\fImode\fR
Sort counters according to \fImode\fR. This alters how the
\fBcounters\fR report is presented. It can be one of:
.RS
.TP
\fBtime\fR (default)
Present a list of samples, each containing a list of counter
name-value pairs.
.TP
\fBcategory\fR
Present a list of counter names, each containing a list of sampled
values.
.RE
.IP \[bu] 2
\f[I]nocounters\f[]: disables sampling of runtime and performance
counters, which is normally done every 1 second.
.IP
This option has no effect unless \fB\-\-verbose\fR is passed.
.TP
\fB\-\-track\fR=\fIobjects\fR
Track what happens to the specified objects. \fIobjects\fR is a
comma-separated list of object addresses.
.TP
\fB\-\-find\fR=\fIspec\fR
Find and track what happens to objects matching \fIspec\fR, which can
have one of these forms:
.RS
.TP
\fBS\fR:\fIminimum_size\fR
Look for objects that are at least \fIminimum_size\fR bytes in size.
.TP
\fBT\fR:\fIname_fragment\fR
Look for objects whose type name contain \fIname_fragment\fR.
.RE
.SS Analyzing the profile data
.PP
Currently there is a command line program (\f[I]mprof-report\f[])
to analyze the data produced by the profiler.
This is ran automatically when the \f[I]report\f[] profiler option
is used.
Simply run:
.PP
\f[B]mprof-report\ output.mlpd\f[]
.PP
to see a summary report of the data included in the file.
.SS Trace information for events
.PP
Often it is important for some events, like allocations, lock
contention and exception throws to know where they happened.
Or we may want to see what sequence of calls leads to a particular
method invocation.
To see this info invoke mprof-report as follows:
.PP
\f[B]mprof-report\ --traces\ output.mlpd\f[]
.PP
The maximum number of methods in each stack trace can be specified
with the \f[I]--maxframes=NUM\f[] option:
.PP
\f[B]mprof-report\ --traces\ --maxframes=4\ output.mlpd\f[]
.PP
The stack trace info will be available if method enter/leave events
have been recorded or if stack trace collection wasn't explicitly
disabled with the \f[I]maxframes=0\f[] profiler option.
.PP
The \f[I]--traces\f[] option also controls the reverse reference
feature in the heapshot report: for each class it reports how many
references to objects of that class come from other classes.
.SS Sort order for methods and allocations
.PP
When a list of methods is printed the default sort order is based
on the total time spent in the method.
This time is wall clock time (that is, it includes the time spent,
for example, in a sleep call, even if actual cpu time would be
basically 0).
Also, if the method has been ran on different threads, the time
will be a sum of the time used in each thread.
.PP
To change the sort order, use the option:
.PP
\f[B]--method-sort=MODE\f[]
.PP
where \f[I]MODE\f[] can be:
.IP \[bu] 2
\f[I]self\f[]: amount of time spent in the method itself and not in
its callees
.IP \[bu] 2
\f[I]calls\f[]: the number of method invocations
.IP \[bu] 2
\f[I]total\f[]: the total time spent in the method.
.PP
Object allocation lists are sorted by default depending on the
total amount of bytes used by each type.
.PP
To change the sort order of object allocations, use the option:
.PP
\f[B]--alloc-sort=MODE\f[]
.PP
where \f[I]MODE\f[] can be:
.IP \[bu] 2
\f[I]count\f[]: the number of allocated objects of the given type
.IP \[bu] 2
\f[I]bytes\f[]: the total number of bytes used by objects of the
given type
.PP
To change the sort order of counters, use the option:
.PP
\f[B]--counters-sort=MODE\f[]
.PP
where \f[I]MODE\f[] can be:
.IP \[bu] 2
\f[I]time\f[]: sort values by time then category
.IP \[bu] 2
\f[I]category\f[]: sort values by category then time
.SS Selecting what data to report
.PP
The profiler by default collects data about many runtime subsystems
and mprof-report prints a summary of all the subsystems that are
found in the data file.
It is possible to tell mprof-report to only show information about
some of them with the following option:
.PP
\f[B]--reports=R1[,R2...]\f[]
.PP
where the report names R1, R2 etc.
can be:
.IP \[bu] 2
\f[I]header\f[]: information about program startup and profiler
version
.IP \[bu] 2
\f[I]jit\f[]: JIT compiler information
.IP \[bu] 2
\f[I]sample\f[]: statistical sampling information
.IP \[bu] 2
\f[I]gc\f[]: garbage collection information
.IP \[bu] 2
\f[I]alloc\f[]: object allocation information
.IP \[bu] 2
\f[I]call\f[]: method profiling information
.IP \[bu] 2
\f[I]metadata\f[]: metadata events like image loads
.IP \[bu] 2
\f[I]exception\f[]: exception throw and handling information
.IP \[bu] 2
\f[I]monitor\f[]: lock contention information
.IP \[bu] 2
\f[I]thread\f[]: thread information
.IP \[bu] 2
\f[I]domain\f[]: app domain information
.IP \[bu] 2
\f[I]context\f[]: remoting context information
.IP \[bu] 2
\f[I]heapshot\f[]: live heap usage at heap shots
.IP \[bu] 2
\f[I]counters\f[]: counters samples
.IP \[bu] 2
\f[I]stats\f[]: event statistics
.PP
It is possible to limit some of the data displayed to a timeframe
of the program execution with the option:
.PP
\f[B]--time=FROM-TO\f[]
.PP
where \f[I]FROM\f[] and \f[I]TO\f[] are seconds since application
startup (they can be floating point numbers).
.PP
Another interesting option is to consider only events happening on
a particular thread with the following option:
.PP
\f[B]--thread=THREADID\f[]
.PP
where \f[I]THREADID\f[] is one of the numbers listed in the thread
summary report (or a thread name when present).
.PP
By default long lists of methods or other information like object
allocations are limited to the most important data.
To increase the amount of information printed you can use the
option:
.PP
\f[B]--verbose\f[]
.SS Track individual objects
.PP
Instead of printing the usual reports from the profiler data, it is
possible to track some interesting information about some specific
object addresses.
The objects are selected based on their address with the
\f[I]--track\f[] option as follows:
.PP
\f[B]--track=0xaddr1[,0xaddr2,...]\f[]
.PP
The reported info (if available in the data file), will be class
name, size, creation time, stack trace of creation (with the
\f[I]--traces\f[] option), etc.
If heapshot data is available it will be possible to also track
what other objects reference one of the listed addresses.
.PP
The object addresses can be gathered either from the profiler
report in some cases (like in the monitor lock report), from the
live application or they can be selected with the
\f[I]--find=FINDSPEC\f[] option.
FINDSPEC can be one of the following:
.IP \[bu] 2
\f[I]S:SIZE\f[]: where the object is selected if its size is at
least \f[I]SIZE\f[]
.IP \[bu] 2
\f[I]T:NAME\f[]: where the object is selected if \f[I]NAME\f[]
partially matches its class name
.PP
This option can be specified multiple times with one of the
different kinds of FINDSPEC.
For example, the following:
.PP
\f[B]--find=S:10000\ --find=T:Byte[]\f[]
.PP
will find all the byte arrays that are at least 10000 bytes in
size.
.PP
Note that with a moving garbage collector the object address can
change, so you may need to track the changed address manually.
It can also happen that multiple objects are allocated at the same
address, so the output from this option can become large.
.SS Saving a profiler report
.PP
By default mprof-report will print the summary data to the console.
To print it to a file, instead, use the option:
.PP
\f[B]--out=FILENAME\f[]
.SS Dealing with profiler slowness
.PP
If the profiler needs to collect lots of data, the execution of the
program will slow down significantly, usually 10 to 20 times
slower.
There are several ways to reduce the impact of the profiler on the
program execution.
.IP "\f[I]Use the statistical sampling mode\f[]" 4
.Sp
Statistical sampling allows executing a program under the profiler
with minimal performance overhead (usually less than 10%).
This mode allows checking where the program is spending most of
its execution time without significantly perturbing its behaviour.
.IP "\f[I]Collect less data\f[]" 4
.Sp
Collecting method enter/leave events can be very expensive,
especially in programs that perform many millions of tiny calls.
The profiler option \f[I]nocalls\f[] can be used to avoid
collecting this data or it can be limited to only a few call levels
with the \f[I]calldepth\f[] option.
.Sp
Object allocation information is expensive as well, though much
less than method enter/leave events.
If it's not needed, it can be skipped with the \f[I]noalloc\f[]
profiler option.
Note that when method enter/leave events are discarded, by default
stack traces are collected at each allocation and this can be
expensive as well.
The impact of stack trace information can be reduced by setting a
low value with the \f[I]maxframes\f[] option or by eliminating them
completely, by setting it to 0.
.Sp
The other major source of data is the \f[I]heapshot\f[] profiler
option: especially if the managed heap is big, since every object
needs to be inspected.
The \f[I]MODE\f[] parameter of the \f[I]heapshot\f[] option can be
used to reduce the frequency of the heap shots.
.SS Dealing with the size of the data files
.PP
When collecting a lot of information about a profiled program, huge
data files can be generated.
There are a few ways to minimize the amount of data, for example by
not collecting some of the more space-consuming information or by
compressing the information on the fly or by just generating a
summary report.
.IP "\f[I]Reducing the amount of data\f[]" 4
.Sp
Method enter/leave events can be excluded completely with the
\f[I]nocalls\f[] option or they can be limited to just a few levels
of calls with the \f[I]calldepth\f[] option.
For example, the option:
.Sp
\f[B]calldepth=10\f[]
.Sp
will ignore the method events when there are more than 10 managed
stack frames.
This is very useful for programs that have deep recursion or for
programs that perform many millions of tiny calls deep enough in
the call stack.
The optimal number for the calldepth option depends on the program
and it needs to be balanced between providing enough profiling
information and allowing fast execution speed.
.Sp
Note that by default, if method events are not recorded at all, the
profiler will collect stack trace information at events like
allocations.
To avoid gathering this data, use the \f[I]maxframes=0\f[] profiler
.IP
Both an \fBS\fR and \fBT\fR spec can be given by passing the option
twice.
.TP
\fB\-\-thread\fR=\fItid\fR
Consider only events from the thread with ID \fItid\fR.
.TP
\fB\-\-time\fR=\fIspan\fR
Consider only events occurring in the specified time span. \fIspan\fR
must be of the form \fIfrom\fR\-\fIto\fR where \fIfrom\fR and
\fIto\fR are seconds since the program started.
.TP
\fB\-\-verbose\fR
Print verbose output.
.TP
\fB\-\-debug\fR
Print extremely detailed debug output. Most users should not use this
option.
.Sp
Allocation events can be eliminated with the \f[I]noalloc\f[]
option.
.Sp
Heap shot data can also be huge: by default it is collected at each
major collection.
To reduce the frequency, you can specify a heapshot mode: for
example to collect every 5 collections (including major and minor):
.Sp
\f[B]heapshot=5gc\f[]
.Sp
or when at least 5 seconds passed since the last heap shot:
.Sp
\f[B]heapshot=5000ms\f[]
.IP "\f[I]Compressing the data\f[]" 4
.Sp
To reduce the amout of disk space used by the data, the data can be
compressed either after it has been generated with the gzip
command:
.Sp
\f[B]gzip\ -9\ output.mlpd\f[]
.Sp
or it can be compressed automatically by using the \f[I]zip\f[]
profiler option.
Note that in this case there could be a significant slowdown of the
profiled program.
.Sp
The mprof-report program will tranparently deal with either
compressed or uncompressed data files.
.IP "\f[I]Generating only a summary report\f[]" 4
.Sp
Often it's enough to look at the profiler summary report to
diagnose an issue and in this case it's possible to avoid saving
the profiler data file to disk.
This can be accomplished with the \f[I]report\f[] profiler option,
which will basically send the data to the mprof-report program for
display.
.Sp
To have more control of what summary information is reported (or to
use a completely different program to decode the profiler data),
the \f[I]output\f[] profiler option can be used, with \f[B]|\f[] as
the first character: the rest of the output name will be executed
as a program with the data fed in on the standard input.
.Sp
For example, to print only the Monitor summary with stack trace
information, you could use it like this:
.Sp
\f[B]output=|mprof-report\ --reports=monitor\ --traces\ -\f[]
.SH WEB SITE
http://www.mono-project.com/docs/debug+profile/profile/profiler/
.SH REPORTS
The following reports are available:
.TP
\fBheader\fR
Program startup and profiler version and operational information.
.TP
\fBjit\fR
JIT compiler statistics.
.TP
\fBgc\fR
Garbage collection and handle statistics.
.TP
\fBsample\fR
Flat statistical sampling profile.
.TP
\fBalloc\fR
Per-class GC allocation statistics and backtraces.
.TP
\fBcall\fR
Method call statistics and backtraces.
.TP
\fBmetadata\fR
Loaded images and assemblies.
.TP
\fBexception\fR
Exception statistics and backtraces.
.TP
\fBmonitor\fR
Monitor lock statistics and backtraces.
.TP
\fBthread\fR
Managed thread names.
.TP
\fBdomain\fR
Loaded application domains.
.TP
\fBcontext\fR
Loaded remoting contexts.
.TP
\fBheapshot\fR
Heap snapshot information.
.TP
\fBcounters\fR
Performance counter samples.
.SH SEE ALSO
.PP
mono(1)
.SH AUTHORS
Paolo Molaro, Alex Rønne Petersen
\fBmono\fR(1), \fBmono\-profilers\fR(1)
+2 -2
View File
@@ -515,10 +515,10 @@ The Mono SQL Query Tool is released under the terms of the GNU GPL.
Please read the accompanying `COPYING' file for details. Alternative
licenses are available from Novell or Daniel Morgan.
.SH BUGS
To report bugs in the compiler, you can use `bug-buddy', or you can
To report bugs in the compiler, you can
file bug reports in our bug tracking system:
.nf
http://bugzilla.xamarin.com.
https://github.com/mono/mono/issues
.fi
.PP
.SH MAILING LISTS
+8 -4
View File
@@ -6,8 +6,9 @@ SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs packages
basic_SUBDIRS := build jay class
build_SUBDIRS := build class class/aot-compiler tools ilasm
monodroid_SUBDIRS := build class
monotouch_SUBDIRS := build class
monodroid_SUBDIRS := build class tools
monodroid_tools_SUBDIRS := build class tools
monotouch_SUBDIRS := build class tools
monotouch_watch_SUBDIRS := build class
monotouch_tv_SUBDIRS := build class
monotouch_runtime_SUBDIRS := build class
@@ -24,6 +25,7 @@ xbuild_14_SUBDIRS := build class tools/xbuild
winaot_SUBDIRS := build class
orbis_SUBDIRS := build class
unreal_SUBDIRS := build class
wasm_SUBDIRS := build class
include build/rules.make
@@ -45,7 +47,7 @@ all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--%
@:
profiles-do--%:
$(MAKE) $(PROFILES:%=profile-do--%--$*)
$(if $(PROFILES),$(MAKE) $(PROFILES:%=profile-do--%--$*))
# The % below looks like profile-name--target-name
profile-do--%:
@@ -66,6 +68,7 @@ $(_boot_:%=profile-do--xbuild_12--%): profile-do--xbuild_12--%:
$(_boot_:%=profile-do--binary_reference_assemblies--%): profile-do--binary_reference_assemblies--%: profile-do--build--%
$(_boot_:%=profile-do--net_4_x--%): profile-do--net_4_x--%: profile-do--build--%
$(_boot_:%=profile-do--monodroid--%): profile-do--monodroid--%: profile-do--build--%
$(_boot_:%=profile-do--monodroid_tools--%): profile-do--monodroid_tools--%: profile-do--build--%
$(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--build--%
$(_boot_:%=profile-do--monotouch_watch--%): profile-do--monotouch_watch--%: profile-do--build--%
$(_boot_:%=profile-do--monotouch_tv--%): profile-do--monotouch_tv--%: profile-do--build--%
@@ -79,6 +82,7 @@ $(_boot_:%=profile-do--testing_aot_full--%): profile-do--testing_aot_fu
$(_boot_:%=profile-do--winaot--%): profile-do--winaot--%: profile-do--build--%
$(_boot_:%=profile-do--orbis--%): profile-do--orbis--%: profile-do--build--%
$(_boot_:%=profile-do--unreal--%): profile-do--unreal--%: profile-do--build--%
$(_boot_:%=profile-do--wasm--%): profile-do--wasm--%: profile-do--build--%
$(_boot_:%=profile-do--build--%): profile-do--build--%: profile-do--basic--%
testcorlib:
@@ -155,7 +159,7 @@ $(MONO_API_SNAPSHOT_PROFILE_PATH)%.cs: $(topdir)class/lib/$(PROFILE)/%.dll $(GEN
mono-api-current: $(MONO_API_ASSEMBLIES_CS)
mono-api-current-clean:
$(Q) rm -rf "$(MONO_API_SNAPSHOT_PROFILE_PATH)"
$(Q) find "$(MONO_API_SNAPSHOT_PROFILE_PATH)" -name "*.cs" -type f -delete
mono-api-diff:
@echo "Regenerating API snapshot..."
+2
View File
@@ -45,6 +45,8 @@ static partial class SR
{
return string.Format (CultureInfo.InvariantCulture, resourceFormat, p1, p2, p3);
}
internal static string GetResourceString (string str) => str;
}
#if !INSIDE_CORLIB
+2 -2
View File
@@ -42,9 +42,9 @@ class X {
Version min_mono_version;
#if __MonoCS__
min_mono_version = new Version (5, 5);
min_mono_version = new Version (5, 13);
#else
min_mono_version = new Version (4, 9);
min_mono_version = new Version (5, 10);
#endif
if (version < min_mono_version)
+13 -2
View File
@@ -10,9 +10,17 @@
CODEPAGE = 65001
RUNTIME_FLAGS =
ifdef TEST_WITH_INTERPRETER
TEST_RUNTIME_FLAGS = --interpreter
else
TEST_RUNTIME_FLAGS =
endif
TEST_HARNESS = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/$(PARENT_PROFILE)nunit-lite-console.exe
PLATFORM_DEBUG_FLAGS = /debug:portable
MCS_FLAGS =
# Workaround for https://bugzilla.xamarin.com/show_bug.cgi?id=59967
MCS_FLAGS = /features:peverify-compat /langversion:latest
MBAS_FLAGS = -debug
LIBRARY_FLAGS =
ifndef CFLAGS
@@ -24,7 +32,10 @@ mono_libdir = $(exec_prefix)/lib
sysconfdir = $(prefix)/etc
#RUNTIME = mono
RUNTIME = false
TEST_RUNTIME = MONO_PATH="./$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/$(PROFILE_DIRECTORY)$(PLATFORM_PATH_SEPARATOR)$(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) --debug
MONO_PATH_TOP = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/
MONO_PATH_TESTS = $(MONO_PATH_TOP)/tests
TEST_MONO_PATH = $(MONO_PATH_TOP)$(PLATFORM_PATH_SEPARATOR)$(MONO_PATH_TESTS)
TEST_RUNTIME = MONO_PATH="$(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR).$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) --debug
# In case you want to add MCS_FLAGS, this lets you not have to
# keep track of the default value
+12 -2
View File
@@ -42,8 +42,18 @@ executable_CLEAN_FILES += $(build_lib) $(build_lib).so $(build_lib).mdb $(build_
makefrag = $(depsdir)/$(PROFILE)_$(base_prog).makefrag
MCS_REFERENCES = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.dll,$(LIB_REFS))
MCS_REFERENCES += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.exe,$(EXE_REFS))
LIB_REFS_ALL = $(DEFAULT_REFERENCES) $(LIB_REFS)
ifdef TARGET_NET_REFERENCE
# System*, mscorlib references come from the TARGET_NET_REFERENCE dir, others from the profile dir
LIB_REFS_MONO = $(call _FILTER_OUT,System,$(call _FILTER_OUT,mscorlib,$(LIB_REFS_ALL)))
LIB_REFS_SYSTEM = $(filter-out $(LIB_REFS_MONO),$(LIB_REFS_ALL))
MCS_REFERENCES = $(patsubst %,-r:$(topdir)/../external/binary-reference-assemblies/$(TARGET_NET_REFERENCE)/%.dll,$(LIB_REFS_SYSTEM))
MCS_REFERENCES += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.dll,$(LIB_REFS_MONO))
else
MCS_REFERENCES = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.dll,$(LIB_REFS_ALL))
endif
ifdef KEYFILE
LIB_MCS_FLAGS += /keyfile:$(KEYFILE)
Regular → Executable
+26 -1
View File
@@ -7,7 +7,7 @@ extfile=$4
extexcfile=$5
process_includes_1() {
sed -e '/^[ \t]*$/d' -e '/^[ \t]*#/d' $1 > $2
sed -e '/^[ \t]*$/d' -e '/^[ \t]*#/d' -e '/*/d' $1 > $2
if cmp -s $1 $2; then
false
else
@@ -17,6 +17,31 @@ process_includes_1() {
echo $outfile: $inc >> $outfile.makefrag
echo $inc: >> $outfile.makefrag
done
# expand wildcards
sed -n '/*/p' $1 | grep -v '#' |
while read wildc; do
# quick syntax to exclude files:
# ../../../MyDir/*.cs:FileToExclude1.cs,FileToExclude2.cs
wc=`echo $wildc | cut -d \: -f 1` # ../../../MyDir/*.cs
qexc=`echo $wildc | cut -d \: -f 2` # FileToExclude1.cs,FileToExclude2.cs
if test "$wc" = "$qexc"; then
# no quick excludes - just expand the wildcard
ls $wildc >> $2
else
wcdir=`echo $wildc | cut -d \* -f 1` # ../../../MyDir/
# Enumerate files from 'FileToExclude1.cs,FileToExclude2.cs'
# and save to $outfile.exc
oldIFS=$IFS
IFS=,
for i in $qexc; do
echo "$wcdir$i" >> $outfile.exc
done
IFS=$oldIFS
ls $wc >> $2
fi
done
fi
}
+40 -7
View File
@@ -18,13 +18,31 @@
# Have to rename to handle differences between assembly/directory names
DEP_LIBS=$(patsubst System.Xml,System.XML,$(LIB_REFS))
_FILTER_OUT = $(foreach x,$(2),$(if $(findstring $(1),$(x)),,$(x)))
LIB_REFS_FULL = $(call _FILTER_OUT,=, $(LIB_REFS))
LIB_REFS_FULL = $(call _FILTER_OUT,=, $(LIB_REFS)) $(DEFAULT_REFERENCES)
LIB_REFS_ALIAS = $(filter-out $(LIB_REFS_FULL),$(LIB_REFS))
ifdef TARGET_NET_REFERENCE
# System*, mscorlib references come from the TARGET_NET_REFERENCE dir, others from the profile dir
LIB_REFS_MONO_FULL = $(call _FILTER_OUT,System,$(call _FILTER_OUT,mscorlib,$(LIB_REFS_FULL)))
LIB_REFS_MONO_ALIAS = $(call _FILTER_OUT,System,$(LIB_REFS_ALIAS))
LIB_REFS_NET_FULL = $(filter-out $(LIB_REFS_MONO_FULL),$(LIB_REFS_FULL))
LIB_REFS_NET_ALIAS = $(filter-out $(LIB_REFS_MONO_ALIAS),$(LIB_REFS_ALIAS))
LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/../external/binary-reference-assemblies/$(TARGET_NET_REFERENCE)/%.dll,$(LIB_REFS_NET_FULL))
LIB_MCS_FLAGS += $(patsubst %,-r:%.dll, $(subst =,=$(topdir)/../external/binary-reference-assemblies/$(TARGET_NET_REFERENCE)/,$(LIB_REFS_NET_ALIAS)))
LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.dll,$(LIB_REFS_MONO_FULL))
LIB_MCS_FLAGS += $(patsubst %,-r:%.dll, $(subst =,=$(topdir)/class/lib/$(PROFILE_DIRECTORY)/,$(LIB_REFS_MONO_ALIAS)))
else
ifdef API_BIN_REFS
LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/../external/binary-reference-assemblies/$(API_BIN_PROFILE)/%.dll,$(API_BIN_REFS))
endif
LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.dll,$(LIB_REFS_FULL))
LIB_MCS_FLAGS += $(patsubst %,-r:%.dll, $(subst =,=$(topdir)/class/lib/$(PROFILE_DIRECTORY)/,$(LIB_REFS_ALIAS)))
endif
ifdef KEYFILE
KEYFILE_MCS_FLAGS += /keyfile:$(KEYFILE)
@@ -45,6 +63,15 @@ the_libdir_base = $(topdir)/class/$(lib_dir)/$(PROFILE_DIRECTORY)/$(if $(LIBRARY
ifdef RESOURCE_STRINGS
ifneq (basic, $(PROFILE))
RESOURCE_STRINGS_FILES += $(RESOURCE_STRINGS:%=--resourcestrings:%)
IL_REPLACE_FILES += $(IL_REPLACE:%=--ilreplace:%)
endif
endif
ifdef ENFORCE_LIBRARY_WARN_AS_ERROR
ifeq ($(LIBRARY_WARN_AS_ERROR),yes)
ifndef MCS_MODE
LIB_MCS_FLAGS += -warnaserror
endif
endif
endif
@@ -311,10 +338,10 @@ endif
ifndef NO_BUILD
$(build_lib): $(response) $(sn) $(BUILT_SOURCES) $(build_libdir)/.stamp $(GEN_RESOURCE_DEPS)
$(build_lib): $(response) $(sn) $(BUILT_SOURCES) $(build_libdir)/.stamp $(GEN_RESOURCE_DEPS) $(MODULE_DEPS)
$(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) $(KEYFILE_MCS_FLAGS) $(GEN_RESOURCE_FLAGS) -target:library -out:$@ $(BUILT_SOURCES_cmdline) @$(response)
ifdef RESOURCE_STRINGS_FILES
$(Q) $(STRING_REPLACER) $(RESOURCE_STRINGS_FILES) $@
$(Q) $(STRING_REPLACER) $(RESOURCE_STRINGS_FILES) $(IL_REPLACE_FILES) $@
endif
$(Q) $(SN) -R $@ $(LIBRARY_SNK)
@@ -361,5 +388,11 @@ $(the_libdir)/.doc-stamp: $(the_lib)
gen-deps:
@echo "$(DEPS_TARGET_DIR): $(DEP_DIRS) $(DEP_LIBS)" >> $(DEPS_FILE)
update-corefx-sr: $(RESX_RESOURCE_STRING)
MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resx2sr.exe $(RESX_RESOURCE_STRING) >corefx/SR.cs
update-corefx-sr-generic:
ifneq ($(RESX_STRINGS),)
MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resx2sr.exe $(RESX_STRINGS) >$(SR_OUTPUT)
endif
update-corefx-sr: $(RESX_RESOURCE_STRING) $(XTEST_RESX_RESOURCE_STRING)
make SR_OUTPUT=corefx/SR.cs RESX_STRINGS="$(RESX_RESOURCE_STRING)" update-corefx-sr-generic \
&& make SR_OUTPUT=corefx/SR.tests.cs RESX_STRINGS=$(XTEST_RESX_RESOURCE_STRING) update-corefx-sr-generic
+7 -3
View File
@@ -26,11 +26,15 @@ else
endif
endif
ILASM = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/ilasm.exe
STRING_REPLACER = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/cil-stringreplacer.exe
MCS = $(BOOTSTRAP_MCS)
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib
API_BIN_PROFILE = v4.7.1
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
NO_SIGN_ASSEMBLY = yes
NO_TEST = yes
NO_INSTALL = yes
@@ -45,7 +49,7 @@ LIBRARY_COMPILE = $(BOOT_COMPILE)
#
# Copy from rules.make because I don't know how to unset MCS_FLAGS
#
USE_MCS_FLAGS = /codepage:$(CODEPAGE) /nologo /noconfig $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS)
USE_MCS_FLAGS = /codepage:$(CODEPAGE) /nologo /noconfig /deterministic $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
.PHONY: profile-check do-profile-check
profile-check:
+3 -2
View File
@@ -13,8 +13,9 @@ PLATFORMS = darwin linux win32
profile-check:
@:
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib
API_BIN_PROFILE = v4.7.1
NO_SIGN_ASSEMBLY = yes
NO_TEST = yes
+2 -2
View File
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
@@ -24,9 +24,9 @@ PROFILE_MCS_FLAGS = \
-d:ANDROID \
-nowarn:1699 \
-nostdlib \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
API_BIN_PROFILE = build/monodroid
FRAMEWORK_VERSION = 2.1
# the tuner takes care of the install
+18
View File
@@ -0,0 +1,18 @@
# -*- makefile -*-
BOOTSTRAP_PROFILE = build
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_CSC)
MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
TARGET_NET_REFERENCE = v4.6
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 4.5
NO_INSTALL = yes
+2 -2
View File
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
@@ -24,10 +24,10 @@ PROFILE_MCS_FLAGS = \
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
-nowarn:1699 \
-nostdlib \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS) \
$(MONOTOUCH_MCS_FLAGS)
API_BIN_PROFILE = build/monotouch
FRAMEWORK_VERSION = 2.1
# This is utility build only
+5 -2
View File
@@ -12,9 +12,12 @@ PLATFORMS = darwin linux win32
profile-check:
@:
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -d:MULTIPLEX_OS -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -d:MULTIPLEX_OS -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS)
API_BIN_PROFILE = v4.7.1
FRAMEWORK_VERSION = 4.5
XBUILD_VERSION = 4.0
MONO_FEATURE_APPLETLS=1
ENFORCE_LIBRARY_WARN_AS_ERROR = yes
+2 -2
View File
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
@@ -26,9 +26,9 @@ PROFILE_MCS_FLAGS = \
-d:DISABLE_COM \
-nowarn:1699 \
-nostdlib \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
API_BIN_PROFILE = build/monotouch
FRAMEWORK_VERSION = 2.1
# the tuner takes care of the install
+2 -2
View File
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
@@ -25,9 +25,9 @@ PROFILE_MCS_FLAGS = \
-d:DISABLE_COM \
-nowarn:1699 \
-nostdlib \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
API_BIN_PROFILE = build/monotouch
FRAMEWORK_VERSION = 2.1
# the tuner takes care of the install
+2 -2
View File
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
@@ -22,9 +22,9 @@ PROFILE_MCS_FLAGS = \
-d:MONO \
-nowarn:1699 \
-nostdlib \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
API_BIN_PROFILE = build/monotouch
FRAMEWORK_VERSION = 2.1
NO_INSTALL = yes
+2 -2
View File
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
@@ -22,9 +22,9 @@ PROFILE_MCS_FLAGS = \
-d:MONO \
-nowarn:1699 \
-nostdlib \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
API_BIN_PROFILE = build/monotouch
FRAMEWORK_VERSION = 2.1
NO_INSTALL = yes
+41
View File
@@ -0,0 +1,41 @@
#! -*- makefile -*-
BOOTSTRAP_PROFILE = build
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_CSC)
MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:NET_2_1 \
-d:NET_3_5 \
-d:NET_4_0 \
-d:NET_4_5 \
-d:MONO \
-d:MOBILE,MOBILE_LEGACY \
-d:FULL_AOT_DESKTOP \
-d:FULL_AOT_RUNTIME \
-d:WASM \
-d:DISABLE_REMOTING \
-d:DISABLE_COM \
-d:FEATURE_NO_BSD_SOCKETS \
-nowarn:1699 \
-nostdlib \
$(PLATFORM_DEBUG_FLAGS)
API_BIN_PROFILE = build/monotouch
FRAMEWORK_VERSION = 2.1
# the tuner takes care of the install
NO_INSTALL = yes
AOT_FRIENDLY_PROFILE = yes
ALWAYS_AOT = yes
MOBILE_PROFILE = yes
NO_VTS_TEST = yes
NO_CONSOLE = yes
+2 -2
View File
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
@@ -26,9 +26,9 @@ PROFILE_MCS_FLAGS = \
-d:WIN_PLATFORM \
-nowarn:1699 \
-nostdlib \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
API_BIN_PROFILE = build/monotouch
FRAMEWORK_VERSION = 2.1
# the tuner takes care of the install
+3 -2
View File
@@ -6,7 +6,7 @@ MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
@@ -23,11 +23,12 @@ PROFILE_MCS_FLAGS = \
-d:XAMARIN_MODERN \
-nowarn:1699 \
-nostdlib \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS) \
$(XAMMAC_MCS_FLAGS)
API_BIN_PROFILE = build/monotouch
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
NO_INSTALL = yes
MOBILE_DYNAMIC = yes
+1 -1
View File
@@ -1,6 +1,6 @@
include $(topdir)/build/profiles/net_4_x.make
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) \
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS) \
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
-d:NO_SYSTEM_DRAWING_DEPENDENCY \
-d:NO_WINFORMS_DEPENDENCY \
+1 -1
View File
@@ -5,7 +5,7 @@ include $(topdir)/build/profiles/net_4_x.make
PLATFORMS:=
PARENT_PROFILE = ../net_4_x$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))/
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/net_4_x$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))/mscorlib.dll
DEFAULT_REFERENCES = ../net_4_x/mscorlib
PROFILE_MCS_FLAGS += -d:XBUILD_12
XBUILD_VERSION = 12.0
+26 -14
View File
@@ -9,6 +9,7 @@
empty :=
space := $(empty) $(empty)
_FILTER_OUT = $(foreach x,$(2),$(if $(findstring $(1),$(x)),,$(x)))
# given $(thisdir), we compute the path to the top directory
#
@@ -26,8 +27,12 @@ Q_MCS=$(if $(V),,@echo "$(if $(MCS_MODE),MCS,CSC) [$(intermediate)$(PROFILE_
Q_AOT=$(if $(V),,@echo "AOT [$(intermediate)$(PROFILE_DIRECTORY)] $(notdir $(@))";)
ifndef BUILD_TOOLS_PROFILE
ifeq ($(PROFILE),basic)
BUILD_TOOLS_PROFILE = basic
else
BUILD_TOOLS_PROFILE = build
endif
endif
USE_MCS_FLAGS = /codepage:$(CODEPAGE) /nologo /noconfig /deterministic $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
USE_MBAS_FLAGS = /codepage:$(CODEPAGE) $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS)
@@ -43,14 +48,15 @@ INSTALL_BIN = $(INSTALL) -c -m 755
INSTALL_LIB = $(INSTALL_BIN)
MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
INTERNAL_MBAS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mbas/mbas.exe
INTERNAL_ILASM = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/ilasm.exe
INTERNAL_CSC_LOCATION = $(CSC_LOCATION)
# Using CSC_SDK_PATH_DISABLED for sanity check that all references have path specified
INTERNAL_CSC = CSC_SDK_PATH_DISABLED= $(RUNTIME) $(RUNTIME_FLAGS) $(CSC_RUNTIME_FLAGS) $(INTERNAL_CSC_LOCATION)
RESGEN = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(RESGEN_EXE) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resgen.exe
RESGEN = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resgen.exe
STRING_REPLACER = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/cil-stringreplacer.exe
ILASM = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/ilasm.exe
depsdir = $(topdir)/build/deps
@@ -155,7 +161,7 @@ gacutil = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/gacutil.exe
GACUTIL = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(gacutil)
endif
STD_TARGETS = test run-test run-test-ondotnet clean install uninstall doc-update
STD_TARGETS = test run-test run-xunit-test run-test-ondotnet clean install uninstall doc-update
$(STD_TARGETS): %: do-%
@@ -171,11 +177,14 @@ do-all-aot:
ifneq ("$(wildcard $(topdir)/class/lib/$(PROFILE))","")
AOT_PROFILE_ASSEMBLIES := $(sort $(patsubst .//%,%,$(filter-out %.dll.dll %.exe.dll %bare% %plaincore% %secxml% %Facades% %ilasm%,$(filter %.dll %.exe,$(wildcard $(topdir)/class/lib/$(PROFILE)/*)))))
AOT_PROFILE_TESTS := $(sort $(patsubst .//%,%,$(filter-out %.dll.dll %.exe.dll %bare% %plaincore% %secxml% %Facades% %ilasm%,$(filter %.dll %.exe,$(wildcard $(topdir)/class/lib/$(PROFILE)/tests/*)))))
AOT_PROFILE_ASSEMBLIES_OUT := $(patsubst %,%$(PLATFORM_AOT_SUFFIX),$(AOT_PROFILE_ASSEMBLIES))
AOT_PROFILE_TESTS_OUT := $(patsubst %,%$(PLATFORM_AOT_SUFFIX),$(AOT_PROFILE_TESTS))
# This can run in parallel
.PHONY: aot-all-profile
ifdef AOT_BUILD_FLAGS
aot-all-profile: $(patsubst %,%$(PLATFORM_AOT_SUFFIX),$(AOT_PROFILE_ASSEMBLIES))
aot-all-profile: $(AOT_PROFILE_ASSEMBLIES_OUT) $(AOT_PROFILE_TESTS_OUT)
else
aot-all-profile:
echo AOT_BUILD_FLAGS not set, skipping AOT.
@@ -183,12 +192,12 @@ endif
%.dll$(PLATFORM_AOT_SUFFIX): %.dll
@ mkdir -p $<_bitcode_tmp
$(Q_AOT) MONO_PATH="$(dir $<)" $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS),temp-path=$<_bitcode_tmp --verbose $< > [email protected]
$(Q_AOT) MONO_PATH="$(topdir)/class/lib/$(PROFILE)" $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS),temp-path=$<_bitcode_tmp --verbose $< > [email protected]
@ rm -rf $<_bitcode_tmp
%.exe$(PLATFORM_AOT_SUFFIX): %.exe
@ mkdir -p $<_bitcode_tmp
$(Q_AOT) MONO_PATH="$(dir $<)" $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS),temp-path=$<_bitcode_tmp --verbose $< > [email protected]
$(Q_AOT) MONO_PATH="$(topdir)/class/lib/$(PROFILE)" $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS),temp-path=$<_bitcode_tmp --verbose $< > [email protected]
@ rm -rf $<_bitcode_tmp
endif #ifneq ("$(wildcard $(topdir)/class/lib/$(PROFILE))","")
@@ -279,6 +288,15 @@ dist-recursive: dist-local
(cd $$d && $(MAKE) distdir=$$reldir/$$d $@) || exit 1 ; \
done
# function to dist files in groups of 100 entries to make sure we don't exceed shell char limits
define distfilesingroups
for f in $(wordlist 1, 100, $(1)) ; do \
dest=`dirname "$(distdir)/$$f"` ; \
$(MKINSTALLDIRS) $$dest && cp -p "$$f" $$dest || exit 1 ; \
done
$(if $(word 101, $(1)), $(call distfilesingroups, $(wordlist 101, $(words $(1)), $(1))))
endef
# The following target can be used like
#
# dist-local: dist-default
@@ -287,17 +305,11 @@ dist-recursive: dist-local
# Notes:
# 1. we invert the test here to not end in an error if ChangeLog doesn't exist.
# 2. we error out if we try to dist a nonexistant file.
# 3. we pick up Makefile, makefile, or GNUmakefile.
# 3. we pick up Makefile
dist-default:
-mkdir -p $(distdir)
test '!' -f ChangeLog || cp ChangeLog $(distdir)
if test -f Makefile; then m=M; fi; \
if test -f makefile; then m=m; fi; \
if test -f GNUmakefile; then m=GNUm; fi; \
for f in $${m}akefile $(DISTFILES) ; do \
dest=`dirname "$(distdir)/$$f"` ; \
$(MKINSTALLDIRS) $$dest && cp -p "$$f" $$dest || exit 1 ; \
done
$(call distfilesingroups, Makefile $(DISTFILES))
if test -d Documentation ; then \
find . -name '*.xml' > .files ; \
tar cTf .files - | (cd $(distdir); tar xf -) ; \
+106 -28
View File
@@ -20,9 +20,20 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin
ifndef NO_TEST
test_nunit_lib = nunitlite.dll
xunit_core := xunit.core xunit.abstractions xunit.assert Xunit.NetCore.Extensions
xunit_core := xunit.core xunit.execution.desktop xunit.abstractions xunit.assert Xunit.NetCore.Extensions
xunit_deps := System.Runtime
xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs)
xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs) $(topdir)/../mcs/class/test-helpers/PlatformDetection.cs
ifeq ($(USE_XTEST_REMOTE_EXECUTOR), YES)
XTEST_REMOTE_EXECUTOR = $(topdir)/class/lib/$(PROFILE)/RemoteExecutorConsoleApp.exe
xunit_src += $(topdir)/../mcs/class/test-helpers/AdminHelper.cs \
$(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mono.cs \
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs \
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.Process.cs \
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs \
$(topdir)/../external/corefx/src/Common/src/System/PasteArguments.cs
endif
xunit_class_deps :=
xunit_libs_ref = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(xunit_core))
@@ -31,8 +42,8 @@ xunit_libs_ref += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/Facades/%.dll,$
xunit_libs_dep = $(xunit_class_deps:%=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)%.dll)
xunit_libs_ref += $(xunit_libs_dep:%=-r:%)
TEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(TEST_LIB_REFS))
XTEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(XTEST_LIB_REFS))
TEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(TEST_LIB_REFS) $(DEFAULT_REFERENCES))
XTEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(XTEST_LIB_REFS) $(DEFAULT_REFERENCES))
test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)%)
test_nunit_ref = $(test_nunit_dep:%=-r:%)
@@ -51,17 +62,21 @@ test_sourcefile_excludes = $(test_lib).exclude.sources
test_pdb = $(test_lib:.dll=.pdb)
test_response = $(depsdir)/$(test_lib).response
test_makefrag = $(depsdir)/$(test_lib).makefrag
test_flags = -r:$(the_assembly) $(test_nunit_ref) $(TEST_MCS_FLAGS) $(TEST_LIB_MCS_FLAGS)
test_flags = $(test_nunit_ref) $(TEST_MCS_FLAGS) $(TEST_LIB_MCS_FLAGS)
ifndef NO_BUILD
test_flags += -r:$(the_assembly)
test_assembly_dep = $(the_assembly)
endif
tests_CLEAN_FILES += $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.dll) $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.pdb) $(test_response) $(test_makefrag)
xtest_sourcefile = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
xtest_sourcefile_excludes = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.exclude.sources)
xunit_test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xunit-test.dll)
xtest_response = $(depsdir)/$(xunit_test_lib).response
xtest_makefrag = $(depsdir)/$(xunit_test_lib).makefrag
xtest_flags = -r:$(the_assembly) $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS)
xtest_flags = -r:$(the_assembly) $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS) /unsafe
ifeq ($(wildcard $(xtest_sourcefile)),)
xtest_sourcefile = $(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
@@ -72,8 +87,6 @@ ifndef HAVE_CS_TESTS
HAVE_CS_TESTS := $(wildcard $(test_sourcefile))
endif
HAVE_SOURCE_EXCLUDES := $(wildcard $(test_sourcefile_excludes))
HAVE_CS_XTESTS := $(wildcard $(xtest_sourcefile))
endif # !NO_TEST
@@ -94,17 +107,24 @@ endif
test_assemblies :=
test_lib_dir = $(topdir)/class/lib/$(PROFILE)/tests
test_lib_output = $(topdir)/class/lib/$(PROFILE)/tests/$(test_lib)
ifdef HAVE_CS_TESTS
test_assemblies += $(test_lib)
endif
test_assemblies += $(test_lib_output)
ifdef test_assemblies
check: run-test
test-local: $(test_assemblies)
run-test-local: run-test-lib
run-test-ondotnet-local: run-test-ondotnet-lib
ifdef TEST_WITH_INTERPRETER
TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotWorking,NotWorkingRuntimeInterpreter,CAS
else
TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotWorking,CAS
endif
TEST_HARNESS_EXCLUDES_ONDOTNET = /exclude:$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotDotNet,CAS
NOSHADOW_FLAG =
@@ -122,14 +142,18 @@ LABELS_ARG = -labels
endif
ifdef ALWAYS_AOT
test-local-aot-compile: $(topdir)/build/deps/nunit-$(PROFILE).stamp
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS) $(test_assemblies)
test-local-aot-compile: $(topdir)/build/deps/nunit-$(PROFILE).stamp $(test_assemblies)
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(AOT_BUILD_FLAGS) $(test_assemblies)
else
test-local-aot-compile: $(topdir)/build/deps/nunit-$(PROFILE).stamp
test-local-aot-compile: $(topdir)/build/deps/nunit-$(PROFILE).stamp $(test_assemblies)
endif # ALWAYS_AOT
ifdef COVERAGE
TEST_COVERAGE_FLAGS = -O=-aot --profile=coverage:output=$(topdir)/class/lib/$(PROFILE_DIRECTORY)/coverage_nunit_$(ASSEMBLY).xml
endif
NUNITLITE_CONFIG_FILE=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-lite-console.exe.config
patch-nunitlite-appconfig:
@@ -141,10 +165,53 @@ ifdef TEST_NUNITLITE_APP_CONFIG_RUNTIME
sed -i -e "/__INSERT_CUSTOM_APP_CONFIG_RUNTIME__/r $(TEST_NUNITLITE_APP_CONFIG_RUNTIME)" $(NUNITLITE_CONFIG_FILE)
endif
ifdef PLATFORM_AOT_SUFFIX
DEDUP_DUMMY_CS=$(topdir)/class/lib/$(PROFILE)/DedupInflatedMethods.cs
DEDUP_DUMMY=$(topdir)/class/lib/$(PROFILE)/DedupInflatedMethods.dll
$(DEDUP_DUMMY):
echo " // Empty Assembly \n\n" > $(DEDUP_DUMMY_CS)
$(CSCOMPILE) -t:library -out:$(DEDUP_DUMMY) $(DEDUP_DUMMY_CS)
rm $(DEDUP_DUMMY_CS)
MKBUNDLE_TEST_BIN = $(TEST_HARNESS).static
MKBUNDLE_EXE = $(topdir)/class/lib/$(PROFILE)/mkbundle.exe
# Pattern based on the one in AOT_PROFILE_ASSEMBLIES
# It's easier if you read it backwards.
# What we do here is get the files in the profile directory that end in "test.dll" or are prefixed with nunit (filter)
# and then strip out everything that we expect to live outside the top level (filter-out)
TEST_ASSEMBLIES:=$(sort $(patsubst .//%,%,$(filter-out %.exe.static %.dll.dll %.exe.dll %bare% %plaincore% %secxml% %Facades% %ilasm%,$(filter %.dll,$(wildcard $(topdir)/class/lib/$(PROFILE)/tests/*)))))
$(MKBUNDLE_EXE): $(topdir)/tools/mkbundle/mkbundle.cs
make -C $(topdir)/tools/mkbundle
mkbundle-all-tests:
$(Q_AOT) $(MAKE) -C $(topdir)/class do-test
$(Q_AOT) $(MAKE) -C $(topdir)/tools/mkbundle
$(Q_AOT) $(MAKE) $(MKBUNDLE_TEST_BIN) # recursive make re-computes variables for TEST_ASSEMBLIES
ifdef MKBUNDLE_DEDUP
MKBUNDLE_DEDUP_COND := $(DEDUP_DUMMY)
DEDUP_ARGS=--aot-dedup $(DEDUP_DUMMY)
endif
$(MKBUNDLE_TEST_BIN): $(TEST_ASSEMBLIES) $(TEST_HARNESS) $(MKBUNDLE_EXE) $(MKBUNDLE_DEDUP_COND)
$(Q_AOT) MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)" PKG_CONFIG_PATH="$(topdir)/../data" $(RUNTIME) $(RUNTIME_FLAGS) $(MKBUNDLE_EXE) -L $(topdir)/class/lib/$(PROFILE) -v --deps $(TEST_HARNESS) $(TEST_ASSEMBLIES) -o $(MKBUNDLE_TEST_BIN) --aot-mode $(AOT_MODE) --aot-runtime $(RUNTIME) --aot-args $(AOT_BUILD_ATTRS) --in-tree $(topdir)/.. --managed-linker $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/monolinker.exe --config $(topdir)/../data/config --i18n all $(DEDUP_ARGS) --keeptemp
endif # PLATFORM_AOT_SUFFIX
ifneq ($(wildcard $(MKBUNDLE_TEST_BIN)),)
TEST_HARNESS_EXEC=$(MKBUNDLE_TEST_BIN)
TEST_HARNESS_EXCLUDES:=$(TEST_HARNESS_EXCLUDES),StaticLinkedAotNotWorking
else
TEST_HARNESS_EXEC=$(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(TEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS)
endif
## FIXME: i18n problem in the 'sed' command below
run-test-lib: test-local test-local-aot-compile patch-nunitlite-appconfig
ok=:; \
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(LABELS_ARG) -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_HARNESS_EXEC) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(LABELS_ARG) -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='$(strip $(test_assemblies))' success='False' time='0'><results><test-case name='crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-$(PROFILE).xml; fi; \
$$ok
@@ -156,24 +223,27 @@ run-test-ondotnet-lib: test-local
$$ok
endif # test_assemblies
endif
TEST_FILES =
ifdef HAVE_CS_TESTS
TEST_FILES += `sed -e '/^$$/d' -e 's,^../,,' -et -e 's,^,Test/,' $(test_sourcefile)`
TEST_FILES += `sed -e '/^$$/d' -e 's,^../,,' -e '/^\#.*$$/d' -et -e 's,^,Test/,' $(test_sourcefile)`
endif
ifdef HAVE_CS_TESTS
$(test_lib): $(the_assembly) $(test_response) $(test_nunit_dep)
$(test_lib_dir):
mkdir -p $@
$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(test_lib_dir)
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
test_response_preprocessed = $(test_response)_preprocessed
# This handles .excludes/.sources pairs, as well as resolving the
# includes that occur in .sources files
$(test_response_preprocessed): $(test_sourcefile)
$(test_response_preprocessed): $(test_sourcefile) $(wildcard $(test_sourcefile_excludes))
$(SHELL) $(topdir)/build/gensources.sh $@ '$(test_sourcefile)' '$(test_sourcefile_excludes)'
$(test_response): $(test_response_preprocessed)
@@ -182,11 +252,11 @@ $(test_response): $(test_response_preprocessed)
$(test_makefrag): $(test_response)
# @echo Creating $@ ...
@sed 's,^,$(test_lib): ,' $< >$@
@sed 's,^,$(test_lib_output): ,' $< >$@
-include $(test_makefrag)
build-test-lib: $(test_lib)
build-test-lib: $(test_lib_output)
@echo Building testing lib
endif
@@ -194,10 +264,11 @@ endif
ifdef HAVE_CS_XTESTS
XTEST_HARNESS_PATH = $(topdir)/../external/xunit-binaries
XTEST_HARNESS_PATH := $(topdir)/../external/xunit-binaries
XTEST_HARNESS = $(XTEST_HARNESS_PATH)/xunit.console.exe
XTEST_HARNESS_FLAGS := -noappdomain -noshadow -parallel none -nunit TestResult-$(PROFILE)-xunit.xml
XTEST_TRAIT := -notrait category=failing -notrait category=nonnetcoreapptests -notrait Benchmark=true -notrait category=outerloop
XTEST_TRAIT := -notrait category=failing -notrait category=nonmonotests -notrait Benchmark=true -notrait category=outerloop
TEST_MONO_PATH := $(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR)$(XTEST_HARNESS_PATH)
ifdef FIXTURE
XTEST_HARNESS_FLAGS += -class $(FIXTURE)
@@ -207,19 +278,26 @@ ifdef TESTNAME
XTEST_HARNESS_FLAGS += -method $(TESTNAME)
endif
ifdef COVERAGE
XTEST_COVERAGE_FLAGS = -O=-aot --profile=coverage:output=$(topdir)/class/lib/$(PROFILE_DIRECTORY)/coverage_xunit_$(ASSEMBLY).xml
endif
check: run-xunit-test-local
run-xunit-test: run-xunit-test-local
xunit-test-local: $(xunit_test_lib)
run-xunit-test-local: run-xunit-test-lib
# cp -rf is a HACK for xunit runner to require xunit.execution.desktop.dll file in local folder on .net only
run-xunit-test-lib: xunit-test-local
run-xunit-test-lib: xunit-test-local $(XTEST_REMOTE_EXECUTOR)
@cp -rf $(XTEST_HARNESS_PATH)/xunit.execution.desktop.dll xunit.execution.desktop.dll
ok=:; \
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xunit_test_lib) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) || ok=false; \
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" REMOTE_EXECUTOR=$(XTEST_REMOTE_EXECUTOR) $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xunit_test_lib) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) || ok=false; \
$$ok
@rm -f xunit.execution.desktop.dll
# Some xunit tests want to be executed in a separate process (see RemoteExecutorTestBase)
$(XTEST_REMOTE_EXECUTOR): $(topdir)/../external/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs
$(TEST_COMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll $< -out:$@
$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src)
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
@@ -227,7 +305,7 @@ xtest_response_preprocessed = $(xtest_response)_preprocessed
# This handles .excludes/.sources pairs, as well as resolving the
# includes that occur in .sources files
$(xtest_response): $(xtest_sourcefile)
$(xtest_response): $(xtest_sourcefile) $(wildcard $(xtest_sourcefile_excludes))
$(SHELL) $(topdir)/build/gensources.sh $@ '$(xtest_sourcefile)' '$(xtest_sourcefile_excludes)'
$(xtest_makefrag): $(xtest_response)
@@ -9,6 +9,7 @@
<ProjectGuid>{E51283DC-7090-479E-B723-01C0953F18EA}</ProjectGuid>
<OutputType>Library</OutputType>
<NoWarn>1699</NoWarn>
<LangVersion>latest</LangVersion>
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix'">linux</HostPlatform>
@@ -17,13 +18,14 @@
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<NoStdLib>True</NoStdLib>
<NoConfig>True</NoConfig>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>
</RootNamespace>
<AssemblyName>Accessibility</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>
@@ -9,6 +9,7 @@
<ProjectGuid>{FFFE76FE-98EE-4FF7-81D9-35C0FE1D3718}</ProjectGuid>
<OutputType>Library</OutputType>
<NoWarn>1699</NoWarn>
<LangVersion>latest</LangVersion>
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix'">linux</HostPlatform>
@@ -17,13 +18,14 @@
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<NoStdLib>True</NoStdLib>
<NoConfig>True</NoConfig>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>
</RootNamespace>
<AssemblyName>Commons.Xml.Relaxng</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>
@@ -102,11 +104,11 @@
-->
<PropertyGroup>
<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
$(ProjectDir)\..\..\jay\jay -ct &lt; $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.jay > $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.cs
$(ProjectDir)\..\..\jay\jay\jay -ct &lt; $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.jay > $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.cs
</PreBuildEvent>
<PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">
$(ProjectDir)\..\..\jay\jay -ct &lt; $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.jay > $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.cs
$(ProjectDir)\..\..\jay\jay.exe -ct &lt; $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.jay > $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.cs
</PreBuildEvent>
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
@@ -117,10 +119,6 @@ $(ProjectDir)\..\..\jay\jay -ct &lt; $(ProjectDir)\..\..\jay\skeleton.cs $(Proje
</PostBuildEvent>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../corlib/corlib-net_4_x.csproj">
<Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>
<Name>corlib-net_4_x</Name>
</ProjectReference>
<ProjectReference Include="../System/System-net_4_x.csproj">
<Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>
<Name>System-net_4_x</Name>
@@ -129,6 +127,10 @@ $(ProjectDir)\..\..\jay\jay -ct &lt; $(ProjectDir)\..\..\jay\skeleton.cs $(Proje
<Project>{87FD2F0F-5222-4AE6-BD63-2D4975E11E5B}</Project>
<Name>System.Xml-net_4_x</Name>
</ProjectReference>
<ProjectReference Include="../corlib/corlib-net_4_x.csproj">
<Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>
<Name>corlib-net_4_x</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
+1 -1
View File
@@ -22,7 +22,7 @@ EXTRA_DISTFILES = \
$(RESOURCE_FILES)
Commons.Xml.Relaxng.Rnc/RncParser.cs: Commons.Xml.Relaxng.Rnc/RncParser.jay $(topdir)/jay/skeleton.cs
$(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $(CURDIR)/Commons.Xml.Relaxng.Rnc/RncParser.jay > Commons.Xml.Relaxng.Rnc/RncParser.cs
$(topdir)/jay/jay -ctv -o Commons.Xml.Relaxng.Rnc/RncParser.cs $< < $(topdir)/jay/skeleton.cs
BUILT_SOURCES = Commons.Xml.Relaxng.Rnc/RncParser.cs
@@ -39,6 +39,7 @@ namespace ICSharpCode.SharpZipLib.BZip2
/// Base class for both the compress and decompress classes.
/// Holds common arrays, and static data.
/// </summary>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public sealed class BZip2Constants
{
public readonly static int[] rNums = {
@@ -44,6 +44,7 @@ namespace ICSharpCode.SharpZipLib.BZip2
/// An input stream that decompresses from the BZip2 format (without the file
/// header chars) to be read as any other stream.
/// </summary>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public class BZip2InputStream : Stream
{
/// <summary>
@@ -45,6 +45,7 @@ namespace ICSharpCode.SharpZipLib.BZip2
/// header chars) into another stream.
/// TODO: Update to BZip2 1.0.1, 1.0.2
/// </summary>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public class BZip2OutputStream : Stream
{
/// <summary>
@@ -86,6 +86,7 @@ namespace ICSharpCode.SharpZipLib.Checksums
/// </summary>
/// <see cref="ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream"/>
/// <see cref="ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream"/>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public sealed class Adler32 : IChecksum
{
/// <summary>
@@ -64,6 +64,7 @@ namespace ICSharpCode.SharpZipLib.Checksums
/// the information needed to generate CRC's on data a byte at a time for all
/// combinations of CRC register values and incoming bytes.
/// </summary>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public sealed class Crc32 : IChecksum
{
readonly static uint CrcSeed = 0xFFFFFFFF;
@@ -45,6 +45,7 @@ namespace ICSharpCode.SharpZipLib.Checksums
/// <code>getValue</code>. The complete checksum object can also be reset
/// so it can be used again with new data.
/// </summary>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public interface IChecksum
{
/// <summary>
@@ -41,6 +41,7 @@ using System;
namespace ICSharpCode.SharpZipLib.Checksums
{
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public class StrangeCRC : IChecksum
{
readonly static uint[] crc32Table = {
@@ -41,6 +41,7 @@ namespace ICSharpCode.SharpZipLib.GZip
/// <summary>
/// This class contains constants used for gzip.
/// </summary>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public class GZipConstants
{
/// <summary>
@@ -79,6 +79,7 @@ namespace ICSharpCode.SharpZipLib.GZip
/// }
/// </code>
/// </example>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public class GZipInputStream : InflaterInputStream
{
/// <summary>
@@ -72,6 +72,7 @@ namespace ICSharpCode.SharpZipLib.GZip
/// }
/// </code>
/// </example>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public class GZipOutputStream : DeflaterOutputStream
{
//Variables
@@ -43,6 +43,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// This exception is used to indicate that there is a problem
/// with a TAR archive header.
/// </summary>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public class InvalidHeaderException : System.IO.IOException
{
public InvalidHeaderException()
@@ -38,6 +38,7 @@ using System.Text;
namespace ICSharpCode.SharpZipLib.Tar {
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public delegate void ProgressMessageHandler(TarArchive archive, TarEntry entry, string message);
/// <summary>
@@ -61,6 +62,7 @@ namespace ICSharpCode.SharpZipLib.Tar {
/// TarBuffer.getCurrentRecordNum() and TarBuffer.getCurrentBlockNum()
/// methods, this would be rather trvial.
/// </summary>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public class TarArchive
{
bool verbose;
@@ -51,6 +51,7 @@ namespace ICSharpCode.SharpZipLib.Tar
/// TarBuffers are created by Tar IO Streams.
/// </p>
/// </summary>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public class TarBuffer
{
@@ -67,6 +67,7 @@ namespace ICSharpCode.SharpZipLib.Tar
///
/// <see cref="TarHeader"/>
/// </summary>
[System.ObsoleteAttribute("This assembly has been deprecated. Please use https://www.nuget.org/packages/SharpZipLib/ instead.")]
public class TarEntry
{
/// <summary>
Loaded 100 of 3128 files, more files were not shown because too many files have changed in this diff. Show more