mono.git
7 years ago[msvc] Update csproj files (#4474)
monojenkins [Sat, 4 Mar 2017 21:52:47 +0000 (21:52 +0000)]
[msvc] Update csproj files (#4474)

7 years ago[metadata] Fix a possible crash when looking up a p/invoke function. (#4471)
Vincent Povirk [Sat, 4 Mar 2017 17:03:56 +0000 (11:03 -0600)]
[metadata] Fix a possible crash when looking up a p/invoke function. (#4471)

It's possible for two threads to modify the same MonoMethodPInvoke.addr
in mono_lookup_pinvoke_call, with one thread setting it to NULL inside the
loop, and the other thread having completed the loop and expecting it to
be non-NULL.

Use an intermediate variable to prevent addr becoming non-NULL.

7 years ago[corert] Import System.Threading.ThreadPoolBoundHandle
Ludovic Henry [Fri, 3 Mar 2017 15:39:29 +0000 (10:39 -0500)]
[corert] Import System.Threading.ThreadPoolBoundHandle

7 years ago[corert] Import System.Diagnostics.Debug
Ludovic Henry [Fri, 3 Mar 2017 13:59:38 +0000 (08:59 -0500)]
[corert] Import System.Diagnostics.Debug

7 years ago[System.Core] Collections from corefx
Marek Safar [Thu, 2 Mar 2017 15:47:05 +0000 (16:47 +0100)]
[System.Core] Collections from corefx

7 years ago[mono/tests] run the managed test runner using TOOLS_RUNTIME
Aleksey Kliger [Thu, 2 Mar 2017 19:08:04 +0000 (14:08 -0500)]
[mono/tests] run the managed test runner using TOOLS_RUNTIME

The test runner itself should use the tools runtime, but the AOT step and the
tests themselves will be launched in the profile that's being tested.

7 years ago[fullaot] configure.ac: pass --runtime=mobile to AOT_{BUILD,RUN}_FLAGS
Aleksey Kliger [Wed, 1 Mar 2017 20:59:55 +0000 (15:59 -0500)]
[fullaot] configure.ac: pass --runtime=mobile to AOT_{BUILD,RUN}_FLAGS

For the profiles where we compile the BCL with -d:MOBILE, (where the
`[assembly: AssemblyVersion (Consts.FxVersion)]` attribute ends up pointing to
the mobile version) make sure we AOT and run the tests using the mobile
runtime.  This ensures that for the framework assemblies the version number in
the assembly matches the version number that the internal runtime remapping (
`mono/metadata/assembly.c` `framework_assemblies` array)

7 years ago[threads] Remove ThreadState_StopRequested (#4462)
Ludovic Henry [Fri, 3 Mar 2017 02:26:00 +0000 (21:26 -0500)]
[threads] Remove ThreadState_StopRequested (#4462)

7 years ago[jit] Remove some duplicate declarations.
Zoltan Varga [Fri, 3 Mar 2017 00:45:10 +0000 (19:45 -0500)]
[jit] Remove some duplicate declarations.

7 years ago[jit] Fix MethodAccessExceptions, the caller and callee were switched. (#4465)
Zoltan Varga [Fri, 3 Mar 2017 00:21:08 +0000 (19:21 -0500)]
[jit] Fix MethodAccessExceptions, the caller and callee were switched. (#4465)

7 years ago[threads] Remove mono_threads_create_thread (#4411)
Ludovic Henry [Thu, 2 Mar 2017 23:47:41 +0000 (18:47 -0500)]
[threads] Remove mono_threads_create_thread (#4411)

7 years ago[runtime] Fix an infinite loop in the runtime class init code. (#4455)
Zoltan Varga [Thu, 2 Mar 2017 21:08:00 +0000 (16:08 -0500)]
[runtime] Fix an infinite loop in the runtime class init code. (#4455)

The following can happen:
* Thread T1 starts initialization of C1
* Thread T2 starts initialization of C2
* T2 starts initialization of C1, it gets blocked on T1.
* T1 finishes initializing C1.
* T1 starts initialization of C3.
* T1 starts initialization of C2. It sees that T2 is
  still blocked on T1, but its not actually blocked, since
  C1 is finished. Still, we record that T1 is blocked.
* T3 starts initialization of C2, it gets into an infinite
  loop in the while loop, since the blocked_thread_hash
  now indicates that T1 and T2 are blocked on each other.

The solution is to not mark a thread as blocked, if its waiting
for a thread which is waiting on a finished lock. Fixes hangs
when running csc.

7 years ago[threads] Remove dead field cached_culture_info (#4410)
Ludovic Henry [Thu, 2 Mar 2017 21:06:27 +0000 (16:06 -0500)]
[threads] Remove dead field cached_culture_info (#4410)

7 years agoFixes to build libmono with disabled JIT. (#4421)
Johan Lorensson [Thu, 2 Mar 2017 20:09:19 +0000 (21:09 +0100)]
Fixes to build libmono with disabled JIT. (#4421)

Current mono build on (at least Windows) fails if build with disabled JIT
since the .def file used when building libmono, mono-2.0-sgen.dll, exports
a couple of symbols missing when DISABLE_JIT is defined.

Turns out that these methods have been incorrectly exported and should not
be part of the public API surface. This commit removes MONO_API for the
methods incorrectly marked:

mono_emit_native_call
mono_inst_name
mono_replace_ins

It also removes them from the .def files so they won't be exported in the
mono runtime DLL on Windows.

For mono_set_break_policy an empty stub will be added since it is considered
being a public API.

The above support is primarily used on none desktop Windows platforms
when building mono runtime module without JIT support.

This commit also fix a problem introduced in tramp-amd64.c by commit
https://github.com/mono/mono/commit/4281399ba4b7c44a30fa2c2a314a470260bb3eb1
causing it to get duplicated definitions of mono_arch_get_enter_icall_trampoline
when DISABLE_JIT has been defined.

7 years agoMerge pull request #4454 from kumpera/allow_sioc_with_managed_impl
Rodrigo Kumpera [Thu, 2 Mar 2017 19:45:00 +0000 (14:45 -0500)]
Merge pull request #4454 from kumpera/allow_sioc_with_managed_impl

Allow banned assemblies with LoaderFrom

7 years agoFind more libraries via dllmap (#4451)
Nikolay Amiantov [Thu, 2 Mar 2017 19:28:07 +0000 (22:28 +0300)]
Find more libraries via dllmap (#4451)

This allows centralized configuration of library paths. For instance,
previously setting path to libgtk-x11-2.0 won't make all parts of Mono use
provided library.

7 years agoChange clock source to CLOCK_MONOTONIC in 'pthread_cond_timedwait'
powerctrl [Wed, 26 Oct 2016 15:43:29 +0000 (21:13 +0530)]
Change clock source to CLOCK_MONOTONIC in 'pthread_cond_timedwait'

 Wait functions for Mutex, Semaphore and Condition (like pthread_cond_timedwait) for 'task' synchronisation in Linux uses CLOCK_REALTIME by default,
this creates many problems where a process changes time. e.g. Command line utility < date -s "desired date and time" >
A thread may be blocked for a more\less time depending upon time change. It is always desirable to use clock source immune to such changes
However, it is not possible to change clock source for mutex and semaphore wait functions in Linux. So changing it for condition only

This can be seen by a simple application if you make a simple timer using System.Timers.Timer and print time stamp every regular interval say 2 seconds, now if time shifts in the system for whatever reason ( you can do this in Linux by <sudo date -s "Wed Oct 26 20:25:24 IST 2016"> put desired time in quotes), this print stops coming for the offset time duration.

The reason behind this is the call to 'pthread_cond_timedwait' function, by Timer class which uses it to sleep for timeout duration. Now this function uses CLOCK_REALTIME which can be changed, so if you change this clock, a thread will be blocked for the unexpected time. So using CLOCK_MONOTONIC removes the error.

There are many embedded systems which do not have RTC and rely upon the external time like systems using GPS or set top box. So this fix is inevitable for them, at least for condition variable wait.

This is the sample code
using System;
using System.Timers;

public class Example
{
private static System.Timers.Timer aTimer;

public static void Main()
{
SetTimer();

Console.WriteLine("\nPress the Enter key to exit the application...\n");
Console.WriteLine("The application started at {0:HH:mm:ss.fff}", DateTime.Now);
Console.ReadLine();
aTimer.Stop();
aTimer.Dispose();

Console.WriteLine("Terminating the application...");
}

private static void SetTimer()
{
// Create a timer with a two second interval.
aTimer = new System.Timers.Timer(2000);
// Hook up the Elapsed event for the timer.
//((System.ComponentModel.ISupportInitialize)(aTimer)).BeginInit();
aTimer.Elapsed += OnTimedEvent;
//((System.ComponentModel.ISupportInitialize)(aTimer)).EndInit();
aTimer.AutoReset = true;
aTimer.Enabled = true;
}

private static void OnTimedEvent(Object source, ElapsedEventArgs e)
{
Console.WriteLine("__The Elapsed event was raised at {0:HH:mm:ss.fff}",
                  e.SignalTime);
}
}

This updates and merge https://github.com/mono/mono/pull/3828

7 years ago[msvc] Update csproj files (#4461)
monojenkins [Thu, 2 Mar 2017 17:55:37 +0000 (17:55 +0000)]
[msvc] Update csproj files (#4461)

7 years agoBump cecil
Marek Safar [Wed, 1 Mar 2017 14:13:28 +0000 (15:13 +0100)]
Bump cecil

7 years ago[threads] Remove mono_threads_suspend_needs_abort_syscall (#4450)
Ludovic Henry [Thu, 2 Mar 2017 14:55:31 +0000 (09:55 -0500)]
[threads] Remove mono_threads_suspend_needs_abort_syscall (#4450)

7 years ago[runtime] Cleanup the debugger header files. (#4459)
Zoltan Varga [Thu, 2 Mar 2017 11:22:06 +0000 (06:22 -0500)]
[runtime] Cleanup the debugger header files. (#4459)

* Rename debug-mono-debugger.h to debug-internals.h.
* Move the internal debug structures to debug-internals.h from debug-mono-symfile.h.

7 years agoMerge pull request #4418 from kumpera/fix_gclass_recording_on_failure
Rodrigo Kumpera [Wed, 1 Mar 2017 23:15:56 +0000 (18:15 -0500)]
Merge pull request #4418 from kumpera/fix_gclass_recording_on_failure

[loader] When loading the parent of a GTD fails. We must disable gclass recording for it.

7 years ago[runtime] Use mono_debug_method_lookup_location () instead of mono_debug_symfile_look...
Zoltan Varga [Wed, 1 Mar 2017 23:05:51 +0000 (18:05 -0500)]
[runtime] Use mono_debug_method_lookup_location () instead of mono_debug_symfile_lookup_location (), the latter doesn't support portable pdb files. Use mono_debug_free_source_location () for freeing. Fixes #52899. (#4457)

7 years ago[corlib][System] Concurrent collections from corefx
Marek Safar [Tue, 28 Feb 2017 16:51:03 +0000 (17:51 +0100)]
[corlib][System] Concurrent collections from corefx

7 years ago[threads] Remove unused mono_thread_internal_stop (#4449)
Ludovic Henry [Wed, 1 Mar 2017 19:19:58 +0000 (14:19 -0500)]
[threads] Remove unused mono_thread_internal_stop (#4449)

7 years ago[loader] Revert allowing SIOC 4.3. This is fine for now as we support LoadFrom as...
Rodrigo Kumpera [Wed, 1 Mar 2017 18:34:47 +0000 (10:34 -0800)]
[loader] Revert allowing SIOC 4.3. This is fine for now as we support LoadFrom as a work-around.

7 years ago[loader] Pass LoadFrom down to image loading so we can make decisions based on that.
Rodrigo Kumpera [Wed, 1 Mar 2017 18:17:32 +0000 (10:17 -0800)]
[loader] Pass LoadFrom down to image loading so we can make decisions based on that.

7 years agoPass LoadFrom info down to assembly loading.
Rodrigo Kumpera [Wed, 1 Mar 2017 17:48:33 +0000 (09:48 -0800)]
Pass LoadFrom info down to assembly loading.

7 years agoMerge pull request #4373 from NattyNarwhal/haiku
Rodrigo Kumpera [Wed, 1 Mar 2017 17:08:38 +0000 (12:08 -0500)]
Merge pull request #4373 from NattyNarwhal/haiku

Restore Haiku support

7 years ago[runtime] SIOC 4.3.0 has a managed impl that works under mono. Don't ignore it.
Rodrigo Kumpera [Wed, 1 Mar 2017 00:27:40 +0000 (16:27 -0800)]
[runtime] SIOC 4.3.0 has a managed impl that works under mono. Don't ignore it.

7 years ago[tools] Update nuget hash extractor so we don't block SIOC 4.3.0.
Rodrigo Kumpera [Wed, 1 Mar 2017 00:27:14 +0000 (16:27 -0800)]
[tools] Update nuget hash extractor so we don't block SIOC 4.3.0.

7 years ago[interpreter] rename interpreter to interp
Bernhard Urban [Mon, 27 Feb 2017 16:55:55 +0000 (17:55 +0100)]
[interpreter] rename interpreter to interp

for folks without autocompletion :P

7 years ago[generics.cs] enable more testcases for interpreter
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[generics.cs] enable more testcases for interpreter

7 years ago[interpreter] use explicit addressing for stack slots
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[interpreter] use explicit addressing for stack slots

7 years ago[interpreter] add basic-vectors.cs to richeck target
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[interpreter] add basic-vectors.cs to richeck target

7 years ago[interpreter] add {exceptions,devirtualization,basic-simd}.cs to richeck target
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[interpreter] add {exceptions,devirtualization,basic-simd}.cs to richeck target

7 years ago[interpreter] add floating point support to icall trampoline, add basic-math.cs to...
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[interpreter] add floating point support to icall trampoline, add basic-math.cs to richeck target

7 years ago[interpreter] add arrays.cs to richeck target
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[interpreter] add arrays.cs to richeck target

7 years ago[objects.cs] enable last two remaining tests for interpreter
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[objects.cs] enable last two remaining tests for interpreter

\o/

7 years ago[interpreter] fix array built-ins wrt. multiarray access
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[interpreter] fix array built-ins wrt. multiarray access

7 years ago[interpreter] fix metadata access for ldtoken insn in wrappers
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[interpreter] fix metadata access for ldtoken insn in wrappers

7 years ago[interpreter] implement ref type for ldelem bytecode
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[interpreter] implement ref type for ldelem bytecode

7 years ago[interpreter] install stack walking callback
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[interpreter] install stack walking callback

7 years ago[interpreter] it can happen that we have the address of a enum on the stack, and...
Bernhard Urban [Mon, 27 Feb 2017 16:55:54 +0000 (17:55 +0100)]
[interpreter] it can happen that we have the address of a enum on the stack, and we need to dereference it before we box it.

7 years ago[interpreter] allow generic inst type in icall trampoline
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[interpreter] allow generic inst type in icall trampoline

7 years ago[interpreter] if unboxing is required on virtcall, point into object instead of copying
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[interpreter] if unboxing is required on virtcall, point into object instead of copying

7 years ago[generics.cs] test calling an interface, that's implemented by a generic value type
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[generics.cs] test calling an interface, that's implemented by a generic value type

7 years ago[interpreter] properly inflate method on generic virtual call
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[interpreter] properly inflate method on generic virtual call

7 years ago[interpreter] inflate method signature for delegate.invoke ()
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[interpreter] inflate method signature for delegate.invoke ()

7 years ago[interpreter] inflate signature for calli with proper generic_context
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[interpreter] inflate signature for calli with proper generic_context

7 years ago[object/interpreter] add trap for future pitfalls
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[object/interpreter] add trap for future pitfalls

7 years ago[interpreter] add init_delegate callback
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[interpreter] add init_delegate callback

and set `method` field in delegate

7 years ago[interpreter] use jit icall for delegate ctor
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[interpreter] use jit icall for delegate ctor

7 years ago[trampolines] make sure no delegate trampoline is created in interpreter mode
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[trampolines] make sure no delegate trampoline is created in interpreter mode

7 years ago[objects.cs] testcase for delegate with instance method that uses `this'
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[objects.cs] testcase for delegate with instance method that uses `this'

7 years ago[interpreter] pop extra arg in CEE_MONO_CALLI_EXTRA_ARG
Bernhard Urban [Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)]
[interpreter] pop extra arg in CEE_MONO_CALLI_EXTRA_ARG

7 years agoMerge pull request #4440 from kumpera/fix-assembly-remapping
Rodrigo Kumpera [Tue, 28 Feb 2017 20:23:26 +0000 (12:23 -0800)]
Merge pull request #4440 from kumpera/fix-assembly-remapping

[runtime] Fix assembly remapping by using a hashtable. Fixes #52846 and #52743

7 years ago[msvc] Update csproj files
monojenkins [Tue, 28 Feb 2017 16:29:34 +0000 (16:29 +0000)]
[msvc] Update csproj files

7 years agoMerge pull request #4381 from BrzVlad/feature-generational-hash
Vlad Brezae [Tue, 28 Feb 2017 12:30:18 +0000 (14:30 +0200)]
Merge pull request #4381 from BrzVlad/feature-generational-hash

[sgen] Generational MonoGHashTable

7 years ago[runtime] Fix assembly remapping by using a hashtable. Fixes #52846 and #52743
Rodrigo Kumpera [Tue, 28 Feb 2017 00:46:00 +0000 (16:46 -0800)]
[runtime] Fix assembly remapping by using a hashtable. Fixes #52846 and #52743

In multiple occasions we had bugs due to framework_assemblies not being correctly sorted.

Instead of just fixing the ordering again, I'm moving it a hashtable so future generations won't have to fix this for System.SpaceTravel.dll.

7 years ago[System] Add regression test for Bugzilla 10899 (#4401)
Alexander Köplinger [Mon, 27 Feb 2017 22:43:56 +0000 (23:43 +0100)]
[System] Add regression test for Bugzilla 10899 (#4401)

Even though I couldn't repro the bug I thought it'd still be a
good idea to at least add some basic coverage with non-Latin chars.

7 years agoMerge pull request #4438 from xmcclure/monodis-fix
Andi McClure [Mon, 27 Feb 2017 21:00:48 +0000 (16:00 -0500)]
Merge pull request #4438 from xmcclure/monodis-fix

Fix monodis

7 years agoFix monodis
Andi McClure [Mon, 27 Feb 2017 20:54:05 +0000 (15:54 -0500)]
Fix monodis

monodis was not calling the mono_tls_init_runtime_keys function, which
was causing it to crash the first time it attempted to access the
current domain (ie almost immediately).

7 years agoMerge pull request #4433 from kumpera/android-fixes
Rodrigo Kumpera [Mon, 27 Feb 2017 20:46:03 +0000 (15:46 -0500)]
Merge pull request #4433 from kumpera/android-fixes

Fix a few issues on Android

7 years ago[jit] Rewrite some logging to work on embedded systems.
Rodrigo Kumpera [Sat, 25 Feb 2017 00:14:16 +0000 (16:14 -0800)]
[jit] Rewrite some logging to work on embedded systems.

7 years ago[jit] Fix LMF codegen on android arm64.
Rodrigo Kumpera [Sat, 25 Feb 2017 00:09:56 +0000 (16:09 -0800)]
[jit] Fix LMF codegen on android arm64.

Android doesn't have fast tls either, so we must use the jit_tls variant.

7 years ago[alias-analysis] Ignore addresses taken of volatile variables.
Rodrigo Kumpera [Fri, 24 Feb 2017 23:52:03 +0000 (15:52 -0800)]
[alias-analysis] Ignore addresses taken of volatile variables.

Volatile variables should be ignored by AA as, by design, we can't
properly tell whether removing indirection is safe or not.

This shows up when handling the LMF var in some cases.

7 years ago[runtime] Mark mono_error_init external only. (#4437)
Aleksey Kliger (λgeek) [Mon, 27 Feb 2017 20:08:48 +0000 (15:08 -0500)]
[runtime] Mark mono_error_init external only. (#4437)

Runtime should use the error_init() from mono/utils/mono-error-internals.h

7 years agoMerge pull request #4434 from BrzVlad/fix-unload-hang
Vlad Brezae [Mon, 27 Feb 2017 20:05:27 +0000 (22:05 +0200)]
Merge pull request #4434 from BrzVlad/fix-unload-hang

[threads] Don't ignore abort requests in abort protected blocks

7 years agoUpdate ms-test-suite
Marek Safar [Mon, 27 Feb 2017 13:42:10 +0000 (14:42 +0100)]
Update ms-test-suite

7 years ago[System.Numerics] Use corefx implementation
Marek Safar [Fri, 24 Feb 2017 14:13:26 +0000 (15:13 +0100)]
[System.Numerics] Use corefx implementation

7 years agoMerge pull request #4431 from vkargov/vk-leaking-points
Rodrigo Kumpera [Mon, 27 Feb 2017 16:34:02 +0000 (11:34 -0500)]
Merge pull request #4431 from vkargov/vk-leaking-points

[runtime] Fix memory leak in mono_save_seq_point_info().

7 years agoHaiku hrev50954 makes this ifdef unnecessary
Calvin [Thu, 16 Feb 2017 16:36:32 +0000 (12:36 -0400)]
Haiku hrev50954 makes this ifdef unnecessary

7 years agoMore proper detection of reset_priority, make stub for Haiku
Calvin [Wed, 15 Feb 2017 04:25:34 +0000 (00:25 -0400)]
More proper detection of reset_priority, make stub for Haiku

7 years agoFix eglibc configure script on Haiku
Calvin [Tue, 14 Feb 2017 23:30:52 +0000 (19:30 -0400)]
Fix eglibc configure script on Haiku

Now properly recognizes -ltextencoding

7 years agoImprove build and configure
Calvin [Tue, 14 Feb 2017 23:05:31 +0000 (19:05 -0400)]
Improve build and configure

* detect sys/errno.h

* Fix errenous LIBS in haiku

* use HAVE_MINCORE

7 years agoPolish on configure script
Calvin [Tue, 14 Feb 2017 17:07:52 +0000 (13:07 -0400)]
Polish on configure script

* Set boehm to disabled

* Set threading to use pthreads, not __thread
  (causes static TLS issues)

* Add the library needs for locale
  (FIXME: does this apply to eglib?)

7 years agoGet Mono running further on Haiku by fixing proclib/threads
Calvin [Mon, 13 Feb 2017 17:58:05 +0000 (13:58 -0400)]
Get Mono running further on Haiku by fixing proclib/threads

* proclib: Adapted Andreas' code to the refactored proclib.
  Allocates ahead of time.

* threads: pthread_setschedparam is semantically different on Haiku,
  because it returns positive numbers on success. Handle this
  difference.

With these changes, Mono can now get to the point Roslyn runs, and
fails immediately due to lack of stack walking.

7 years agoGet support libraries compiling
Calvin [Mon, 13 Feb 2017 01:56:09 +0000 (21:56 -0400)]
Get support libraries compiling

These return no-ops, but its enough to make it happy

7 years agoRestore Haiku support
Calvin [Mon, 13 Feb 2017 01:14:12 +0000 (21:14 -0400)]
Restore Haiku support

Much of the code was bitrotting as refactors were done. With this,
mono-sgen can be compiled. Code in support/ is still broken,
however. The compiled binary hasn't been tested yet as a result.

Run configure as: LIBS=-ltextencoding ./configure --disable-boehm

boehm looks to be a mess to port and diverged from upstream making
integration of Haiku support difficult. For now, SGen should be OK.

7 years ago[threads] Don't ignore abort requests in abort protected blocks
Vlad Brezae [Sat, 25 Feb 2017 00:59:14 +0000 (02:59 +0200)]
[threads] Don't ignore abort requests in abort protected blocks

Either interrupt or set the interrupt_deferred flag, so the thread can handle the request later in the future. Otherwise we are left with a thread that has an AbortRequested set on its state that it is never processed and future abort requests are ignored due to the presence of this flag.

7 years ago[runtime] Fix memory leak in mono_save_seq_point_info().
Vladimir Kargov [Fri, 24 Feb 2017 21:43:44 +0000 (13:43 -0800)]
[runtime] Fix memory leak in mono_save_seq_point_info().

7 years ago[runtime] Speed up mono_icall_start()/mono_icall_end() a bit by using inline versions...
Zoltan Varga [Fri, 24 Feb 2017 17:16:15 +0000 (12:16 -0500)]
[runtime] Speed up mono_icall_start()/mono_icall_end() a bit by using inline versions of the MonoError functions. (#4424)

7 years ago[runtime] Call error_init instead of mono_error_init (#4425)
Aleksey Kliger (λgeek) [Fri, 24 Feb 2017 17:15:33 +0000 (12:15 -0500)]
[runtime] Call error_init instead of mono_error_init (#4425)

Use the error_init macro instead of the mono_error_init function to avoid the
function call overhead.

7 years ago[runtime] Add fastpaths to the stelem wrappers for the case when the array element...
Zoltan Varga [Fri, 24 Feb 2017 16:24:31 +0000 (11:24 -0500)]
[runtime] Add fastpaths to the stelem wrappers for the case when the array element type and the value type are the same. (#4427)

7 years ago[Mono.Data.Sqlite] Add test for b78f4f6e5f21edb07d58e012b0339253c593894a
Marek Safar [Fri, 24 Feb 2017 15:31:54 +0000 (16:31 +0100)]
[Mono.Data.Sqlite] Add test for b78f4f6e5f21edb07d58e012b0339253c593894a

7 years ago[Mono.Data.Sqlite] Change default datetime convert format to excluded datetime kind...
Marek Safar [Fri, 24 Feb 2017 15:18:15 +0000 (16:18 +0100)]
[Mono.Data.Sqlite] Change default datetime convert format to excluded datetime kind. Fixes #46929

7 years agoRevert "[Facades] Build netstandard.dll with net_4_x profile by default"
Alexander Köplinger [Fri, 24 Feb 2017 13:27:27 +0000 (14:27 +0100)]
Revert "[Facades] Build netstandard.dll with net_4_x profile by default"

It broke the build.

7 years ago[threads] Fix async call in coop (#4423)
Ludovic Henry [Fri, 24 Feb 2017 13:19:10 +0000 (08:19 -0500)]
[threads] Fix async call in coop (#4423)

We would observe crashes like the following:

```
 * Assertion at mono-threads.c:1009, condition `mono_thread_info_run_state (info) == STATE_ASYNC_SUSPENDED' not met

 Debug info from gdb:

 [New LWP 26793]
 [New LWP 26792]
 [Thread debugging using libthread_db enabled]
 Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
 0x00002b0ff3481ee9 in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0
   Id   Target Id         Frame
   3    Thread 0x2b0ff3e6c700 (LWP 26792) "SGen worker" 0x00002b0ff347e414 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
   2    Thread 0x2b0ff633e700 (LWP 26793) "Finalizer" 0x00002b0ff347e414 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
 * 1    Thread 0x2b0ff2b67c40 (LWP 26780) "mono" 0x00002b0ff3481ee9 in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0

 Thread 3 (Thread 0x2b0ff3e6c700 (LWP 26792)):
 #0  0x00002b0ff347e414 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
 #1  0x0000000000661bdf in mono_os_cond_wait (mutex=0x9dee40 <lock>, cond=0x9dee00 <work_cond>) at ../../mono/utils/mono-os-mutex.h:146
 #2  thread_func (thread_data=0x2b0ff2bcb008) at sgen-thread-pool.c:129
 #3  0x00002b0ff347a182 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
 #4  0x00002b0ff39a130d in clone () from /lib/x86_64-linux-gnu/libc.so.6

 Thread 2 (Thread 0x2b0ff633e700 (LWP 26793)):
 #0  0x00002b0ff347e414 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
 #1  0x00000000005caff3 in mono_os_cond_wait (mutex=<optimized out>, cond=<optimized out>) at ../../mono/utils/mono-os-mutex.h:146
 #2  mono_coop_cond_wait (mutex=<optimized out>, cond=<optimized out>) at ../../mono/utils/mono-coop-mutex.h:87
 #3  mono_threadpool_io_remove_socket (fd=134239440) at threadpool-io.c:628
 #4  0x00000000005ae4f4 in ves_icall_System_Net_Sockets_Socket_Close_internal (sock=42, werror=<optimized out>) at w32socket.c:708
 #5  0x0000000041e8101f in ?? ()
 #6  0x00002b1014abe070 in ?? ()
 #7  0x0000000001615860 in ?? ()
 #8  0x0000000001615860 in ?? ()
 #9  0x0000000000000000 in ?? ()

 Thread 1 (Thread 0x2b0ff2b67c40 (LWP 26780)):
 #0  0x00002b0ff3481ee9 in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0
 #1  0x00000000004ac5e6 in mono_handle_native_crash (signal=<optimized out>, ctx=<optimized out>, info=<optimized out>) at mini-exceptions.c:2557
 #2  <signal handler called>
 #3  0x00002b0ff38dcf79 in raise () from /lib/x86_64-linux-gnu/libc.so.6
 #4  0x00002b0ff38e0388 in abort () from /lib/x86_64-linux-gnu/libc.so.6
 #5  0x000000000066b459 in mono_log_write_logfile (log_domain=<optimized out>, level=<optimized out>, hdr=<optimized out>, message=<optimized out>) at mono-log-common.c:137
 #6  0x00000000006805e0 in monoeg_g_logv (log_domain=log_domain@entry=0x0, log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=<optimized out>, args=args@entry=0x7ffc7324ea78) at goutput.c:115
 #7  0x0000000000680736 in monoeg_assertion_message (format=<optimized out>) at goutput.c:135
 #8  0x00000000006759b8 in mono_thread_info_setup_async_call (info=info@entry=0x2b0ff80008c0, target_func=target_func@entry=0x5bac20 <suspend_for_shutdown_async_call>, user_data=user_data@entry=0x0) at mono-threads.c:1009
 #9  0x00000000005bad50 in suspend_for_shutdown_critical (info=info@entry=0x2b0ff80008c0, unused=unused@entry=0x0) at threads.c:5019
 #10 0x00000000006763ae in mono_thread_info_safe_suspend_and_run (id=47347555100416, interrupt_kernel=interrupt_kernel@entry=0, callback=callback@entry=0x5bad40 <suspend_for_shutdown_critical>, user_data=user_data@entry=0x0) at mono-threads.c:979
 #11 0x00000000005c2e71 in mono_thread_internal_suspend_for_shutdown (thread=<optimized out>) at threads.c:5028
 #12 0x00000000005e9100 in mono_gc_cleanup () at gc.c:1015
 #13 0x00000000005e108e in mono_runtime_cleanup (domain=domain@entry=0x1615860) at appdomain.c:423
 #14 0x00000000004228cb in mini_cleanup (domain=0x1615860) at mini-runtime.c:4111
 #15 0x000000000047b99f in mono_main (argc=10, argv=<optimized out>) at driver.c:2167
 #16 0x00000000004200db in mono_main_with_options (argv=0x7ffc7324ef68, argc=10) at main.c:45
 #17 main (argc=10, argv=0x7ffc7324ef68) at main.c:338

 =================================================================
 Got a SIGABRT while executing native code. This usually indicates
 a fatal error in the mono runtime or one of the native libraries
 used by your application.
 =================================================================
```

7 years ago[hybrid] Fix more tests run
Ludovic Henry [Thu, 23 Feb 2017 23:23:00 +0000 (18:23 -0500)]
[hybrid] Fix more tests run

7 years ago[hybrid] Enable COM, Remoting and AppDomains runtime support
Ludovic Henry [Thu, 23 Feb 2017 23:22:22 +0000 (18:22 -0500)]
[hybrid] Enable COM, Remoting and AppDomains runtime support

7 years ago[Facades] Build netstandard.dll with net_4_x profile by default
Alexander Köplinger [Fri, 24 Feb 2017 11:53:10 +0000 (12:53 +0100)]
[Facades] Build netstandard.dll with net_4_x profile by default

7 years ago[mcs] Update 995e5620fb79f62c22f94c87cc6d5b717b84eff2 to do actual comparison
Marek Safar [Fri, 24 Feb 2017 08:59:39 +0000 (09:59 +0100)]
[mcs] Update 995e5620fb79f62c22f94c87cc6d5b717b84eff2 to do actual comparison

7 years ago[msvc] Update csproj files
monojenkins [Thu, 23 Feb 2017 16:57:08 +0000 (16:57 +0000)]
[msvc] Update csproj files

7 years ago[jit] Remove an #ifdef ENABLE_LLVM from mini-os.h, the cross-compile genmdesc.pl...
Zoltan Varga [Thu, 23 Feb 2017 22:26:46 +0000 (17:26 -0500)]
[jit] Remove an #ifdef ENABLE_LLVM from mini-os.h, the cross-compile genmdesc.pl can't handle it.

7 years agoMerge pull request #4419 from BrzVlad/fix-oom-nre
Rodrigo Kumpera [Thu, 23 Feb 2017 21:14:23 +0000 (13:14 -0800)]
Merge pull request #4419 from BrzVlad/fix-oom-nre

[sgen] Fix oom nre

7 years ago[linker] Update the mscorlib descriptor with missing generic interfaces.
Zoltan Varga [Thu, 23 Feb 2017 20:37:15 +0000 (15:37 -0500)]
[linker] Update the mscorlib descriptor with missing generic interfaces.

7 years agoUpdate Bockbuild
Alexis Christoforides [Thu, 23 Feb 2017 20:13:05 +0000 (15:13 -0500)]
Update Bockbuild

7 years agoForce LF line endings for .sources and Makefiles too
Alexander Köplinger [Thu, 23 Feb 2017 15:11:40 +0000 (16:11 +0100)]
Force LF line endings for .sources and Makefiles too

This should fix the Windows build.

7 years ago[mcs] Use correct types comparer for comparing hidden imported interface members...
Marek Safar [Thu, 23 Feb 2017 15:09:13 +0000 (16:09 +0100)]
[mcs] Use correct types comparer for comparing hidden imported interface members. Fixes #51522