mono.git
8 years agoMerge pull request #2860 from lewurm/fix-cfgdump-related-stuff
monojenkins [Fri, 8 Apr 2016 22:45:18 +0000 (23:45 +0100)]
Merge pull request #2860 from lewurm/fix-cfgdump-related-stuff

Fix `cfgdump` related stuff

8 years ago[jit] include cfgdump.h in common_sources
Bernhard Urban [Fri, 8 Apr 2016 19:03:30 +0000 (12:03 -0700)]
[jit] include cfgdump.h in common_sources

8 years ago[cfg-dump] fix warning
Bernhard Urban [Fri, 8 Apr 2016 18:59:51 +0000 (11:59 -0700)]
[cfg-dump] fix warning

8 years agoMerge pull request #2856 from alexrp/profiler-fix-sem
monojenkins [Fri, 8 Apr 2016 17:55:19 +0000 (18:55 +0100)]
Merge pull request #2856 from alexrp/profiler-fix-sem

[profiler] Fix incorrect initial writer semaphore value.

This was used during debugging. I forgot to revert it back to 0 before posting
the pull request (#2838). This led to ~3-5% more CPU usage by the writer thread
than actually necessary; it now sits around 0-1% for typical workloads.

8 years ago[corlib]: Add internal callback to 'X509Helper' to use System's X509Helper2.
Martin Baulig [Fri, 8 Apr 2016 12:18:46 +0000 (14:18 +0200)]
[corlib]: Add internal callback to 'X509Helper' to use System's X509Helper2.

(cherry picked from commit 5eaf4db0918f4e59c47b22e6379236a55f6c813e)

8 years ago[Mono.Security]: Cleanup 'CertificateValidationHelper'.
Martin Baulig [Fri, 8 Apr 2016 13:41:13 +0000 (15:41 +0200)]
[Mono.Security]: Cleanup 'CertificateValidationHelper'.

The overloaded GetValidator() which takes both 'MonoTlsSettings'
and 'MonoTlsProvider' is actually used by the test suite, so let's
keep it public.

(cherry picked from commit 0977d531d2579c9051a6a2e6d0cb47e4f720bea4)

8 years agoMerge pull request #2857 from malaterre/master
monojenkins [Fri, 8 Apr 2016 16:40:17 +0000 (17:40 +0100)]
Merge pull request #2857 from malaterre/master

Remove an undefined behavior

Found using gcc -fsanitize=bounds

8 years ago[ci] Don't use babysitter on Windows/cygwin
Alexander Köplinger [Fri, 8 Apr 2016 15:22:23 +0000 (17:22 +0200)]
[ci] Don't use babysitter on Windows/cygwin

babysitter generates some temp paths in python when running under cygwin, which breaks down
when those paths are passed to the native Windows mono.exe during testing:

    Exception in TestRunnerThread ---> System.IO.DirectoryNotFoundException: Could not find a part of the path "C:\cygdrive\c\WINDOWS\TEMP\tmpC4K5yK\babysitter_report_current_test_file.txt".

8 years ago[System]: Use MonoTlsProviderFactory.GetDefaultProviderInternal() to cache the result.
Martin Baulig [Fri, 8 Apr 2016 12:57:26 +0000 (14:57 +0200)]
[System]: Use MonoTlsProviderFactory.GetDefaultProviderInternal() to cache the result.

(cherry picked from commit 6d41d1562f6cec0da94229fb33e0c42ae2bf22e9)

8 years agoRemove an undefined behavior
Mathieu Malaterre [Fri, 8 Apr 2016 10:49:17 +0000 (12:49 +0200)]
Remove an undefined behavior

Found using gcc -fsanitize=bounds

8 years agoMerge pull request #2855 from malaterre/master
Alex Rønne Petersen [Fri, 8 Apr 2016 10:44:17 +0000 (12:44 +0200)]
Merge pull request #2855 from malaterre/master

Remove a simple memory leak

8 years ago[profiler] Fix incorrect initial writer semaphore value.
Alex Rønne Petersen [Fri, 8 Apr 2016 10:36:20 +0000 (12:36 +0200)]
[profiler] Fix incorrect initial writer semaphore value.

This was used during debugging. I forgot to revert it back to 0 before posting
the pull request (#2838). This led to ~3-5% more CPU usage by the writer thread
than actually necessary; it now sits around 0-1% for typical workloads.

8 years agoRemove a simple memory leak
Mathieu Malaterre [Fri, 8 Apr 2016 06:50:19 +0000 (08:50 +0200)]
Remove a simple memory leak

8 years agoMerge pull request #2852 from alexrp/master
monojenkins [Fri, 8 Apr 2016 04:20:40 +0000 (05:20 +0100)]
Merge pull request #2852 from alexrp/master

[profiler] Fix usage of the lock-free queue API.

* Free nodes hazardously.
* No need to unpoison nodes since we're not reusing them.
* Fix memory leak when emptying coverage queues.

8 years ago[profiler] Fix a warning.
Alex Rønne Petersen [Fri, 8 Apr 2016 00:49:22 +0000 (02:49 +0200)]
[profiler] Fix a warning.

8 years ago[profiler] Fix usage of the lock-free queue API.
Alex Rønne Petersen [Thu, 7 Apr 2016 23:18:09 +0000 (01:18 +0200)]
[profiler] Fix usage of the lock-free queue API.

* Free nodes hazardously.
* No need to unpoison nodes since we're not reusing them.
* Fix memory leak when emptying coverage queues.

8 years agoMerge pull request #2850 from madewokherd/inetpton
Alexander Köplinger [Fri, 8 Apr 2016 00:18:00 +0000 (02:18 +0200)]
Merge pull request #2850 from madewokherd/inetpton

[configure] Also check that inet_pton is defined when building for Windows.

8 years ago[utils/hp] Export mono_thread_hazardous_try_free () for use in the profiler.
Alex Rønne Petersen [Thu, 7 Apr 2016 23:17:46 +0000 (01:17 +0200)]
[utils/hp] Export mono_thread_hazardous_try_free () for use in the profiler.

8 years ago[ci] Remove quotes from windows msbuild command
Alexander Köplinger [Thu, 7 Apr 2016 23:17:41 +0000 (01:17 +0200)]
[ci] Remove quotes from windows msbuild command

Turns out it wasn't the right fix.

8 years ago[ci] Don't enable the mobile profiles on the community archs
Alexander Köplinger [Thu, 7 Apr 2016 22:52:33 +0000 (00:52 +0200)]
[ci] Don't enable the mobile profiles on the community archs

It only takes time and e.g. causes issues if e.g. AOT doesn't work.

8 years agoMerge pull request #2788 from lambdageek/dev/monoerror-reflection-no-more-raise
monojenkins [Thu, 7 Apr 2016 21:15:36 +0000 (22:15 +0100)]
Merge pull request #2788 from lambdageek/dev/monoerror-reflection-no-more-raise

[reflection] No more mono_*_raise_*

No more `mono_error_raise_exception` and `mono_raise_exception` in `reflection.c`

8 years agoMerge pull request #2769 from lewurm/jit-cfg-dump
monojenkins [Thu, 7 Apr 2016 20:26:04 +0000 (21:26 +0100)]
Merge pull request #2769 from lewurm/jit-cfg-dump

[jit] mini IR dumping feature for IGV

related doc PR: https://github.com/mono/website/pull/189

8 years ago[Mono.Security]: Add new internal 'MonoTlsProvider' APIs.
Martin Baulig [Thu, 7 Apr 2016 19:07:22 +0000 (21:07 +0200)]
[Mono.Security]: Add new internal 'MonoTlsProvider' APIs.

(cherry picked from commit c02a885bd62631c4ff5cde5443f1b1e0cdccc237)

8 years ago[BoringTls]: Register via 'MonoTlsProviderFactory'.
Martin Baulig [Thu, 7 Apr 2016 16:41:53 +0000 (18:41 +0200)]
[BoringTls]: Register via 'MonoTlsProviderFactory'.

(cherry picked from commit e43a5f73320fbde80c36ed294ea1ba7b06cf58bb)

8 years agoMerge pull request #2824 from lambdageek/dev/monoerror-icalls-noraise
monojenkins [Thu, 7 Apr 2016 19:06:02 +0000 (20:06 +0100)]
Merge pull request #2824 from lambdageek/dev/monoerror-icalls-noraise

[runtime] Set pending exception in icalls instead of raising.

8 years ago[configure] Also check that inet_pton is defined when building for Windows.
Vincent Povirk [Thu, 7 Apr 2016 18:18:47 +0000 (13:18 -0500)]
[configure] Also check that inet_pton is defined when building for Windows.

The version of mingw-w64 on Debian wheezy has this symbol in its libraries
but not its headers.

8 years agoMerge pull request #2848 from alexrp/master
monojenkins [Thu, 7 Apr 2016 17:35:18 +0000 (18:35 +0100)]
Merge pull request #2848 from alexrp/master

[libgc] Fix broken AC_TRY_COMPILE() invocation in configure.ac.

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

Tested on PowerPC by `Mathieu Malaterre <malat@debian.org>`.

8 years ago[SRE] Remove uses of mono_error_raise_exception
Aleksey Kliger [Tue, 22 Mar 2016 22:06:15 +0000 (18:06 -0400)]
[SRE] Remove uses of mono_error_raise_exception

1. icall `mono_image_module_basic_init`
2. icall `mono_reflection_sighelper_get_signature_local`
3. icall `mono_reflection_sighelper_get_signature_field`
4. API function mono_module_get_object
5. API function mono_type_get_object
6. API function mono_method_get_object
7. API function mono_field_get_object
8. API function mono_property_get_object
9. API function mono_event_get_object

8 years ago[reflection] Remove last uses of mono_raise_exception
Aleksey Kliger [Tue, 22 Mar 2016 20:51:48 +0000 (16:51 -0400)]
[reflection] Remove last uses of mono_raise_exception

1. static function `create_custom_attr` (set MonoError exception instance)
2. icall `mono_reflection_resolve_custom_attribute_data` (set pending
exception from MonoError). Also rename it to
ves_icall_System_Reflection_CustomAttributeData_ResolveArgumentsInternal
3. icall `mono_reflection_bind_generic_method_parameters` (set pending
exception from MonoError)  Not renaming this one because it's actually
used for two icalls:
System.Reflection.Emit.MethodBuilder.MakeGenericMethod and System.Reflection.MonoMethod.MakeGenericMethod_impl

8 years ago[SRE] MonoError-ize reflection_methodbuilder_to_mono_method
Aleksey Kliger [Tue, 15 Mar 2016 22:29:38 +0000 (15:29 -0700)]
[SRE] MonoError-ize reflection_methodbuilder_to_mono_method

8 years ago[SRE] MonoError-ize mono_reflection_create_generic_class
Aleksey Kliger [Tue, 15 Mar 2016 18:14:29 +0000 (11:14 -0700)]
[SRE] MonoError-ize mono_reflection_create_generic_class

Change icall name to
ves_icall_System_Reflection_Emit_TypeBuilder_create_generic_class

Give mono_reflection_create_generic_class a MonoError argument,
and get rid of the redundant mono_reflection_create_generic_class_checked

8 years ago[ci] Fall back to timeout command if babysitter doesn't work
Alexander Köplinger [Thu, 7 Apr 2016 14:57:54 +0000 (16:57 +0200)]
[ci] Fall back to timeout command if babysitter doesn't work

Some Jenkins workers (e.g. the s390x one) have an earlier python version installed where the babysitter doesn't work.
Fall back to timeout in those cases.

8 years ago[BoringTls]: Merge the work branch.
Martin Baulig [Thu, 7 Apr 2016 13:55:27 +0000 (15:55 +0200)]
[BoringTls]: Merge the work branch.

* Mono.Security.Interface.ICertificateValidator2:
  new internal interface, deriving from ICertificateValidator.

* Mono.Security.Interface.CertificateValidationHelper:
  the internal GetValidator() now returns ICertificateValidator2.

* Mono.Security.Interface.MonoTlsProvider:
  make HasCustomSystemCertificateValidator and InvokeSystemCertificateValidator()
  internal and use ICertificateValidator2.

* Mono.Net.Security.ChainValidator:
  implement ICertificateValidator2; we may now be called with a
  fully-built X509Chain.

* corlib, System, Mono.Security:
  add [assembly: InternalsVisibleTo].

8 years ago[ci] Escape run-step.sh invocations, for paths with spaces in
Jo Shields [Thu, 7 Apr 2016 14:28:59 +0000 (15:28 +0100)]
[ci] Escape run-step.sh invocations, for paths with spaces in

8 years agoMerge pull request #2847 from vargaz/get-type-reflection
monojenkins [Thu, 7 Apr 2016 07:20:22 +0000 (08:20 +0100)]
Merge pull request #2847 from vargaz/get-type-reflection

[runtime] Fix type_from_parsed_name () to work in the presence of inl…

…ining done by LLVM.

8 years agoMerge pull request #2809 from lambdageek/dev/monoerror-threads
monojenkins [Thu, 7 Apr 2016 06:45:21 +0000 (07:45 +0100)]
Merge pull request #2809 from lambdageek/dev/monoerror-threads

[runtime] Don't call mono_raise_exception in thread utilities

8 years ago[libgc] Fix broken AC_TRY_COMPILE() invocation in configure.ac.
Alex Rønne Petersen [Thu, 7 Apr 2016 06:37:30 +0000 (08:37 +0200)]
[libgc] Fix broken AC_TRY_COMPILE() invocation in configure.ac.

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

Tested on PowerPC by Mathieu Malaterre <malat@debian.org>.

8 years agoMerge pull request #2838 from alexrp/profiler-writer-thread-cpu2
monojenkins [Thu, 7 Apr 2016 04:00:33 +0000 (05:00 +0100)]
Merge pull request #2838 from alexrp/profiler-writer-thread-cpu2

[profiler] Use a semaphore to signal the writer thread.

We would previously constantly try to dequeue from the writer queue which would
result in extremely high CPU usage, making many apps (e.g. Xamarin Studio)
nearly unusable.

8 years ago[arm64] Enable Unwind_Backtrace () support on arm64.
Zoltan Varga [Thu, 7 Apr 2016 02:41:10 +0000 (22:41 -0400)]
[arm64] Enable Unwind_Backtrace () support on arm64.

8 years ago[runtime] Fix type_from_parsed_name () to work in the presence of inlining done by...
Zoltan Varga [Wed, 6 Apr 2016 23:14:49 +0000 (19:14 -0400)]
[runtime] Fix type_from_parsed_name () to work in the presence of inlining done by LLVM.

8 years agoMerge pull request #2841 from lambdageek/dev/bug-40060
monojenkins [Thu, 7 Apr 2016 00:34:46 +0000 (01:34 +0100)]
Merge pull request #2841 from lambdageek/dev/bug-40060

[corlib] Type.GetType parser and resolver improvements

We have two type parsers the one invoked by `Type.GetType(string)` (and some others) which is implemented in C in `reflection.c`, and the one invoked by `Type.GetType(string, Func<...>, Func<...>)` implemented in managed code as `System.TypeSpec`.

In both cases `string→Type` conversion goes in two stages: parsing and resolution.  Parsing just changes the string into an AST.  And resolution crawls the AST and constructs the appropriate types.

This fixes [Bugzilla #40060](https://bugzilla.xamarin.com/show_bug.cgi?id=40060)

1. Fix the resolver on the native side for types like `"System.Generic.Collections.Dictionary[System.Int32,MyType]"` where the generic type is from corlib and a type argument is from the current assembly.
2. Fix `get_caller_no_reflection` to work correctly when the call stack has a System.Reflection method as the immediate caller of the icall.
3. Fix the resolver on the native side to work when it's called from corlib's System namespace, not just System.Reflection.
4. Fix the managed parser to work with types like `"MyGeneric[MyType]"` where the generic argument is not an assembly qualified name or there's a mixture of aqn and non-aqn type arguments.  Also rationalize how the code handles assembly qualification in general.
5. Test cases

8 years agoMerge pull request #2844 from radical/assign-proj-config
Ankit Jain [Thu, 7 Apr 2016 00:29:06 +0000 (20:29 -0400)]
Merge pull request #2844 from radical/assign-proj-config

[xbuild] Fix bug #40094 - AssignProjectConfiguration should fallback to project path if ..

8 years ago[profiler] Use a semaphore to signal the writer thread.
Alex Rønne Petersen [Tue, 5 Apr 2016 08:35:43 +0000 (10:35 +0200)]
[profiler] Use a semaphore to signal the writer thread.

We would previously constantly try to dequeue from the writer queue which would
result in extremely high CPU usage, making many apps (e.g. Xamarin Studio)
nearly unusable.

8 years agoMerge pull request #2839 from alexrp/profiler-thread-detach
Alex Rønne Petersen [Wed, 6 Apr 2016 23:12:10 +0000 (01:12 +0200)]
Merge pull request #2839 from alexrp/profiler-thread-detach

[profiler] Detach helper/writer threads before shutting them down.

8 years ago[threads] Add MonoError arg to init_root_domain_thread
Aleksey Kliger [Tue, 29 Mar 2016 19:27:05 +0000 (15:27 -0400)]
[threads] Add MonoError arg to init_root_domain_thread

8 years ago[threads] MonoError-ize mono_thread_set_name_internal
Aleksey Kliger [Tue, 29 Mar 2016 19:14:30 +0000 (15:14 -0400)]
[threads] MonoError-ize mono_thread_set_name_internal

8 years agoReplace android-libunwind submodule with a local copy
Alexander Köplinger [Wed, 6 Apr 2016 21:31:06 +0000 (23:31 +0200)]
Replace android-libunwind submodule with a local copy

We can't keep it as a real git submodule since the repo contains an "aux" folder that breaks on Windows.

8 years ago[MonoError] Add mono_error_set_invalid_operation utility function
Aleksey Kliger [Tue, 29 Mar 2016 19:13:54 +0000 (15:13 -0400)]
[MonoError] Add mono_error_set_invalid_operation utility function

to construct System.InvalidOperationException

8 years ago[threads] Add MonoError arg to create_thread
Aleksey Kliger [Tue, 29 Mar 2016 18:34:54 +0000 (14:34 -0400)]
[threads] Add MonoError arg to create_thread

instead of throw_on_failure flag, pass a MonoError outarg and let the
caller decide what to do with it.

8 years ago[runtime] Don't call mono_raise_exception in ves_icall_Mono_Runtime_GetNativeStackTrace
Aleksey Kliger [Tue, 29 Mar 2016 21:09:05 +0000 (17:09 -0400)]
[runtime] Don't call mono_raise_exception in ves_icall_Mono_Runtime_GetNativeStackTrace

8 years ago[profiler] Detach helper/writer threads before shutting them down.
Alex Rønne Petersen [Wed, 6 Apr 2016 05:17:05 +0000 (07:17 +0200)]
[profiler] Detach helper/writer threads before shutting them down.

8 years ago[threads] Export mono_thread_info_detach () for use in the profiler.
Alex Rønne Petersen [Wed, 6 Apr 2016 05:16:49 +0000 (07:16 +0200)]
[threads] Export mono_thread_info_detach () for use in the profiler.

8 years ago[ci] Put windows msbuild command in quotes
Alexander Köplinger [Wed, 6 Apr 2016 20:34:52 +0000 (22:34 +0200)]
[ci] Put windows msbuild command in quotes

8 years agoMerge pull request #2837 from alexrp/master
Rodrigo Kumpera [Wed, 6 Apr 2016 20:28:34 +0000 (16:28 -0400)]
Merge pull request #2837 from alexrp/master

Bunch of improvements surrounding thread names and reporting of such to the profiler

8 years ago[xbuild] Fix #40094, part 2/2: AssignProjectConfiguration - Fallback to
Ankit Jain [Wed, 6 Apr 2016 18:16:33 +0000 (14:16 -0400)]
[xbuild] Fix #40094, part 2/2: AssignProjectConfiguration - Fallback to

.. project path for lookup, if lookup by guid fails.

Fixes bxc #40094 .

8 years ago[xbuild] Fix #40094, part 1/2: SolutionParser: Emit `AbsolutePath="..."`
Ankit Jain [Wed, 6 Apr 2016 18:11:17 +0000 (14:11 -0400)]
[xbuild] Fix #40094, part 1/2: SolutionParser: Emit `AbsolutePath="..."`

.. attribute for CurrentSolutionConfigurationContents .

   <CurrentSolutionConfigurationContents>
         <SolutionConfiguration xmlns="">
   <ProjectConfiguration Project="{82323650-6C2A-4FAC-91C6-A715C2FE9CB2}" AbsolutePath="/Users/ankit/test/msbuild/bug40094/App1/App1\App1\App1.csproj">
   Release|AnyCPU
   </ProjectConfiguration>
   ...

Related to fix for bxc #40094

8 years ago[corlib] TypeSpec.Parse for non-assembly qualified names.
Aleksey Kliger [Tue, 5 Apr 2016 22:18:37 +0000 (18:18 -0400)]
[corlib] TypeSpec.Parse for non-assembly qualified names.

Previously for types like "Foo[P,Q]" the recursive call of the parser
would incorrectly consume the delimiter after a type argument (ie the
',' or ']') which would leave the caller potentially past the end of the
string which would signal a failed parse.  New behavior is to peek at
the delimiter but leave it up to the caller to consume.

Also `Type.GetType(name, null, null)` should behave like
`Type.GetType(name)` (previously it dropped generic type arguments).

8 years ago[runtime] type_from_parsed_name can be called from System or System.Reflection
Aleksey Kliger [Tue, 5 Apr 2016 19:30:22 +0000 (15:30 -0400)]
[runtime] type_from_parsed_name can be called from System or System.Reflection

type_from_parsed_name is a helper for
ves_icall_System_Type_internal_from_name which is called directly from
System.Type as well as indirectly by System.TypeNameParse.  We should
skip over all those classes to find the managed caller.

This fixes the remainder of [40060](https://bugzilla.xamarin.com/show_bug.cgi?id=40060)

8 years ago[runtime] Fix bug in get_caller_no_reflection
Aleksey Kliger [Tue, 5 Apr 2016 19:24:23 +0000 (15:24 -0400)]
[runtime] Fix bug in get_caller_no_reflection

In order to find the user code that called some corlib API
that calls an icall, we write:
dest = m = mono_method_get_last_managed ();
mono_stack_walk_no_il (get_caller_no_reflection, &dest);
if (!dest) dest = m;

The get_caller_no_reflection walk works in two stages: in the first
stage we look for the target method (the initial value of dest) when we
find the target we set dest to NULL and then the second stage continues
walking upward past the reflection APIs.

However if the target method is itself in System.Reflection, the
old implementation would skip over it even in the first stage and we'd
never find the target method and exhaust the whole stack.

The fix is to move the check for the target method before the check for
the Reflection API methods.

8 years ago[runtime] Add a rootimage arg to mono_reflection_get_type_checked
Aleksey Kliger [Tue, 5 Apr 2016 15:33:23 +0000 (11:33 -0400)]
[runtime] Add a rootimage arg to mono_reflection_get_type_checked

And in type_from_parsed_name pass the calling image as the metadata
context even if the initial class we're looking for is in corlib.

This lets calls like
Type.GetType ("System.Collections.Generic.Dictionary<int, MyClass<int>>")
succeed.  (Previously we would firs try to find
System.Collections.Generic.Dictionary in the calling assembly,
which would fail outside of corlib, and then we'd retry with the
rootimage as corlib which would find Dictionary, but fail to find
MyClass.  Note that this was only broken if the outermost type was in
corlib.  It always worked deeper in generic type arguments provided
we startd in the calling assmebly:
Type.GetType ("MyClass<System.Collections.Generic.Dictionary<int, MyClass<int>>>")

This fixes part of [40060](https://bugzilla.xamarin.com/show_bug.cgi?id=40060)

8 years ago[runtime] Deduplicate MONO_ZERO_LEN_ARRAY into mono-compiler.h.
Joao Matos [Wed, 6 Apr 2016 17:06:29 +0000 (18:06 +0100)]
[runtime] Deduplicate MONO_ZERO_LEN_ARRAY into mono-compiler.h.

8 years ago[runtime] Factor out (MonoMarshalConv)-1 into its own define.
Joao Matos [Wed, 6 Apr 2016 16:55:55 +0000 (17:55 +0100)]
[runtime] Factor out (MonoMarshalConv)-1 into its own define.

Thanks to @marek-safar for suggestion.

8 years agoMerge pull request #2842 from akoeplinger/fix-monodroid-build
João Matos [Wed, 6 Apr 2016 16:46:56 +0000 (17:46 +0100)]
Merge pull request #2842 from akoeplinger/fix-monodroid-build

Fix monodroid build

8 years agoAdd android-libunwind submodule and fix path in mini-exceptions-native-unwinder.c
Alexander Köplinger [Wed, 6 Apr 2016 15:38:56 +0000 (17:38 +0200)]
Add android-libunwind submodule and fix path in mini-exceptions-native-unwinder.c

This was hosted in mono-extensions before. It is licensed under the MIT license:
https://android.googlesource.com/platform/external/libunwind/+/android-6.0.1_r24/LICENSE

8 years ago[corlib] Test Type.GetType(string,null,null) and anonymous type parsing
Aleksey Kliger [Wed, 6 Apr 2016 14:20:32 +0000 (10:20 -0400)]
[corlib] Test Type.GetType(string,null,null) and anonymous type parsing

8 years agoMerge pull request #2836 from kumpera/cwt_toggleref
Rodrigo Kumpera [Wed, 6 Apr 2016 15:24:52 +0000 (11:24 -0400)]
Merge pull request #2836 from kumpera/cwt_toggleref

Fixed a toggleref and CWT iteraction bug.

8 years ago[mini] Remove duplicated methods from tramp-arm64-gsharedvt.c
Alexander Köplinger [Wed, 6 Apr 2016 15:20:11 +0000 (17:20 +0200)]
[mini] Remove duplicated methods from tramp-arm64-gsharedvt.c

They are already defined in arch-stubs.c

8 years ago[mini] Fix incorrect ifdef in the arm64 gsharedvt files
Alexander Köplinger [Wed, 6 Apr 2016 15:19:36 +0000 (17:19 +0200)]
[mini] Fix incorrect ifdef in the arm64 gsharedvt files

It used MONO_ARCH_GSHARED_SUPPORTED instead of MONO_ARCH_GSHAREDVT_SUPPORTED.

8 years ago[mini] Add missing include to mini-exceptions-native-unwinder.c
Alexander Köplinger [Wed, 6 Apr 2016 15:16:49 +0000 (17:16 +0200)]
[mini] Add missing include to mini-exceptions-native-unwinder.c

It complained about mono_runtime_printf_err() not being defined.

8 years ago[mini] Fix ARM assembler syntax for MRC
Alexander Köplinger [Wed, 6 Apr 2016 15:14:02 +0000 (17:14 +0200)]
[mini] Fix ARM assembler syntax for MRC

According to http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0068b/CIHEEIDJ.html the MRC instruction is documented as:

    MRC{cond} coproc, opcode1, Rd, CRn, CRm{, opcode2}

with coproc being "the name of the coprocessor the instruction isfor. The standard name is pn, where n is an integer in the range 0-15."

GCC seemed to accept the operand without the 'p' prefix but clang raised an "invalid operand for instruction" error.

8 years ago[runtime] Fixed invalid comparisons to MonoMarshalConv in marshal.c.
Joao Matos [Wed, 6 Apr 2016 15:08:28 +0000 (16:08 +0100)]
[runtime] Fixed invalid comparisons to MonoMarshalConv in marshal.c.

In some platforms, C enums might be considered unsigned, and in that case we'd get the following warning:

mono/mono/metadata/marshal.c:5108:12: warning: comparison of constant -1 with expression of type 'MonoMarshalConv' is always false
      [-Wtautological-constant-out-of-range-compare]
                if (conv == -1) {
                    ~~~~ ^  ~~

The explicit cast should do the right thing.

8 years agoMerge pull request #2833 from directhex/ci-script-in-repo
Alexander Köplinger [Wed, 6 Apr 2016 13:12:29 +0000 (15:12 +0200)]
Merge pull request #2833 from directhex/ci-script-in-repo

Keep Jenkins job script in Mono repo

8 years agoMerge pull request #2804 from radical/al-cecil
Marek Safar [Wed, 6 Apr 2016 11:50:07 +0000 (13:50 +0200)]
Merge pull request #2804 from radical/al-cecil

AL: Use IKVM.Reflection to get custom attributes from the template assembly,

8 years agoMerge pull request #2840 from directhex/fix_make_dist_commoncrypto
Alexander Köplinger [Wed, 6 Apr 2016 09:24:56 +0000 (11:24 +0200)]
Merge pull request #2840 from directhex/fix_make_dist_commoncrypto

Fix missing CommonCrypto/Makefile.include in "make dist" tarballs

8 years agoFix missing CommonCrypto/Makefile.include in "make dist" tarballs
Jo Shields [Wed, 6 Apr 2016 09:04:50 +0000 (10:04 +0100)]
Fix missing CommonCrypto/Makefile.include in "make dist" tarballs

8 years agoKeep Jenkins job script in Mono repo
Jo Shields [Tue, 5 Apr 2016 15:18:41 +0000 (16:18 +0100)]
Keep Jenkins job script in Mono repo

This means we can change the script in different branches (right now, all pull requests against any branch share the same job script)

8 years ago[Microsoft.Build.Tasks] Fix CodeTaskFactory to resolve user references
Marek Safar [Wed, 6 Apr 2016 06:54:02 +0000 (08:54 +0200)]
[Microsoft.Build.Tasks] Fix CodeTaskFactory to resolve user references

8 years agoMerge pull request #2835 from lewurm/fix-make-dist
monojenkins [Wed, 6 Apr 2016 01:40:27 +0000 (02:40 +0100)]
Merge pull request #2835 from lewurm/fix-make-dist

[sqlmetal] fixup for a73fb31f2 in order to fix `make dist'

8 years ago[mprof-report] Don't print a thread with a zero thread ID in the summary.
Alex Rønne Petersen [Tue, 5 Apr 2016 22:42:54 +0000 (00:42 +0200)]
[mprof-report] Don't print a thread with a zero thread ID in the summary.

Log buffers can end up with a zero thread ID when we synthesize events on the
writer thread, leading to mprof-report thinking a thread exists with that ID.
We simply ignore the "zero thread" in the thread summary.

8 years ago[profiler] Ensure that we zero out thread IDs for buffers written from helper/writer...
Alex Rønne Petersen [Tue, 5 Apr 2016 22:44:59 +0000 (00:44 +0200)]
[profiler] Ensure that we zero out thread IDs for buffers written from helper/writer threads.

If we don't do this, mprof-report will pick up on the fact that the helper and
writer threads exist and print them in the thread summary with no names. It's
OK to zero out the thread ID as the kinds of events we write from these threads
cannot be meaningfully associated with the log buffer's thread ID (or in the
case of counters, any thread ID).

8 years ago[mprof-report] Don't assume the first thread seen is the main thread.
Alex Rønne Petersen [Tue, 5 Apr 2016 22:52:37 +0000 (00:52 +0200)]
[mprof-report] Don't assume the first thread seen is the main thread.

The runtime now explicitly sets the native name for the main thread, so this
(faulty) assumption is no longer necessary.

8 years ago[mini] Set a native thread name for the main thread in the driver.
Alex Rønne Petersen [Tue, 5 Apr 2016 22:50:46 +0000 (00:50 +0200)]
[mini] Set a native thread name for the main thread in the driver.

We only set the native name as MS.NET leaves the managed name for the main
thread as null. At least by setting the native name, we get a nice name in GDB.

8 years ago[threadpool] Explicitly use the root domain to allocate the thread name.
Alex Rønne Petersen [Tue, 5 Apr 2016 19:38:16 +0000 (21:38 +0200)]
[threadpool] Explicitly use the root domain to allocate the thread name.

This is mainly for consistency with the rest of the runtime which explicitly
specifies the root domain when allocating thread name strings.

8 years ago[runtime] Add thread names to all internal runtime threads.
Alex Rønne Petersen [Tue, 5 Apr 2016 06:56:06 +0000 (08:56 +0200)]
[runtime] Add thread names to all internal runtime threads.

8 years ago[gc] Allow changing the finalizer thread's name.
Alex Rønne Petersen [Tue, 5 Apr 2016 19:37:21 +0000 (21:37 +0200)]
[gc] Allow changing the finalizer thread's name.

This insanity is apparently allowed by MS.NET.

8 years ago[gc] Set name of the finalizer thread from within the thread.
Alex Rønne Petersen [Tue, 5 Apr 2016 06:52:42 +0000 (08:52 +0200)]
[gc] Set name of the finalizer thread from within the thread.

This ensures that its name is set with pthread_setname_np () on Mac.

8 years ago[threads] Export some functions so the entire runtime can set thread names.
Alex Rønne Petersen [Tue, 5 Apr 2016 04:32:10 +0000 (06:32 +0200)]
[threads] Export some functions so the entire runtime can set thread names.

8 years ago[threads] Make mono_thread_info_set_name () work on Mac in some cases.
Alex Rønne Petersen [Tue, 5 Apr 2016 04:31:14 +0000 (06:31 +0200)]
[threads] Make mono_thread_info_set_name () work on Mac in some cases.

We can use pthread_setname_np () on OS X 10.6+ when we're setting the name for
the current thread. For other cases, we just do nothing.

8 years ago[threads] Don't report tools threads that do a full attach to the profiler.
Alex Rønne Petersen [Tue, 5 Apr 2016 22:39:55 +0000 (00:39 +0200)]
[threads] Don't report tools threads that do a full attach to the profiler.

The profiler helper thread does a full attach for on-demand heapshots. Since we
collect no actual data for the helper thread, there's no reason to report it.

8 years ago[threads] Make sure we change the native thread name if it was set before starting.
Alex Rønne Petersen [Tue, 5 Apr 2016 23:27:17 +0000 (01:27 +0200)]
[threads] Make sure we change the native thread name if it was set before starting.

8 years ago[sgen] Make mono_gc_base_init () double-init resistant like the other GCs.
Alex Rønne Petersen [Tue, 5 Apr 2016 22:37:59 +0000 (00:37 +0200)]
[sgen] Make mono_gc_base_init () double-init resistant like the other GCs.

A double init could happen when profiling as we'd call mono_gc_base_init ()
from mono_profiler_load () early on, and then later call it again during the
normal startup sequence.

8 years ago[mini] Shut down the profiler after shutting down the major runtime components.
Alex Rønne Petersen [Tue, 5 Apr 2016 22:53:55 +0000 (00:53 +0200)]
[mini] Shut down the profiler after shutting down the major runtime components.

Previously, we would shut down the profiler so early that it would never see
unload events for threads, domains, etc. This sounds harmless at first, but
since the profiler dumps the remaining data in the thread-local log buffer to
disk from within the thread end callback, we would often miss events near the
end of a thread's lifetime.

Shutting down the profiler after the major runtime components doesn't appear to
have any negative effects, which makes sense as all managed threads should be
stopped by this point.

8 years ago[sgen] Mark togglerefs before processing ephemerons. Fixes #40108.
Rodrigo Kumpera [Tue, 5 Apr 2016 22:50:10 +0000 (18:50 -0400)]
[sgen] Mark togglerefs before processing ephemerons. Fixes #40108.

Strong Togglerefs must be considered as roots for the purpose of Ephemeron processing.

Otherwise you make it not possible to use a toggleref object as key.

8 years agoAL: Use IKVM.Reflection to get custom attributes from the template assembly,
Ankit Jain [Tue, 29 Mar 2016 21:23:06 +0000 (17:23 -0400)]
AL: Use IKVM.Reflection to get custom attributes from the template assembly,

.. instead of System.Reflection. This allows AL to work even if the
dependent assemblies of the template are not available.

8 years agoMerge pull request #2834 from xmcclure/inflated_method_header_leak_followup
monojenkins [Tue, 5 Apr 2016 22:00:37 +0000 (23:00 +0100)]
Merge pull request #2834 from xmcclure/inflated_method_header_leak_followup

Fix uninitialized MonoError in mono_basic_block_split

Follow-up on PR #2781 which removed a mono_error_init leading to memory unsafety. This was causing crashes when verifying assemblies in the 4.4 branch although it does not seem to have caused any known problems in master for some reason.

8 years ago[sqlmetal] fixup for a73fb31f2 in order to fix `make dist'
Bernhard Urban [Tue, 5 Apr 2016 21:08:31 +0000 (14:08 -0700)]
[sqlmetal] fixup for a73fb31f2 in order to fix `make dist'

8 years ago[msvc] add new module
Bernhard Urban [Tue, 5 Apr 2016 20:02:03 +0000 (13:02 -0700)]
[msvc] add new module

but only compile stubs on windows

8 years agoMerge pull request #2832 from razzfazz/handle_eintr
Alexander Köplinger [Tue, 5 Apr 2016 19:39:14 +0000 (21:39 +0200)]
Merge pull request #2832 from razzfazz/handle_eintr

handle EINTR for kevent calls

8 years agoDocument mono_error_init convention in source
Andi McClure [Tue, 5 Apr 2016 18:51:25 +0000 (14:51 -0400)]
Document mono_error_init convention in source

8 years ago[runtime] restore mono_error_init in mono_basic_block_split
Andi McClure [Tue, 5 Apr 2016 18:32:18 +0000 (14:32 -0400)]
[runtime] restore mono_error_init in mono_basic_block_split

Follow-up on PR #2781 which removed a mono_error_init. Ensure use in
helper functions for consistency. Fixes a potential crasher.