mono.git
8 years agoMerge pull request #2716 from BrzVlad/fix-tramp-jinfo
Vlad Brezae [Thu, 3 Mar 2016 14:56:47 +0000 (21:56 +0700)]
Merge pull request #2716 from BrzVlad/fix-tramp-jinfo

[aot] Set null uw_info for tramps without unwind info

8 years agoMerge pull request #2268 from kumpera/coreclr-testsuite-fixes-1
Rodrigo Kumpera [Thu, 3 Mar 2016 06:08:01 +0000 (01:08 -0500)]
Merge pull request #2268 from kumpera/coreclr-testsuite-fixes-1

First batch of bug fixes found in the CoreClr test suite.

8 years agoMerge pull request #2710 from akoeplinger/fix-typo
Rodrigo Kumpera [Thu, 3 Mar 2016 03:43:50 +0000 (22:43 -0500)]
Merge pull request #2710 from akoeplinger/fix-typo

[jit] Fix duplicated left-hand side in comparison

8 years ago[jit] Fix target_type_is_incompatible to type check byref enums correctly.
Rodrigo Kumpera [Mon, 16 Nov 2015 05:22:56 +0000 (00:22 -0500)]
[jit] Fix target_type_is_incompatible to type check byref enums correctly.

8 years agoMerge pull request #2709 from lewurm/jit-phase-typo
monojenkins [Wed, 2 Mar 2016 23:45:34 +0000 (23:45 +0000)]
Merge pull request #2709 from lewurm/jit-phase-typo

[jit] remove 'jit_' prefix in two phases in stats output

@monojenkins merge

8 years agoMerge pull request #2645 from alexrp/profiler-stability
Rodrigo Kumpera [Wed, 2 Mar 2016 20:33:07 +0000 (15:33 -0500)]
Merge pull request #2645 from alexrp/profiler-stability

Fix a crash in the MONO_LLS_FOREACH_SAFE macro

8 years ago[jit] Fix duplicated left-hand side in comparison
Alexander Köplinger [Wed, 2 Mar 2016 20:01:27 +0000 (21:01 +0100)]
[jit] Fix duplicated left-hand side in comparison

The typo introduced by 1a784475c04a7b371e53346bee032590f4f94853 caused the if to always be false,
because it would compare like if (true == MONO_EXCEPTION_FIELD_ACCESS).

8 years ago[jit] remove 'jit_' prefix in two phases in stats output
Bernhard Urban [Wed, 2 Mar 2016 18:24:44 +0000 (10:24 -0800)]
[jit] remove 'jit_' prefix in two phases in stats output

8 years ago[sgen] Use regular, non-safe LLS foreach macro.
Alex Rønne Petersen [Wed, 2 Mar 2016 16:30:08 +0000 (17:30 +0100)]
[sgen] Use regular, non-safe LLS foreach macro.

As it turns out, all these uses of FOREACH_THREAD_SAFE were inside regions
where the suspend lock is held. This effectively meant that no modifications
to the thread list could actually happen while the foreach was executing. Since
the guarantees provided by FOREACH_THREAD_SAFE are not needed in any of these
cases, switch to FOREACH_THREAD. The latter macro also happens to be much more
lightweight, so this should result in an overall (small) performance gain.

8 years ago[utils/lls] Make the node free function support more flexible.
Alex Rønne Petersen [Sat, 20 Feb 2016 00:59:47 +0000 (01:59 +0100)]
[utils/lls] Make the node free function support more flexible.

The caller of mono_lls_init () can now specify whether the free function can or
cannot lock, rather than the LLS assuming that it can't. The only reason this
limitation existed was because the LLS wasn't extended to allow specifying this
information in/after 56a6ae2bd0ac3b9ebf8ad9daec6aca484b7e487b.

In addition, all LLS functions are now callable from both safe and async
context; the caller must specify the context as an additional argument. If a
free function is in use and it may lock, we'll simply enqueue it for execution
at a later point if an LLS function is invoked in async context.

8 years ago[utils/hp] Improve the mono_thread_hazardous_free_or_queue () API.
Alex Rønne Petersen [Sat, 20 Feb 2016 00:42:09 +0000 (01:42 +0100)]
[utils/hp] Improve the mono_thread_hazardous_free_or_queue () API.

1. The function suffered from the "too many bools" problem. Pass enum values
   instead so that call sites are clearer.
2. Don't restrict the combination of arguments. This makes it easier to use
   the function as part of data structures where the arguments aren't known
   ahead of time (e.g. the LLS).

8 years ago[utils/lls] Fix the safe foreach macro.
Alex Rønne Petersen [Thu, 18 Feb 2016 05:00:43 +0000 (06:00 +0100)]
[utils/lls] Fix the safe foreach macro.

This fixes a bug that would manifest when running the profiler on a program
that rapidly spawns/joins threads.

The problem was this: Given T1 which is joining on T2, T2 which is returning
and removing itself from the thread list, and T3 which is currently in the
SIGPROF signal handler, it was possible for T3 to encounter a pointer to T2's
freed thread info structure in the thread list. This can happen because the
SIGPROF handler doesn't actually acquire the suspend lock (it can't) while
iterating the thread list.

The MONO_LLS_FOREACH_SAFE macro was supposed to protect against this case
specifically and, as a result, only provide a snapshot of the thread list.
However, it was missing some very important bits of the mono_lls_find ()
algorithm. The gory details can be found in the paper that the LLS is based on:

    http://www.research.ibm.com/people/m/michael/spaa-2002.pdf

In particular, refer to the "Using Other Memory Management Methods" section
on page 6. It describes why lines E1-2 and E3-4 are necessary in order to
safely iterate the list in an implementation using hazard pointers (such as
ours). Basically, the iteration of the list has to be restarted if any sort of
modification to the list is detected during iteration. Otherwise, it's possible
to read and follow removed/freed memory, leading to all sorts of Bad Things™
happening.

Now, obviously we can't just restart a foreach loop without further thought;
that would cause all sorts of breakage due to the loop body being executed on
the same elements multiple times. As it happens, the LLS is an ordered data
structure: Elements are arranged in ascending order by key. We can exploit
this fact when iterating the list and restarting the loop. By simply storing
the last key we successfully processed, when restarting the loop, we can just
skip all keys that are not greater than the last key we successfully processed.

In addition to this, the MONO_LLS_FOREACH_SAFE macro now assists in freeing
removed elements that it encounters, just like mono_lls_find ().

The end result is that MONO_LLS_FOREACH_SAFE is now truly safe to use at any
point. It does have the potential to be ever so slightly slower, however, since
it does do significantly more work than it used to, and might even have to
restart the loop multiple times if lots of threads are modifying the thread
list at the same time. This doesn't seem to be a problem in practice, though.

Finally, to reduce the maintenance burden, the non-filtered versions of the
macros are now implemented in terms of the filtered versions, using a static
inline filter function that always returns true. When using the non-filtered
macros, the compiler will just eliminate the check entirely through its usual
optimization passes.

8 years agoMerge pull request #2145 from dlech/patch-2
Alexander Köplinger [Wed, 2 Mar 2016 16:12:08 +0000 (17:12 +0100)]
Merge pull request #2145 from dlech/patch-2

Strip extra null characters in socketAddress

8 years agoMerge pull request #2699 from pruiz/integrate-syswebrouting-master
Alexander Köplinger [Wed, 2 Mar 2016 16:02:06 +0000 (17:02 +0100)]
Merge pull request #2699 from pruiz/integrate-syswebrouting-master

Completely replace System.Web.Routing with implementation from reference source

8 years ago[ilasm] When generating method signatures for method-defs, make sure they contain...
Rodrigo Kumpera [Mon, 7 Dec 2015 02:37:52 +0000 (21:37 -0500)]
[ilasm] When generating method signatures for method-defs, make sure they contain the full call conv. Fixes b35784.

When generating varargs signatures for method defs, ilasm would discard the rest of the call conv. Things
like instance or explicit this would be discarded.

8 years ago[mini] Weaken type check for byrefs to allow narrowing stores of primitive types...
Rodrigo Kumpera [Mon, 30 Nov 2015 01:11:33 +0000 (20:11 -0500)]
[mini] Weaken type check for byrefs to allow narrowing stores of primitive types. Fixes b59858.

CoreClr allows storing a wider primitive byref into a narrower one. int32& -> int16&, for example.

This is a safe weakening as there's no risk of overflows, undefined behavior or unaligned access.

8 years ago[jit] Using a literal field with stdsfld/ldsfld should trigger a MissingFieldExceptio...
Rodrigo Kumpera [Sat, 28 Nov 2015 20:07:51 +0000 (15:07 -0500)]
[jit] Using a literal field with stdsfld/ldsfld should trigger a MissingFieldException. Fixes b13452.

8 years ago[runtime] Fail Void arrays with Invalid Program exception instead of a TLE. Fixes...
Rodrigo Kumpera [Sat, 28 Nov 2015 15:50:01 +0000 (10:50 -0500)]
[runtime] Fail Void arrays with Invalid Program exception instead of a TLE. Fixes b353858.

8 years ago[mini] ckfinite throws OverflowException and not ArithmeticException. Fixes JIT/Regre...
Rodrigo Kumpera [Fri, 27 Nov 2015 22:15:15 +0000 (17:15 -0500)]
[mini] ckfinite throws OverflowException and not ArithmeticException. Fixes JIT/Regression/VS-ia64-JIT/M00/b108366.

8 years ago[jit] Try blocks can end at the last instruction of the method. Fixes DevDiv2_11321.
Rodrigo Kumpera [Thu, 26 Nov 2015 04:29:22 +0000 (23:29 -0500)]
[jit] Try blocks can end at the last instruction of the method. Fixes DevDiv2_11321.

Ass oddly as it sounds, it's valid to emit the catch handler before the try block
and have it be the last sequence of instructions in the method body.

This patch checks for that condition before looking the BB in cil_offset_to_bb.

8 years agoMerge pull request #2684 from ludovic-henry/monoerror-exception
monojenkins [Wed, 2 Mar 2016 15:30:51 +0000 (15:30 +0000)]
Merge pull request #2684 from ludovic-henry/monoerror-exception

[runtime] Use MonoError for mono_get_exception_type_initialization, mono_get_exception_reflection_type_load and mono_get_exception_runtime_wrapped

8 years agoMerge pull request #2696 from lambdageek/dev/unlock-mono_class_create_runtime_vtable
monojenkins [Wed, 2 Mar 2016 15:30:41 +0000 (15:30 +0000)]
Merge pull request #2696 from lambdageek/dev/unlock-mono_class_create_runtime_vtable

[runtime] Don't raise exception while holding locks

8 years ago[PEAPI] Fixed encoded token sizes for HasCustomAttribute, CustomAttributeType and...
Rodrigo Kumpera [Thu, 26 Nov 2015 02:45:29 +0000 (21:45 -0500)]
[PEAPI] Fixed encoded token sizes for HasCustomAttribute, CustomAttributeType and MemberRefParent.

This would cause some large il files to be miscompiled as the token size would not be the expected one.

This was found in b28158/test.il.

8 years ago[runtime] Null check the pointer argument of Interlocked::Exchange<T>. Fixes exchange...
Rodrigo Kumpera [Wed, 25 Nov 2015 14:16:57 +0000 (09:16 -0500)]
[runtime] Null check the pointer argument of Interlocked::Exchange<T>. Fixes exchangetneg.

8 years ago[msvc] Update .def files to fix Windows build
Alexander Köplinger [Wed, 2 Mar 2016 14:04:54 +0000 (15:04 +0100)]
[msvc] Update .def files to fix Windows build

8 years ago[runtime] Use MonoError for mono_get_exception_type_initialization, mono_get_exceptio...
Ludovic Henry [Fri, 26 Feb 2016 13:32:09 +0000 (13:32 +0000)]
[runtime] Use MonoError for mono_get_exception_type_initialization, mono_get_exception_reflection_type_load and mono_get_exception_runtime_wrapped

8 years ago[aot] Set null uw_info for tramps without unwind info
Vlad Brezae [Wed, 2 Mar 2016 08:19:01 +0000 (10:19 +0200)]
[aot] Set null uw_info for tramps without unwind info

We don't register jit infos for tramps that don't have unwind info because we can't unwind from them. Explicitly set uw_info to NULL, instead of pointing to a zero length array in the aot image, to not confuse the runtime when registering the tramp.

Likely to fix #38267

8 years ago[runtime] Move some mono_error_raise_exception () calls to icalls from utility functi...
Zoltan Varga [Wed, 2 Mar 2016 02:11:46 +0000 (03:11 +0100)]
[runtime] Move some mono_error_raise_exception () calls to icalls from utility functions. NFC.

8 years ago[runtime] Rename some icalls to match the icall naming convention. NFC.
Zoltan Varga [Wed, 2 Mar 2016 01:09:08 +0000 (02:09 +0100)]
[runtime] Rename some icalls to match the icall naming convention. NFC.

8 years agoMerge pull request #2705 from kumpera/loader-error-cleanup7
Rodrigo Kumpera [Wed, 2 Mar 2016 02:07:22 +0000 (21:07 -0500)]
Merge pull request #2705 from kumpera/loader-error-cleanup7

[runtime] Remove the loader error from the remaining of the loader.

8 years agoReplaced System.Web.Routing with referencesources own implementation.
Pablo Ruiz [Mon, 29 Feb 2016 17:59:05 +0000 (18:59 +0100)]
Replaced System.Web.Routing with referencesources own implementation.

8 years ago[misc] Multiple small fixes and cleanups.
Rodrigo Kumpera [Mon, 16 Nov 2015 05:22:56 +0000 (00:22 -0500)]
[misc] Multiple small fixes and cleanups.

8 years ago[utils] Add mono_error_move.
Rodrigo Kumpera [Mon, 16 Nov 2015 05:22:56 +0000 (00:22 -0500)]
[utils] Add mono_error_move.

8 years ago[runtime] Ban mono_method_get_header and promote mono_method_get_header_check to...
Rodrigo Kumpera [Tue, 23 Feb 2016 18:08:52 +0000 (13:08 -0500)]
[runtime] Ban mono_method_get_header and promote mono_method_get_header_check to the API as the profiler needs it.

8 years agoMerge pull request #2662 from mattleibow/pcl-mono.options
Jonathan Pryor [Tue, 1 Mar 2016 17:20:28 +0000 (09:20 -0800)]
Merge pull request #2662 from mattleibow/pcl-mono.options

[Mono.Options] Changed the code a bit so that it works with PCL

8 years agoFix marshaling of file name in Mono.Unix.UnixEndPoint.Create()
David Lechner [Sat, 17 Oct 2015 19:40:54 +0000 (14:40 -0500)]
Fix marshaling of file name in Mono.Unix.UnixEndPoint.Create()

In some cases, the null terminator in the SocketAddress may not be the last
character. This changes the algorithm to ignore the null terminator and
anything after it instead of assuming that the last character is the null
terminator.

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

8 years agoAdd unit tests for Mono.Unix.UnixEndpoint and Mono.Unix.UnixListener
David Lechner [Sat, 17 Oct 2015 17:27:23 +0000 (12:27 -0500)]
Add unit tests for Mono.Unix.UnixEndpoint and Mono.Unix.UnixListener

Tests for regression of https://bugzilla.xamarin.com/show_bug.cgi?id=35004

8 years ago[runtime] Remove all usages of mono_method_get_header from the runtime.
Rodrigo Kumpera [Tue, 23 Feb 2016 18:03:29 +0000 (13:03 -0500)]
[runtime] Remove all usages of mono_method_get_header from the runtime.

8 years ago[runtime] Replace mono_method_get_header with mono_method_get_header_checked.
Rodrigo Kumpera [Tue, 23 Feb 2016 17:46:30 +0000 (12:46 -0500)]
[runtime] Replace mono_method_get_header with mono_method_get_header_checked.

8 years ago[runtime] Use mono_method_get_header_checked in debug-helpers.c
Rodrigo Kumpera [Tue, 23 Feb 2016 17:18:21 +0000 (12:18 -0500)]
[runtime] Use mono_method_get_header_checked in debug-helpers.c

8 years ago[gc] Use the new MonoMethodBuilder:init_locals field.
Rodrigo Kumpera [Tue, 23 Feb 2016 16:24:13 +0000 (11:24 -0500)]
[gc] Use the new MonoMethodBuilder:init_locals field.

8 years ago[runtime] Add init_locals field to MonoMethodBuilder to make it easy to get it set...
Rodrigo Kumpera [Tue, 23 Feb 2016 16:17:03 +0000 (11:17 -0500)]
[runtime] Add init_locals field to MonoMethodBuilder to make it easy to get it set to false.

8 years ago[runtime] Add mono_method_get_header_checked and implement mono_method_get_header...
Rodrigo Kumpera [Tue, 23 Feb 2016 16:06:56 +0000 (11:06 -0500)]
[runtime] Add mono_method_get_header_checked and implement mono_method_get_header using it.

8 years ago[runtime] Ban mono_method_get_signature_full. It has no runtime usage left.
Rodrigo Kumpera [Tue, 23 Feb 2016 15:55:15 +0000 (10:55 -0500)]
[runtime] Ban mono_method_get_signature_full. It has no runtime usage left.

8 years ago[runtime] Ban mono_method_get_signature. Nothing else uses it.
Rodrigo Kumpera [Tue, 23 Feb 2016 15:53:45 +0000 (10:53 -0500)]
[runtime] Ban mono_method_get_signature. Nothing else uses it.

8 years ago[runtime] Ban mono_class_inflate_generic_type from usage by the runtime. Move code...
Rodrigo Kumpera [Tue, 23 Feb 2016 15:50:55 +0000 (10:50 -0500)]
[runtime] Ban mono_class_inflate_generic_type from usage by the runtime. Move code to use mono_class_inflate_generic_type_checked.

8 years ago[runtime] Remove mono_class_inflate_generic_class, replace usage with mono_class_infl...
Rodrigo Kumpera [Tue, 23 Feb 2016 12:18:19 +0000 (07:18 -0500)]
[runtime] Remove mono_class_inflate_generic_class, replace usage with mono_class_inflate_generic_class_checked.

8 years ago[runtime] Add mono error to inflate_generic_header. Fix buglet in mono_method_get_sig...
Rodrigo Kumpera [Tue, 23 Feb 2016 12:17:57 +0000 (07:17 -0500)]
[runtime] Add mono error to inflate_generic_header. Fix buglet in mono_method_get_signature_checked.

8 years ago[runtime] Ban mono_metadata_parse_mh from the runtime.
Rodrigo Kumpera [Mon, 22 Feb 2016 04:09:58 +0000 (23:09 -0500)]
[runtime] Ban mono_metadata_parse_mh from the runtime.

8 years ago[runtime] Introduce MonoError in mono_metadata_parse_mh_full.
Rodrigo Kumpera [Mon, 22 Feb 2016 04:05:18 +0000 (23:05 -0500)]
[runtime] Introduce MonoError in mono_metadata_parse_mh_full.

8 years ago[runtime] Remove dead function mono_metadata_parse_type_full.
Rodrigo Kumpera [Mon, 22 Feb 2016 02:53:30 +0000 (21:53 -0500)]
[runtime] Remove dead function mono_metadata_parse_type_full.

8 years ago[runtime] Disallow usage of mono_metadata_parse_type, mono_metadata_parse_param and...
Rodrigo Kumpera [Mon, 22 Feb 2016 02:39:07 +0000 (21:39 -0500)]
[runtime] Disallow usage of mono_metadata_parse_type, mono_metadata_parse_param and mono_metadata_parse_field_type.

8 years ago[mono-error] mono_metadata_parse_array is not longer used by the runtime, ban it.
Rodrigo Kumpera [Sun, 21 Feb 2016 22:52:43 +0000 (17:52 -0500)]
[mono-error] mono_metadata_parse_array is not longer used by the runtime, ban it.

8 years ago[mono-error] mono_class_from_name and mono_class_from_name_case now can cleanly retur...
Rodrigo Kumpera [Sun, 21 Feb 2016 22:50:32 +0000 (17:50 -0500)]
[mono-error] mono_class_from_name and mono_class_from_name_case now can cleanly return NULL on failure.

8 years agoMerge pull request #2686 from ludovic-henry/monoerror-mono_remoting_invoke
monojenkins [Tue, 1 Mar 2016 15:30:18 +0000 (15:30 +0000)]
Merge pull request #2686 from ludovic-henry/monoerror-mono_remoting_invoke

[runtime] Use MonoError for mono_remoting_invoke

8 years agoMerge pull request #2701 from akoeplinger/fix-async-read-test
João Matos [Tue, 1 Mar 2016 10:14:29 +0000 (10:14 +0000)]
Merge pull request #2701 from akoeplinger/fix-async-read-test

Fix unreliability in async_read.exe test

8 years agoMerge pull request #2702 from akoeplinger/bug-38933
João Matos [Tue, 1 Mar 2016 10:10:59 +0000 (10:10 +0000)]
Merge pull request #2702 from akoeplinger/bug-38933

[System.Security] Fix CryptographicException from ProtectedData.Protect with multiple threads

8 years agoMerge pull request #2703 from akoeplinger/pupitetris-Bug-35635
monojenkins [Tue, 1 Mar 2016 08:35:20 +0000 (08:35 +0000)]
Merge pull request #2703 from akoeplinger/pupitetris-Bug-35635

Don't trim TimeZone names ending in parenthesys

Replaces/Closes #2206

@monojenkins merge

8 years ago[corlib] Add test for #35635
Alexander Köplinger [Tue, 1 Mar 2016 07:03:47 +0000 (08:03 +0100)]
[corlib] Add test for #35635

8 years agoDon't trim TimeZone names ending in parenthesys.
Arturo Espinosa [Fri, 6 Nov 2015 22:44:40 +0000 (16:44 -0600)]
Don't trim TimeZone names ending in parenthesys.
Such as "Central Standard Time (Mexico)"

8 years ago[System.Security] Fix CryptographicException from ProtectedData.Protect with multiple...
Alexander Köplinger [Tue, 1 Mar 2016 06:24:02 +0000 (07:24 +0100)]
[System.Security] Fix CryptographicException from ProtectedData.Protect with multiple threads

The code in ManagedProtection.GetKey() instantiated a new RSACryptoServiceProvider singleton without proper
locking to avoid multiple threads running the initialization concurrently.
Since RSACryptoServiceProvider (or rather KeyPairPersistence underneath) uses an XML file with a name derived
from the parameters to store the data there could be a case where one thread writes while another tries to read
and gets garbage. This results in a CryptographicException later on.

Added locking to prevent this.

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

8 years agoFix unreliability in async_read.exe test
Alexander Köplinger [Tue, 1 Mar 2016 05:09:51 +0000 (06:09 +0100)]
Fix unreliability in async_read.exe test

It failed on Jenkins today (https://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/3611/parsed_console/log_content.html#WARNING1)
and I could repro it after running the test in a loop.

While looking at the test, the "sum -= buf [0]" seemed suspicious to me. The final callback invocation after the last byte was read results
in buf [0] being 0 most of the time (because no bytes were read). However, due to the async nature of the test that final callback might happen
before another callback and buf then has a value, resulting in a wrong checksum if that value is substracted.

The fix is to remove the substraction. I have no idea why it was done in the first place, but it's been there since the test was added in 2003...

While at it, I've added another check for the number of bytes read and used proper Interlocked.* operations to ensure atomicity.

8 years agoMerge pull request #2695 from vargaz/process-set-pending
monojenkins [Tue, 1 Mar 2016 03:45:21 +0000 (03:45 +0000)]
Merge pull request #2695 from vargaz/process-set-pending

[runtime] Use pending exceptions in process.c.

8 years ago[runtime] Use the return_if_nok () macros in socket-io.c.
Zoltan Varga [Tue, 1 Mar 2016 00:55:55 +0000 (01:55 +0100)]
[runtime] Use the return_if_nok () macros in socket-io.c.

8 years agoMerge pull request #2691 from vargaz/socket-io-pending-exception
Zoltan Varga [Tue, 1 Mar 2016 00:14:04 +0000 (01:14 +0100)]
Merge pull request #2691 from vargaz/socket-io-pending-exception

[runtime] Use pending exceptions in socket-io.c.

8 years ago[runtime] Use return_if_nok/return_val_if_nok to simplify error handling code in...
Zoltan Varga [Mon, 29 Feb 2016 23:37:25 +0000 (00:37 +0100)]
[runtime] Use return_if_nok/return_val_if_nok to simplify error handling code in process.c.

8 years agoMerge pull request #2694 from ludovic-henry/fix-sleep-overflow
monojenkins [Mon, 29 Feb 2016 22:35:35 +0000 (22:35 +0000)]
Merge pull request #2694 from ludovic-henry/fix-sleep-overflow

[threads] Fix mono_thread_info_sleep overflow

This overflow would happen of the machine was up for more than 29 days, leading to an overflow in the value returned by mono_100ms_ticks.

The simplest solution is simply to resort to mono_100ns_ticks which would only overflow after more than 29247 years. So even the platform implement this value as the time since 0000-00-00 00:00:00, we still have more than 27000 years if front of us. It's also highly unlikely that we would overflow the `end' value when adding `ms', as that would mean we are in the last 29 days of that 29247 years.

@monojenkins merge

8 years agoMerge pull request #2680 from lambdageek/dev/reflection-no-loadererror
monojenkins [Mon, 29 Feb 2016 21:15:43 +0000 (21:15 +0000)]
Merge pull request #2680 from lambdageek/dev/reflection-no-loadererror

[reflection] Get rid of loader error in reflection.c

Get rid of (direct and indirect) calls to `mono_loader_set_error_from_mono_error` in reflection.c:

- `mono_custom_attrs_from_index`
- `mono_custom_attrs_from_method`
- `mono_custom_attrs_from_class`
- `mono_custom_attrs_from_assembly`
- `mono_custom_attrs_from_module`
- `mono_custom_attrs_from_property`
- `mono_custom_attrs_from_event`
- `mono_custom_attrs_from_field`
- `mono_custom_attrs_from_param`

In all the functions, add a `_checked` variant that has a `MonoError*` out argument and for the  MONO_API functions.  The public API versions just clean up the error and return NULL.  Loader error isn't touched anymore.

8 years agoMerge pull request #2675 from lambdageek/dev/monoerror-mono_string_intern
monojenkins [Mon, 29 Feb 2016 19:05:41 +0000 (19:05 +0000)]
Merge pull request #2675 from lambdageek/dev/monoerror-mono_string_intern

Use MonoError in mono_string_{is_interned,intern}

Also mark mono_string_intern external only.  Runtime should use
mono_string_intern_checked.

8 years ago[metadata] Don't abort if trying to fetch the header summary of a method with no...
Rodrigo Kumpera [Mon, 16 Nov 2015 05:22:56 +0000 (00:22 -0500)]
[metadata] Don't abort if trying to fetch the header summary of a method with no body. Fixes #39200.

This assert made it impossible to fail gracefully when inlining broken methods.

8 years ago[corlib] Fix tests to compile when Thread.Suspend/Resume is not supported.
Rolf Bjarne Kvinge [Mon, 29 Feb 2016 18:02:33 +0000 (19:02 +0100)]
[corlib] Fix tests to compile when Thread.Suspend/Resume is not supported.

8 years ago[runtime] Don't raise exception while holding locks
Aleksey Kliger [Mon, 29 Feb 2016 16:51:41 +0000 (11:51 -0500)]
[runtime] Don't raise exception while holding locks

8 years ago[reflection] Expect no loader error in mono_reflection_get_custom_attrs_by_type anymore
Aleksey Kliger [Thu, 25 Feb 2016 22:26:36 +0000 (17:26 -0500)]
[reflection] Expect no loader error in mono_reflection_get_custom_attrs_by_type anymore

8 years ago[reflection] Use MonoError for mono_custom_attrs_from_param
Aleksey Kliger [Thu, 25 Feb 2016 22:09:55 +0000 (17:09 -0500)]
[reflection] Use MonoError for mono_custom_attrs_from_param

Mark it external only.  Runtime should use mono_custom_attrs_from_param_checked

8 years ago[reflection] Use MonoError for mono_custom_attrs_from_field
Aleksey Kliger [Thu, 25 Feb 2016 21:58:01 +0000 (16:58 -0500)]
[reflection] Use MonoError for mono_custom_attrs_from_field

Mark it external only.  Runtime should use mono_custom_attrs_from_field_checked.

8 years ago[reflection] Use MonoError for mono_custom_attrs_from_event
Aleksey Kliger [Thu, 25 Feb 2016 21:46:29 +0000 (16:46 -0500)]
[reflection] Use MonoError for mono_custom_attrs_from_event

Mark it external only.  Runtime should use mono_custom_attrs_from_event_checked.

8 years ago[reflection] Use MonoError for mono_custom_attrs_from_property
Aleksey Kliger [Thu, 25 Feb 2016 21:38:28 +0000 (16:38 -0500)]
[reflection] Use MonoError for mono_custom_attrs_from_property

Mark it external only.  Runtime should use mono_custom_attrs_from_property_checked.

8 years ago[reflection] Use MonoError for mono_custom_attrs_from_module
Aleksey Kliger [Thu, 25 Feb 2016 21:34:16 +0000 (16:34 -0500)]
[reflection] Use MonoError for mono_custom_attrs_from_module

8 years ago[reflection] Use MonoError for mono_custom_attrs_from_assembly
Aleksey Kliger [Thu, 25 Feb 2016 21:30:44 +0000 (16:30 -0500)]
[reflection] Use MonoError for mono_custom_attrs_from_assembly

Mark it external only.  Runtime should use mono_custom_attrs_from_assembly_checked.

8 years ago[reflection] Use MonoError for mono_custom_attrs_from_class instead of loader error.
Aleksey Kliger [Thu, 25 Feb 2016 20:35:56 +0000 (15:35 -0500)]
[reflection] Use MonoError for mono_custom_attrs_from_class instead of loader error.

Also mark mono_custom_attrs_from_class external only.  Runtime should
use mono_custom_attrs_from_class_checked.

8 years ago[reflection] Use MonoError in mono_custom_attrs_from_{index, method} instead of loade...
Aleksey Kliger [Thu, 25 Feb 2016 19:14:25 +0000 (14:14 -0500)]
[reflection] Use MonoError in mono_custom_attrs_from_{index, method} instead of loader error.

Also mark both as external only.  Runtime should use
mono_custom_attrs_from_index_checked and mono_custom_attrs_from_method_checked.

8 years ago[runtime] Fix compilation warning
Ludovic Henry [Mon, 29 Feb 2016 15:59:09 +0000 (15:59 +0000)]
[runtime] Fix compilation warning

8 years ago[runtime] Use MonoError for mono_remoting_invoke
Ludovic Henry [Fri, 26 Feb 2016 14:07:43 +0000 (14:07 +0000)]
[runtime] Use MonoError for mono_remoting_invoke

8 years agoUse MonoError in mono_string_{is_interned,intern}
Aleksey Kliger [Wed, 24 Feb 2016 22:11:47 +0000 (17:11 -0500)]
Use MonoError in mono_string_{is_interned,intern}

Also mark mono_string_intern external only.  Runtime should use
mono_string_intern_checked.

8 years ago[runtime] Use pending exceptions in process.c.
Zoltan Varga [Mon, 29 Feb 2016 15:23:48 +0000 (16:23 +0100)]
[runtime] Use pending exceptions in process.c.

8 years ago[threads] Fix mono_thread_info_sleep overflow
Ludovic Henry [Mon, 29 Feb 2016 14:42:31 +0000 (14:42 +0000)]
[threads] Fix mono_thread_info_sleep overflow

This overflow would happen of the machine was up for more than 29 days, leading to an overflow in the value returned by mono_100ms_ticks.

The simplest solution is simply to resort to mono_100ns_ticks which would only overflow after more than 29247 years. So even the platform implement this value as the time since 0000-00-00 00:00:00, we still have more than 27000 years if front of us. It's also highly unlikely that we would overflow the `end' value when adding `ms', as that would mean we are in the last 29 days of that 29247 years.

8 years agoMerge pull request #2693 from dellis1972/master
monojenkins [Mon, 29 Feb 2016 13:30:19 +0000 (13:30 +0000)]
Merge pull request #2693 from dellis1972/master

[msbuild] Getting build error "Error initializing task XmlPeek: Not registered task XmlPeek".

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

Removes the uses of LogXXXFromResources from XmlPeek because
we do not use string resources in xbuild.

8 years ago[msbuild] Getting build error "Error initializing task XmlPeek: Not registered task...
Dean Ellis [Mon, 29 Feb 2016 11:55:15 +0000 (11:55 +0000)]
[msbuild] Getting build error "Error initializing task XmlPeek: Not registered task XmlPeek".

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

Removes the uses of LogXXXFromResources from XmlPeek because
we do not use string resources in xbuild.

8 years agoMerge pull request #2692 from vargaz/process-coding-conv
monojenkins [Mon, 29 Feb 2016 04:00:17 +0000 (04:00 +0000)]
Merge pull request #2692 from vargaz/process-coding-conv

[runtime] Use mono coding conventions in process.c.

8 years ago[runtime] Use mono coding conventions in process.c.
Zoltan Varga [Mon, 29 Feb 2016 02:35:15 +0000 (03:35 +0100)]
[runtime] Use mono coding conventions in process.c.

8 years ago[runtime] Use pending exceptions in socket-io.c.
Zoltan Varga [Mon, 29 Feb 2016 01:58:38 +0000 (02:58 +0100)]
[runtime] Use pending exceptions in socket-io.c.

8 years agoMerge pull request #2690 from steffen-kiess/json-operator-uint
Alexander Köplinger [Sun, 28 Feb 2016 23:06:51 +0000 (00:06 +0100)]
Merge pull request #2690 from steffen-kiess/json-operator-uint

Fix typo in JsonValue which broke the conversion to uint and add test case

8 years agoFix typo in JsonValue which broke the conversion to uint and add test case
Steffen Kieß [Sun, 28 Feb 2016 17:40:22 +0000 (18:40 +0100)]
Fix typo in JsonValue which broke the conversion to uint and add test case

8 years agoBring new IKVM
Miguel de Icaza [Sat, 27 Feb 2016 20:27:46 +0000 (15:27 -0500)]
Bring new IKVM

8 years agoMerge pull request #2580 from ItsVeryWindy/master
João Matos [Sat, 27 Feb 2016 12:37:39 +0000 (12:37 +0000)]
Merge pull request #2580 from ItsVeryWindy/master

Updates to WebRequestHandler

8 years agoMerge pull request #2672 from Numpsy/sgenexception
João Matos [Sat, 27 Feb 2016 12:36:36 +0000 (12:36 +0000)]
Merge pull request #2672 from Numpsy/sgenexception

[sgen] catch NotSupportedException from system.xml.serialization

8 years agoMerge pull request #2689 from vargaz/socket-io-cleanup
Zoltan Varga [Sat, 27 Feb 2016 11:46:01 +0000 (06:46 -0500)]
Merge pull request #2689 from vargaz/socket-io-cleanup

[runtime] Clean up the socket-io.c file to use the mono coding conven…

8 years ago[runtime] Clean up the socket-io.c file to use the mono coding conventions. Rename...
Zoltan Varga [Sat, 27 Feb 2016 06:48:10 +0000 (01:48 -0500)]
[runtime] Clean up the socket-io.c file to use the mono coding conventions. Rename 'error' to 'werror' so 'error' can be used to refer to MonoError as everywhere else. NFC.

8 years agoMerge pull request #2688 from vargaz/marshal-set-pending
monojenkins [Sat, 27 Feb 2016 05:55:17 +0000 (05:55 +0000)]
Merge pull request #2688 from vargaz/marshal-set-pending

[runtime] Use pending exceptions instead of mono_raise_exception () i…

…n Marshal icalls.

8 years ago[runtime] Use pending exceptions instead of mono_raise_exception () in Marshal icalls.
Zoltan Varga [Sat, 27 Feb 2016 04:19:10 +0000 (23:19 -0500)]
[runtime] Use pending exceptions instead of mono_raise_exception () in Marshal icalls.