Aleksey Kliger [Thu, 3 Aug 2017 16:21:10 +0000 (12:21 -0400)]
[custom_attrs] Add bounds checking to load_cattr_value
Aleksey Kliger [Wed, 2 Aug 2017 21:32:23 +0000 (17:32 -0400)]
[custom_attrs] Add (some) bounds checking to create_custom_attr
In principle, mono_verifier_verify_cattr_content should prevent malformed custom
attribute blobs from being passed in here.
In practice:
1. The verifier is not on by default
2. System.Reflection.Emit allows an arbitrary byte[] to be passed in which
means that code like this can cause mono to read past the end of the array.
```
// "1 1-byte constructor argument and then 65280 named properties follow"
assembly.SetCustomAttribute(constructor, new byte[] { 1, 0, 1, 0x00, 0xFF });
var attributes = assembly.GetCustomAttributes(true);
```
Alex Rønne Petersen [Tue, 1 Aug 2017 04:35:36 +0000 (06:35 +0200)]
Merge pull request #5274 from alexrp/profiler-call-contexts
[profiler] Implement call context introspection for enter/leave events.
Alex Rønne Petersen [Fri, 28 Jul 2017 21:23:51 +0000 (23:23 +0200)]
[mini] Add a mono_jit_aot_compiling () function.
Alex Rønne Petersen [Fri, 28 Jul 2017 21:20:23 +0000 (23:20 +0200)]
[mini] Remove some unstable exports that are no longer used by the profiler.
Alex Rønne Petersen [Tue, 25 Jul 2017 22:55:22 +0000 (00:55 +0200)]
[profiler] Implement call context introspection for enter/leave events.
When this feature is enabled for a method, the enter/leave event receives an
additional argument, a so-called 'call context'. This call context contains
enough information about the stack frame of the instrumented method to allow
the enter/leave callback to inspect the 'this' reference, method arguments,
local variables, and the return value (for non-void methods).
This feature enables some interesting scenarios that were not possible with
the regular enter/leave events. For example, a profiler could instrument
well-known methods in the managed thread pool code to get an idea of how an
application is using the thread pool, or it could instrument network-related
methods to gather statistics or even log all network traffic.
This is implemented by storing a MonoProfilerCallContext on the stack, whose
MonoContext field is populated by executing an OP_FILL_PROF_CALL_CTX opcode
which stores the stack pointer, frame pointer, and all callee-saved registers
to it. For the epilogue, a pointer to the return value (for non-void methods)
is also stored in the MonoProfilerCallContext. An address to this context is
then passed to mono_profiler_raise_method_enter/leave. Based on debug info,
all arguments and locals can then be looked up in the instrumented method's
stack frame.
For the interpreter, we just store an InterpFrame pointer on the
MonoProfilerCallContext and look everything up from that. We don't need debug
info in this case.
This feature is currently not supported with LLVM (for regular LLVM mode, it
will fall back to Mono's JIT, while for LLVM-only mode, it's not available).
I also refactored the interpreter code so that enter/leave events are generated
not only when interpreter debugging is enabled. Also, the interpreter will only
call mono_profiler_get_call_instrumentation_flags () once per method now.
Finally, I made the interpreter also generate exception leave events.
Alexander Köplinger [Fri, 28 Jul 2017 20:01:13 +0000 (22:01 +0200)]
[ci] Compile the class lib tests in a separate step
Compiling in parallel via -j should also be faster.
We had this on Wrench but it didn't make it over to Jenkins.
Alexander Köplinger [Mon, 31 Jul 2017 16:02:32 +0000 (18:02 +0200)]
[mono-symbolicate] Run tests with "run-test" target instead of "test"
The "test" target is used to precompile the tests but actual running
should happen with the "run-test" target.
vkargov [Mon, 31 Jul 2017 20:49:58 +0000 (16:49 -0400)]
Merge pull request #5234 from vkargov/vk-kiokunegi
[jit] Check method cache first in mono_get_method_constrained_checked.
Martin Baulig [Mon, 31 Jul 2017 17:01:41 +0000 (13:01 -0400)]
[corlib]: Fix race condition in ExceptionDispatchInfo. (#5279)
Zoltan Varga [Mon, 31 Jul 2017 15:20:22 +0000 (11:20 -0400)]
[llvm] Fix the calling of fault clauses in llvm compiled code. Fixes #58446. (#5286)
Marek Safar [Mon, 31 Jul 2017 14:58:14 +0000 (16:58 +0200)]
[mcs] Implements C#7 expression bodied members enhancement
Marek Safar [Mon, 31 Jul 2017 14:13:59 +0000 (16:13 +0200)]
[mcs] Add parser sequence for case type pattern matching
Vlad Brezae [Fri, 28 Jul 2017 19:14:33 +0000 (22:14 +0300)]
Merge pull request #5260 from BrzVlad/fix-handler-block
[runtime] Fix handler block abort
Aleksey Kliger (λgeek) [Fri, 28 Jul 2017 16:00:09 +0000 (12:00 -0400)]
Merge pull request #5272 from lambdageek/bug-58421
[sre] Handle typeref tokens in fixup_method (Fixes #58421)
Marek Safar [Fri, 28 Jul 2017 09:12:47 +0000 (11:12 +0200)]
[mcs] Implements cloning for yield break. Fixes #57796
Zoltan Varga [Fri, 28 Jul 2017 04:16:18 +0000 (00:16 -0400)]
Eglib integrate (#5267)
* [runtime] Integrate eglib's configure into mono's configure to simplify and speed up the configure process.
* [runtime] Delete some duplicate eglib configure code.
Aleksey Kliger (λgeek) [Thu, 27 Jul 2017 21:55:47 +0000 (17:55 -0400)]
Merge pull request #5271 from lambdageek/bug-58361
[sre] Resolve EnumBuilder tokens in managed (Fixes #58361)
Aleksey Kliger [Thu, 27 Jul 2017 15:47:34 +0000 (11:47 -0400)]
Bump corlib version
Due to changed semantics of ModuleBuilder:RegisterToken icall (it now does not
allow an EnumBuilder argument)
Aleksey Kliger [Wed, 26 Jul 2017 20:59:22 +0000 (16:59 -0400)]
[sre] Resolve EnumBuilder tokens in managed. (Fixes #58361)
In particular, delegate to the TypeBuilder within the EnumBuilder.
Also do not register the EnumBuilder object with the runtime. (Fixes
https://bugzilla.xamarin.com/show_bug.cgi?id=58361)
Aleksey Kliger [Wed, 26 Jul 2017 19:27:48 +0000 (15:27 -0400)]
[test] EnumBuilder regression tests for #58361
Cause the creation of a token for an EnumBuilder object. Test both typedef
tokens (EnumBuilder from same assembly) and typeref token (EnumBuilder in another assembly)
Aleksey Kliger [Wed, 26 Jul 2017 15:39:36 +0000 (11:39 -0400)]
[sre] Add MonoDynamicImageTokCollision arg to mono_dynamic_image_register_token
The new argument controls what should happen when the given token is already
present.
In some situations it's expected that we either see the same object, or we
unconditionally want to replace it (for example if we previously registered a
TypeBuilder or a MethodBuilder, after the type or method is created, we will
re-register the RuntimeType or MonoMethod in its place). In other cases (for
example when a module references a MonoMethod from a different assembly), we
may still call `mono_image_create_token()` multiple times but we expect to see
the same MonoMethod object.
Aleksey Kliger [Wed, 26 Jul 2017 23:37:20 +0000 (19:37 -0400)]
[sre] Handle typeref tokens in fixup_method (Fixes #58421)
This may occur if there are two AssemblyBuilders in progress and one of them
refers to a TypeBuilder from the other.
https://bugzilla.xamarin.com/show_bug.cgi?id=58421
Aleksey Kliger [Wed, 26 Jul 2017 23:36:05 +0000 (19:36 -0400)]
[test] Check that one AssemblyBuilder can refer to a TypeBuilder from another.
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=58421
Zoltan Varga [Wed, 26 Jul 2017 02:10:56 +0000 (22:10 -0400)]
[interp] Make the 'td' variable a pointer in generate () for consistency with the rest of the code.
Zoltan Varga [Wed, 26 Jul 2017 01:46:44 +0000 (21:46 -0400)]
[interp] Rename some types to better reflect their function.
MonoInvocation -> InterpFrame
RuntimeMethod -> InterpMethod
runtime_method -> imethod
Marek Safar [Thu, 27 Jul 2017 08:38:15 +0000 (10:38 +0200)]
[mcs] Another workaround for enum builder SRE crash (this time on Mono)
Marek Safar [Thu, 27 Jul 2017 07:07:09 +0000 (09:07 +0200)]
Updates codeowners
Zoltan Varga [Thu, 27 Jul 2017 01:35:38 +0000 (21:35 -0400)]
[runtime] Move object.c to 'common_sources', as it no longer has compile time gc dependencies.
Zoltan Varga [Thu, 27 Jul 2017 01:33:12 +0000 (21:33 -0400)]
Sre not gc dependent (#5264)
* [runtime] Move the sre source files to 'common_sources', they no longer have compile time gc dependencies after the Boehm GC root changes. sre.c still depends on the gc dependent caching code in reflection-cache.h.
* [runtime] Remove compile time gc dependencies from the reflection caching code.
* [runtime] Move reflection.c/sre.c to 'common_sources', they no longer have compile time gc dependencies.
Marek Safar [Wed, 26 Jul 2017 21:59:44 +0000 (23:59 +0200)]
[corlib] Update Assembly class xml descriptor
monojenkins [Wed, 26 Jul 2017 15:39:55 +0000 (15:39 +0000)]
[msvc] Update csproj files
Zoltan Varga [Wed, 26 Jul 2017 14:16:03 +0000 (10:16 -0400)]
[sre] Add some tests for saving assemblies. (#5265)
Marek Safar [Wed, 26 Jul 2017 11:27:13 +0000 (13:27 +0200)]
[Mono.CSharp] Updates csproj
Marek Safar [Wed, 26 Jul 2017 11:25:44 +0000 (13:25 +0200)]
[mcs] Adds workaround for repl enum declaration on .net SRE
Marek Safar [Tue, 25 Jul 2017 14:32:13 +0000 (16:32 +0200)]
[corlib] ModuleBuilder pseudo-token lookup needs to use references insteads of logical equality comparer.
Fixes #58291
Alex Rønne Petersen [Wed, 26 Jul 2017 11:03:52 +0000 (13:03 +0200)]
[acceptance-tests] Another attempt fix a StringBuilder race in the profiler stress runner.
Zoltan Varga [Wed, 26 Jul 2017 03:07:49 +0000 (23:07 -0400)]
[runtime] Remove compile time gc dependencies from object.c. (#5266)
Zoltan Varga [Wed, 26 Jul 2017 00:31:42 +0000 (20:31 -0400)]
[runtime] Remove compile-time gc dependencies from domain.c/appdomain.c. (#5263)
* [runtime] Remove compile-time gc dependencies from domain.c/appdomain.c.
* [runtime] Move domain.c/appdomain.c to 'common_sources' since they no longer have compile time gc dependencies.
Marek Safar [Tue, 25 Jul 2017 21:46:27 +0000 (23:46 +0200)]
Merge branch 'vladimir-kazakov-xml-dsig-transforms-from-corefx'
Marek Safar [Tue, 25 Jul 2017 21:46:04 +0000 (23:46 +0200)]
Merge branch 'xml-dsig-transforms-from-corefx' of git://github.com/vladimir-kazakov/mono into vladimir-kazakov-xml-dsig-transforms-from-corefx
monojenkins [Tue, 25 Jul 2017 15:58:32 +0000 (15:58 +0000)]
[msvc] Update csproj files
Alex Rønne Petersen [Tue, 25 Jul 2017 14:16:11 +0000 (16:16 +0200)]
Marek Safar [Tue, 25 Jul 2017 10:12:15 +0000 (12:12 +0200)]
Bump roslyn (to include more files)
monojenkins [Tue, 25 Jul 2017 07:59:43 +0000 (07:59 +0000)]
Bump API snapshot submodule
Marek Safar [Mon, 24 Jul 2017 18:28:39 +0000 (20:28 +0200)]
Bump CoreFX
Vlad Brezae [Mon, 24 Jul 2017 20:42:45 +0000 (23:42 +0300)]
[runtime] Remove handler block trampoline code
Vlad Brezae [Mon, 24 Jul 2017 18:08:52 +0000 (21:08 +0300)]
[runtime] Fix handler block
Instead of hijacking the return address when suspending a thread in a finally block for an abort, do an explicit check in managed code when we are returning from the handler in order to see if we need to abort. Hijacking the return address is arch specific and it doesn't work if we are suspended before it is initialized in handler start.
Fixes #5798
Alexis Christoforides [Tue, 25 Jul 2017 05:25:54 +0000 (01:25 -0400)]
Update bockbuild. Fixes #57002
Zoltan Varga [Tue, 25 Jul 2017 03:20:43 +0000 (23:20 -0400)]
[runtime] Fix the size calculation for CustomAttributeType coded indexes, they can only point to the MethodDef/MemberRef tables even through 3 bits are used to encode them, only 2 values are used. Fixes #58210. (#5256)
Zoltan Varga [Mon, 24 Jul 2017 22:28:52 +0000 (18:28 -0400)]
[jit] Handle OP_VCALL_MEMBASE in get_simd_vreg (). Fixes #58344.
Zoltan Varga [Mon, 24 Jul 2017 21:35:08 +0000 (17:35 -0400)]
Bump bockbuild.
Marek Safar [Mon, 24 Jul 2017 14:24:43 +0000 (16:24 +0200)]
Bump roslyn to 2.3.1
Vladimir Kazakov [Sun, 2 Jul 2017 10:31:33 +0000 (13:31 +0300)]
XMLDSIG transforms from .NET Core.
Zoltan Varga [Mon, 24 Jul 2017 15:31:34 +0000 (11:31 -0400)]
Bump bockbuild.
Alex Rønne Petersen [Sun, 23 Jul 2017 05:24:55 +0000 (07:24 +0200)]
Update CODEOWNERS
Alex Rønne Petersen [Sun, 23 Jul 2017 04:06:28 +0000 (06:06 +0200)]
Merge pull request #5252 from alexrp/profiler-stress-fixes
[acceptance-tests] A few fixes for the profiler stress test suite.
Alex Rønne Petersen [Sat, 22 Jul 2017 18:26:16 +0000 (20:26 +0200)]
Merge pull request #5253 from alexrp/profiler-lib
[Mono.Profiler.Log] Catch SecurityException for missing icalls.
Alex Rønne Petersen [Sat, 22 Jul 2017 15:15:11 +0000 (17:15 +0200)]
[Mono.Profiler.Log] Catch SecurityException for missing icalls.
This is the exception that is thrown on .NET because icalls are not allowed in
non-GAC assemblies.
Alex Rønne Petersen [Sat, 22 Jul 2017 13:58:54 +0000 (15:58 +0200)]
[acceptance-tests] Disable the ironjs-v8 test on arm32/arm64.
It times out even with a 24-hour timeout. Eventually we should investigate why,
but disable it for now so the lane can become green.
Alex Rønne Petersen [Sat, 22 Jul 2017 12:42:06 +0000 (14:42 +0200)]
[acceptance-tests] Fix a crash in the profiler stress runner caused by racey modification of a StringBuilder.
Alex Rønne Petersen [Sat, 22 Jul 2017 12:35:33 +0000 (14:35 +0200)]
[acceptance-tests] Set individual timeout for profiler stress tests back to 8 hours.
Alex Rønne Petersen [Sat, 22 Jul 2017 12:33:35 +0000 (14:33 +0200)]
[acceptance-tests] Build profiler stress runner with debug info.
Zoltan Varga [Sat, 22 Jul 2017 00:02:43 +0000 (20:02 -0400)]
[bockbuild] Avoid overwriting self.local_configure_flags in some packages, extend them instead. (#5239)
Alex Rønne Petersen [Fri, 21 Jul 2017 18:09:54 +0000 (20:09 +0200)]
Merge pull request #5248 from alexrp/profiler-api
[profiler] Add back some legacy profiler API functions.
Armin Hasitzka [Fri, 21 Jul 2017 09:39:04 +0000 (11:39 +0200)]
[mempool] Annotate functions for clang's ThreadSanitizer (#5191)
* [mempool] Annotate functions for ThreadSanitizer
Whitelist `mono_mempool_alloc`, `mono_mempool_new_size` and `mono_mempool_destroy` according to https://bugzilla.xamarin.com/show_bug.cgi?id=57936
* [fixup!] Test the NO_SANITIZE_THREAD macro
* [fixup!] Merge comments / documentation
Alex Rønne Petersen [Fri, 21 Jul 2017 09:12:58 +0000 (11:12 +0200)]
[acceptance-tests] Temporarily increase the profiler stress timeout to 24 hours.
This is temporary and is just to see how long ironjs-v8 actually takes to complete on ARM. We may need to just exclude it there.
monojenkins [Fri, 21 Jul 2017 08:50:26 +0000 (08:50 +0000)]
Bump API snapshot submodule
pjt33 [Thu, 20 Jul 2017 11:02:16 +0000 (13:02 +0200)]
Implement ServiceEndpoint.EndpointBehaviors
This follows the reference source in understanding `EndpointBehaviors` to be an alias of `Behaviors` with a more general type.
Note that although an alias might not seem necessary to implement, when using netstandard1.3 the [`System.ServiceModel.Primitives`](https://www.nuget.org/packages/System.ServiceModel.Primitives) package exposes `EndpointBehaviors` but not `Behaviors`.
Alex Rønne Petersen [Fri, 21 Jul 2017 07:53:46 +0000 (09:53 +0200)]
[msvc] Update project files with new profiler-related source files.
Miguel de Icaza [Fri, 21 Jul 2017 02:47:48 +0000 (22:47 -0400)]
[Marshal.IsComObject] Make this predicate return false instead of throwing an exception which is what the calling code expects (#5246)
Ludovic Henry [Thu, 20 Jul 2017 20:08:26 +0000 (16:08 -0400)]
Reenable MonoTests.Remoting.IpcChannelTest.Bug609381 (#5245)
Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=36634
Alex Rønne Petersen [Thu, 20 Jul 2017 19:13:15 +0000 (21:13 +0200)]
[msvc] Update def files.
Alex Rønne Petersen [Thu, 20 Jul 2017 18:44:25 +0000 (20:44 +0200)]
[profiler] Add back some legacy profiler API functions.
These are used by XA/XI/XM and because XM in particular needs to work with
both old and new versions of system Mono, we need to make sure these functions
still exist.
Alex Rønne Petersen [Thu, 20 Jul 2017 18:07:47 +0000 (20:07 +0200)]
[profiler] Rename mono_profiler_install to mono_profiler_create.
Vlad Brezae [Mon, 17 Jul 2017 18:02:38 +0000 (21:02 +0300)]
[runtime] Fix abort ignore when suspended in first instruction from finally block
Vlad Brezae [Thu, 20 Jul 2017 17:30:49 +0000 (20:30 +0300)]
Merge pull request #5198 from BrzVlad/fix-binprot-stats
[sgen] Parallel gc improvements
Bernhard Urban [Thu, 20 Jul 2017 17:24:11 +0000 (19:24 +0200)]
[jit] test builtin types (#5208)
* [builtin-types] import test suite
List of original contributors:
Zoltan Varga <vargaz@gmail.com>
Rodrigo Kumpera <kumpera@gmail.com>
* [builtin-types] import updated definitions from xamarin-macios
https://github.com/xamarin/xamarin-macios/blob/
8fbbfa5ca7154fcfd553f7a7b242ffee9a95f240/src/NativeTypes/Primitives.tt
* [builtin-types] make regression suite work
* [builtin-types] disable broken tests
* [fixup] disable failing tests on arm64
Bernhard Urban [Tue, 18 Jul 2017 17:11:48 +0000 (19:11 +0200)]
[interp] reuse finally_ips infrastructue for fault clauses
Mikayla Hutchinson [Wed, 19 Jul 2017 00:02:12 +0000 (20:02 -0400)]
Tweak the Unreal profile
Alex Rønne Petersen [Thu, 20 Jul 2017 13:34:06 +0000 (15:34 +0200)]
Merge pull request #5243 from alexrp/profiler-stress-fixes
[acceptance-tests] Don't mark msbiology as a failure if it OOMs on 32-bit.
Vlad Brezae [Tue, 4 Jul 2017 15:59:05 +0000 (18:59 +0300)]
[sgen] Fix function signature
Vlad Brezae [Sat, 24 Jun 2017 20:40:48 +0000 (23:40 +0300)]
[sgen] Compact allocated block list
It helps with its repeated traversal and improves work distribution when using parallel modes.
Vlad Brezae [Fri, 23 Jun 2017 20:09:05 +0000 (23:09 +0300)]
[sgen] Improve card table parallelization
Improve caching by scanning consecutive blocks and avoiding full block list travesal.
Vlad Brezae [Mon, 3 Jul 2017 21:14:15 +0000 (00:14 +0300)]
[sgen] Run a single worker cycle in major parallel finish case
This was not the case when we were doing a forced concurrent finish.
Vlad Brezae [Fri, 30 Jun 2017 22:53:36 +0000 (01:53 +0300)]
[sgen] Avoid logging unnecessary binary protocol events
Vlad Brezae [Fri, 30 Jun 2017 22:47:46 +0000 (01:47 +0300)]
[sgen] Add explicit binary protocol stats for collections
Using the cardtable scan and finish_gray_stack start and end events is cumbersome to parse and require a lot of logging, especially in the case of the parallel collector.
Vlad Brezae [Fri, 30 Jun 2017 21:01:52 +0000 (00:01 +0300)]
[sgen] Include mod union times to stats
Vlad Brezae [Wed, 28 Jun 2017 10:12:59 +0000 (13:12 +0300)]
[sgen] Use parallel minors for pause mode
It should makes pauses less influenced by workload spikes
Vlad Brezae [Tue, 27 Jun 2017 22:41:22 +0000 (01:41 +0300)]
[sgen] Avoid waiting for workers to report their own finish
If a worker is stuck doing work in another context, it might not be very responsive in transitioning its own state from WORK_ENQUEUED to WORKING and finally to FINISHING. When joining worker threads, we check whether we have any threads working in the corresponding context and, if there aren't any, change their state directly from the gc thread.
We can do this because work is distributed from centralized pools (worker_distribute_gray_queue and the job_queue), instead of per worker. Therefore we don't need all the workers to perform actual work in the context.
Marek Safar [Thu, 20 Jul 2017 09:42:01 +0000 (11:42 +0200)]
Update CODEOWNERS
Alex Rønne Petersen [Thu, 20 Jul 2017 00:23:17 +0000 (02:23 +0200)]
[acceptance-tests] Don't mark msbiology as a failure if it OOMs on 32-bit.
This is known to happen on some platforms.
Ludovic Henry [Wed, 19 Jul 2017 21:50:07 +0000 (17:50 -0400)]
[threads] Add checks around libc calls (#5240)
Ludovic Henry [Wed, 19 Jul 2017 21:49:20 +0000 (17:49 -0400)]
[threads] Make mono_thread_detach_internal static (#5241)
Alex Rønne Petersen [Wed, 19 Jul 2017 19:32:21 +0000 (21:32 +0200)]
[acceptance-tests] Further increase the individual test timeout in the profiler stress runner.
It seems ironjs-v8 takes even longer to run on ARM than fsharp, msbiology, and roslyn.
Zoltan Varga [Wed, 19 Jul 2017 19:03:58 +0000 (15:03 -0400)]
[bcl] Fix the parallel build in the tools dir. (#5236)
Bernhard Urban [Wed, 19 Jul 2017 13:33:00 +0000 (15:33 +0200)]
[offset-tool] fix assignment for GeniOS
fixes this compilation error
MonoAotOffsetsDumper.cs(279,59): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
Zoltan Varga [Wed, 19 Jul 2017 04:21:32 +0000 (00:21 -0400)]
[btls] Remove create-object-library.sh script which is no longer used. (#5232)
Alexander Köplinger [Tue, 18 Jul 2017 23:13:40 +0000 (01:13 +0200)]
Fix build of "unreal" profile
Alex Rønne Petersen [Tue, 18 Jul 2017 22:39:40 +0000 (00:39 +0200)]
Merge pull request #5224 from alexrp/profiler-multiple-args
[profiler] Better support for multiple profilers.