mono.git
6 years ago[w32handle] Fix deadlock on SignalAndWait (#4973)
Ludovic Henry [Mon, 5 Jun 2017 22:07:40 +0000 (18:07 -0400)]
[w32handle] Fix deadlock on SignalAndWait (#4973)

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

6 years agoMerge pull request #4962 from lambdageek/dev-handles-sockets
Aleksey Kliger (λgeek) [Mon, 5 Jun 2017 21:50:30 +0000 (17:50 -0400)]
Merge pull request #4962 from lambdageek/dev-handles-sockets

[w32socket] Use coop handles for many Socket icalls

6 years ago[w32socket] Use coop handles for System.Net.Sockets.Socket.cancel_blocking_socket_ope...
Aleksey Kliger [Fri, 2 Jun 2017 19:16:31 +0000 (15:16 -0400)]
[w32socket] Use coop handles for System.Net.Sockets.Socket.cancel_blocking_socket_operation

6 years ago[coop handles] Add mono_internal_thread_handle_ptr () function
Aleksey Kliger [Fri, 2 Jun 2017 20:11:42 +0000 (16:11 -0400)]
[coop handles] Add mono_internal_thread_handle_ptr () function

MonoInternalThreadHandle is not really needed - all MonoInternalThread
instances are supposed to be pinned.  But for uniformity, the icall marshaller
makes handles anyway.  This function lets us get back to a raw ptr.

6 years ago[runtime] typedef MonoThread MonoThreadObject
Aleksey Kliger [Fri, 2 Jun 2017 19:03:38 +0000 (15:03 -0400)]
[runtime] typedef MonoThread MonoThreadObject

MonoThreadHandle is already taken.  So define MonoThreadObject as an alias for
MonoThread and then make MonoThreadObjectHandle the coop handle type.

6 years ago[w32socket] Use coop handles for icalls in System.Net.Sockets.Socket
Aleksey Kliger [Tue, 30 May 2017 19:58:51 +0000 (15:58 -0400)]
[w32socket] Use coop handles for icalls in System.Net.Sockets.Socket

- Use coop handles for create_object_from_sockaddr

  Eventually want to rewrite its callers to use
  create_object_handle_from_sockaddr directly.

- Use coop handles for

  - LocalEndPoint_internal

  - RemoteEndPoint_internal

- inside create_sockaddr_from_object

  Eventually callers should be updated to use create_sockaddr_form_handle
  directly.

- Use coop handles for

  - ReceiveFrom_internal

  - Bind_internal

  - Connect_internal

  - SendTo_internal

- Remove dead code (create_object_from_sockaddr, create_sockaddr_from_object)

- Use coop handles for

  - Receive_internal WSABUF[]

  - Receive_internal byte[]

  - Send_internal

  - Send_array_internal

  - SetSocketOption_internal

  - GetSocketOption_arr_internal

  - GetSocketOption_obj_internal

  - IOControl_internal

  - SendFile_internal

- Remove more dead code

- Use coop handles for

  - Socket_internal

  - Select_internal

- Trivial coop handles conversion for several icalls in System.Net.Sockets.Socket

  None of these functions use managed objects, so just add a MonoError* argument.

6 years ago[coop handles] Define MonoSafeHandleHandle
Aleksey Kliger [Thu, 1 Jun 2017 17:21:57 +0000 (13:21 -0400)]
[coop handles] Define MonoSafeHandleHandle

Used to access System.Net.Sockets.SafeSocketHandle from native code

6 years ago[coop handles] Macros to access a handle via a MonoClassField
Aleksey Kliger [Wed, 31 May 2017 20:02:53 +0000 (16:02 -0400)]
[coop handles] Macros to access a handle via a MonoClassField

6 years ago[marshal] Wrap byref reference args to icalls in coop handles correctly.
Aleksey Kliger [Wed, 31 May 2017 14:30:09 +0000 (10:30 -0400)]
[marshal] Wrap byref reference args to icalls in coop handles correctly.

Previously we only had "out" reference args working - they get a handle that's
initialized to NULL on entry and then writes back to the out arg on icall
return.

For "ref" reference args, do the same thing but initialize to the initial
argument value.

6 years ago[mcs] Remove unwanted tests
Marek Safar [Mon, 5 Jun 2017 18:53:24 +0000 (20:53 +0200)]
[mcs] Remove unwanted tests

6 years agoBump to 5.5 for master branch
Ludovic Henry [Mon, 5 Jun 2017 15:29:28 +0000 (11:29 -0400)]
Bump to 5.5 for master branch

6 years agoRevert "[marshal] delay dummy string allocation"
Alexander Köplinger [Mon, 5 Jun 2017 14:34:24 +0000 (16:34 +0200)]
Revert "[marshal] delay dummy string allocation"

Reverts 5e23a773b4b41163d4a0834e5f1c79305b903795

It seems to cause a crash during msbuild tests:

```
  xunit -> Microsoft.Build.Engine.UnitTests...
  Stacktrace:

  Native stacktrace:

   0   mono                                0x0017cad4 mono_handle_native_crash + 308
   1   mono                                0x001e2b03 sigabrt_signal_handler + 147
   2   libsystem_platform.dylib            0x920a8deb _sigtramp + 43
   3   ???                                 0xffffffff 0x0 + 4294967295
   4   libsystem_c.dylib                   0x940bb27c abort + 155
   5   mono                                0x0036886d mono_log_write_logfile + 381
   6   mono                                0x003630d2 structured_log_adapter + 50
   7   mono                                0x00380d1b monoeg_assertion_message + 107
   8   mono                                0x0033863d major_scan_object_with_evacuation + 3373
   9   mono                                0x0033b3d0 drain_gray_stack + 6608
   10  mono                                0x0032df57 finish_gray_stack + 151
   11  mono                                0x0032d3c6 major_finish_collection + 118
   12  mono                                0x00329909 major_do_collection + 169
   13  mono                                0x003288bd sgen_perform_collection + 605
   14  mono                                0x0032a90b sgen_gc_collect + 75
   15  mono                                0x002d5c4d unload_thread_main + 861
   16  mono                                0x002abb6b start_wrapper + 795
   17  libsystem_pthread.dylib             0x9ae6d5fb _pthread_body + 144
   18  libsystem_pthread.dylib             0x9ae6d485 _pthread_struct_init + 0
   19  libsystem_pthread.dylib             0x9ae72cf2 thread_start + 34

  Debug info from gdb:

  (lldb) command source -s 0 '/tmp/mono-gdb-commands.2tso9f'
  Executing commands in '/tmp/mono-gdb-commands.2tso9f'.
  (lldb) process attach --pid 2037
  2017-06-02 13:07:23.000 lldb[2093:282f] Metadata.framework [Error]: couldn't get the client port
  Process 2037 stopped
  * thread #1, name = 'tid_507', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
  libsystem_kernel.dylib`__psynch_cvwait:
  ->  0x923cc7ca <+10>: jae    0x923cc7da                ; <+26>
      0x923cc7cc <+12>: calll  0x923cc7d1                ; <+17>
      0x923cc7d1 <+17>: popl   %edx
      0x923cc7d2 <+18>: movl   0xe0b084f(%edx), %edx

  Executable module set to "/Users/builder/data/lanes/2716/mono-mac-sdk/external/bockbuild/stage/bin/mono".
  Architecture set to: i386-apple-macosx.
  (lldb) thread list
  Process 2037 stopped
  * thread #1: tid = 0x530e96a, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'tid_507', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    thread #2: tid = 0x530e96b, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
    thread #3: tid = 0x530e96c, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
    thread #4: tid = 0x530e96d, 0x923c7fb6 libsystem_kernel.dylib`semaphore_wait_trap + 10, name = 'Finalizer'
    thread #5: tid = 0x530e96e, 0x923cd992 libsystem_kernel.dylib`kevent64 + 10, queue = 'com.apple.libdispatch-manager'
    thread #6: tid = 0x530ea26, 0x923ccace libsystem_kernel.dylib`__select + 10, name = 'tid_5a03'
    thread #7: tid = 0x530edf1, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'tid_4007'
    thread #8: tid = 0x530edf2, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    thread #9: tid = 0x530edf3, 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    thread #10: tid = 0x530edf4, 0x923ccff2 libsystem_kernel.dylib`__wait4 + 10, name = 'Domain unloader'
  (lldb) thread backtrace all
  * thread #1, name = 'tid_507', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    * frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71bd9 libsystem_pthread.dylib`pthread_cond_wait$UNIX2003 + 71
      frame #3: 0x00361ea9 mono`mono_os_event_wait_multiple + 505
      frame #4: 0x00361ca5 mono`mono_os_event_wait_one + 53
      frame #5: 0x00376b49 mono`mono_thread_info_wait_one_handle + 41
      frame #6: 0x002d51b5 mono`mono_domain_try_unload + 485
      frame #7: 0x002d4f6a mono`ves_icall_System_AppDomain_InternalUnload + 90
      frame #8: 0x05bf9ee0
      frame #9: 0x018ce01d mscorlib.dll.dylib`System_AppDomain_Unload_System_AppDomain + 45
      frame #10: 0x05bf9d60
      frame #11: 0x05bf9ccc
      frame #12: 0x05bf9d04
      frame #13: 0x05bf9c90
      frame #14: 0x05bf996d
      frame #15: 0x02e7d171
      frame #16: 0x005c26d4
      frame #17: 0x005b6878
      frame #18: 0x005b6b7a
      frame #19: 0x000c38a8 mono`mono_jit_runtime_invoke + 1592
      frame #20: 0x002e43fe mono`do_runtime_invoke + 94
      frame #21: 0x002e7de3 mono`do_exec_main_checked + 147
      frame #22: 0x002e69a5 mono`mono_runtime_run_main_checked + 69
      frame #23: 0x0013b687 mono`mono_jit_exec + 311
      frame #24: 0x0013e2b2 mono`mono_main + 10114
      frame #25: 0x000b22db mono`main + 2011
      frame #26: 0x000b1af5 mono`start + 53
    thread #2, name = 'SGen worker'
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71bd9 libsystem_pthread.dylib`pthread_cond_wait$UNIX2003 + 71
      frame #3: 0x0035f0e9 mono`thread_func + 249
      frame #4: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #5: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #6: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #3, name = 'SGen worker'
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71bd9 libsystem_pthread.dylib`pthread_cond_wait$UNIX2003 + 71
      frame #3: 0x0035f0e9 mono`thread_func + 249
      frame #4: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #5: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #6: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #4, name = 'Finalizer'
      frame #0: 0x923c7fb6 libsystem_kernel.dylib`semaphore_wait_trap + 10
      frame #1: 0x002dbeb6 mono`finalizer_thread + 278
      frame #2: 0x002abb6b mono`start_wrapper + 795
      frame #3: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #4: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #5: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #5, queue = 'com.apple.libdispatch-manager'
      frame #0: 0x923cd992 libsystem_kernel.dylib`kevent64 + 10
      frame #1: 0x91b5c899 libdispatch.dylib`_dispatch_mgr_invoke + 238
      frame #2: 0x91b5c532 libdispatch.dylib`_dispatch_mgr_thread + 52
    thread #6, name = 'tid_5a03'
      frame #0: 0x923ccace libsystem_kernel.dylib`__select + 10
      frame #1: 0x0036df29 mono`mono_poll + 409
      frame #2: 0x002b482f mono`poll_event_wait + 111
      frame #3: 0x002b345f mono`selector_thread + 1439
      frame #4: 0x002abb6b mono`start_wrapper + 795
      frame #5: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #6: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #7: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #7, name = 'tid_4007'
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71c25 libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
      frame #3: 0x003760f3 mono`mono_thread_info_sleep + 979
      frame #4: 0x002b1a86 mono`monitor_thread + 262
      frame #5: 0x002abb6b mono`start_wrapper + 795
      frame #6: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #7: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #8: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #8, name = 'Threadpool worker'
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71c25 libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
      frame #3: 0x002b12e0 mono`worker_thread + 1024
      frame #4: 0x002abb6b mono`start_wrapper + 795
      frame #5: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #6: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #7: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #9, name = 'Threadpool worker'
      frame #0: 0x923cc7ca libsystem_kernel.dylib`__psynch_cvwait + 10
      frame #1: 0x9ae6fd1d libsystem_pthread.dylib`_pthread_cond_wait + 728
      frame #2: 0x9ae71c25 libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
      frame #3: 0x002b12e0 mono`worker_thread + 1024
      frame #4: 0x002abb6b mono`start_wrapper + 795
      frame #5: 0x9ae6d5fb libsystem_pthread.dylib`_pthread_body + 144
      frame #6: 0x9ae6d485 libsystem_pthread.dylib`_pthread_start + 130
      frame #7: 0x9ae72cf2 libsystem_pthread.dylib`thread_start + 34
    thread #10, name = 'Domain unloader'
      frame #0: 0x923ccff2 libsystem_kernel.dylib`__wait4 + 10
      frame #1: 0x940d9ea5 libsystem_c.dylib`waitpid$UNIX2003 + 48
      frame #2: 0x0017cba7 mono`mono_handle_native_crash + 519
      frame #3: 0x001e2b03 mono`sigabrt_signal_handler + 147
      frame #4: 0x920a8deb libsystem_platform.dylib`_sigtramp + 43
  (lldb) detach
  Process 2037 detached
  (lldb) quit

  =================================================================
  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.
  =================================================================
```

6 years ago[mcs] Throw expression cannot be placed after any colon.
Marek Safar [Mon, 5 Jun 2017 13:27:28 +0000 (15:27 +0200)]
[mcs] Throw expression cannot be placed after any colon.

6 years ago[mcs] C#7 throw expression
Marek Safar [Mon, 5 Jun 2017 10:19:08 +0000 (12:19 +0200)]
[mcs] C#7 throw expression

6 years agoBump bockbuild to bring in 64bit fix
Alexander Köplinger [Sun, 4 Jun 2017 17:27:10 +0000 (19:27 +0200)]
Bump bockbuild to bring in 64bit fix

6 years agoRevert "[sdb] Add an API to make the contents of the 'State Machine Hoisted Local...
Zoltan Varga [Fri, 2 Jun 2017 17:52:50 +0000 (13:52 -0400)]
Revert "[sdb] Add an API to make the contents of the 'State Machine Hoisted Local Scopes' table in ppdb files available in sdb. (#4961)" (#4970)

This reverts commit 010fce60af693fdb80c814b94825a1ca9b9bac1e.

6 years ago[sdb] Add an API to make the contents of the 'State Machine Hoisted Local Scopes...
Zoltan Varga [Fri, 2 Jun 2017 17:43:56 +0000 (13:43 -0400)]
[sdb] Add an API to make the contents of the 'State Machine Hoisted Local Scopes' table in ppdb files available in sdb. (#4961)

6 years agoUpdate API snapshot
Alexander Köplinger [Fri, 2 Jun 2017 17:12:31 +0000 (19:12 +0200)]
Update API snapshot

6 years ago[jit] Avoid running class cctors for remoting wrappers in the source domain. Fixes...
Zoltan Varga [Fri, 2 Jun 2017 15:54:54 +0000 (11:54 -0400)]
[jit] Avoid running class cctors for remoting wrappers in the source domain. Fixes #56821. (#4950)

6 years ago[interp] respect remoting proxies when resolving virtual methods
Bernhard Urban [Thu, 1 Jun 2017 19:30:09 +0000 (21:30 +0200)]
[interp] respect remoting proxies when resolving virtual methods

6 years ago[interp] reference domain that owns method in RuntimeMethod and couple other domain...
Bernhard Urban [Thu, 1 Jun 2017 17:01:29 +0000 (19:01 +0200)]
[interp] reference domain that owns method in RuntimeMethod and couple other domain related fixes

6 years ago[marshal] delay dummy string allocation
Bernhard Urban [Fri, 2 Jun 2017 08:24:28 +0000 (10:24 +0200)]
[marshal] delay dummy string allocation

6 years agoUpdate API snapshot
Alexander Köplinger [Fri, 2 Jun 2017 11:34:28 +0000 (13:34 +0200)]
Update API snapshot

6 years ago[Mono.Options] Fix test and add suite to CI (#4963)
Alexander Köplinger [Fri, 2 Jun 2017 11:07:12 +0000 (13:07 +0200)]
[Mono.Options] Fix test and add suite to CI (#4963)

* [Mono.Options] Fix test and add suite to CI

We missed running Mono.Options tests on CI so we didn't catch
this error which was introduced with: https://github.com/mono/mono/pull/4719

```
CSC     [net_4_x-darwin] net_4_x_Mono.Options_test.dll
Test/Mono.Options/CommandSetTest.cs(231,16): error CS7036: There is no argument given that corresponds to the required formal parameter 'error' of 'CommandSet.CommandSet(string, TextWriter, TextWriter, Converter<string, string>)'
```

* [Mono.Options] Stop hardcoding \n to fix tests on Windows

6 years ago[corlib] Updates api
Marek Safar [Thu, 1 Jun 2017 22:14:58 +0000 (00:14 +0200)]
[corlib] Updates api

6 years ago[arm] remove cross compiling guard for MONO_ARCH_SOFT_DEBUG_SUPPORTED
Bernhard Urban [Wed, 31 May 2017 10:26:24 +0000 (12:26 +0200)]
[arm] remove cross compiling guard for MONO_ARCH_SOFT_DEBUG_SUPPORTED

6 years ago[interp] guard remoting functions properly
Bernhard Urban [Thu, 1 Jun 2017 19:31:47 +0000 (21:31 +0200)]
[interp] guard remoting functions properly

6 years ago[runtime] Remove all NACL support. It was unmaintained for a long time. (#4955)
Zoltan Varga [Fri, 2 Jun 2017 07:51:44 +0000 (03:51 -0400)]
[runtime] Remove all NACL support. It was unmaintained for a long time. (#4955)

https://blog.chromium.org/2017/05/goodbye-pnacl-hello-webassembly.html

6 years ago[Posix] Optimize string marshal code by using unsafe code (#4964)
Marius Ungureanu [Fri, 2 Jun 2017 07:03:47 +0000 (00:03 -0700)]
[Posix] Optimize string marshal code by using unsafe code (#4964)

6 years ago[MacSDKRelease] Pin revision of mono-extensions
Alexander Köplinger [Fri, 2 Jun 2017 01:42:01 +0000 (03:42 +0200)]
[MacSDKRelease] Pin revision of mono-extensions

With the new bockbuild in place we can finally remove the
implicit dependency on a point-in-time state of mono-extensions
and instead explicitly pin the desired revision.

6 years ago[aot] Revert a change from d135465fba59f7257e2d225564df7c601015fee8 which broke the...
Zoltan Varga [Thu, 1 Jun 2017 20:06:30 +0000 (16:06 -0400)]
[aot] Revert a change from d135465fba59f7257e2d225564df7c601015fee8 which broke the aot compiler on windows.

6 years ago[ikdasm] Bump external/ikdasm to master.
Zoltan Varga [Thu, 1 Jun 2017 15:38:07 +0000 (11:38 -0400)]
[ikdasm] Bump external/ikdasm to master.

6 years ago[mcs] Constant folding of enum constant and literal was using wrong operands. Fixes...
Marek Safar [Thu, 1 Jun 2017 14:31:57 +0000 (16:31 +0200)]
[mcs] Constant folding of enum constant and literal was using wrong operands. Fixes #53202

6 years ago[mcs] Moves using static lookup at the end of simple name lookup rules. Fixes #55348
Marek Safar [Thu, 1 Jun 2017 13:25:31 +0000 (15:25 +0200)]
[mcs] Moves using static lookup at the end of simple name lookup rules. Fixes #55348

6 years agoBump api-snapshot
Alexander Köplinger [Thu, 1 Jun 2017 09:21:31 +0000 (11:21 +0200)]
Bump api-snapshot

I accidentally pushed the wrong branch yesterday.

6 years agoUpdates api-snapshot
Marek Safar [Thu, 1 Jun 2017 07:12:18 +0000 (09:12 +0200)]
Updates api-snapshot

6 years agoBump corert
Marek Safar [Tue, 30 May 2017 09:45:11 +0000 (11:45 +0200)]
Bump corert

6 years ago[Socket] Fix Socket.BeginConnect to multiple IPAddress (#4960)
Ludovic Henry [Wed, 31 May 2017 22:22:27 +0000 (18:22 -0400)]
[Socket] Fix Socket.BeginConnect to multiple IPAddress (#4960)

We would previously mix 2 SocketAsyncResult, and in case we would succeed asynchronously, we would return one that would not be updated afterwards.

The solution consists in using only 1 SocketAsyncResult that we ensure to update accordingly.

6 years agoMerge pull request #4935 from lambdageek/dev-handles-may
Aleksey Kliger (λgeek) [Wed, 31 May 2017 18:34:20 +0000 (14:34 -0400)]
Merge pull request #4935 from lambdageek/dev-handles-may

[coop handles] w32event, w32handle and DNS icalls

6 years ago[runtime] Avoid calling mono_class_from_mono_type () for sre arrays, it could initial...
Zoltan Varga [Wed, 31 May 2017 17:21:10 +0000 (13:21 -0400)]
[runtime] Avoid calling mono_class_from_mono_type () for sre arrays, it could initialize unfinished element types. Create a normal MonoType structure instead. Fixes #56611. (#4952)

6 years ago[System] Adds watch specific HttpListenerWebSocketContext
Marek Safar [Wed, 31 May 2017 17:16:38 +0000 (19:16 +0200)]
[System] Adds watch specific HttpListenerWebSocketContext

6 years agoBump bockbuild to include gtk# bump (#4959)
Marius Ungureanu [Wed, 31 May 2017 14:49:10 +0000 (07:49 -0700)]
Bump bockbuild to include gtk# bump (#4959)

6 years agoBump api-snapshot
Alexander Köplinger [Wed, 31 May 2017 10:44:14 +0000 (12:44 +0200)]
Bump api-snapshot

6 years ago[unaligned] relax test regarding floating point precision
Bernhard Urban [Tue, 30 May 2017 10:52:54 +0000 (12:52 +0200)]
[unaligned] relax test regarding floating point precision

6 years ago[interp] use memmove for some primitve types, because it takes care of unaligned...
Bernhard Urban [Tue, 30 May 2017 10:28:11 +0000 (12:28 +0200)]
[interp] use memmove for some primitve types, because it takes care of unaligned addresses

relevant on architectures which do not support unaligned load/stores.

6 years agoBump corefx
Marek Safar [Sun, 28 May 2017 10:25:48 +0000 (12:25 +0200)]
Bump corefx

6 years ago[build] Fixes profile path for aot compilation
Marek Safar [Wed, 31 May 2017 06:44:35 +0000 (08:44 +0200)]
[build] Fixes profile path for aot compilation

6 years agoBump cecil
Marek Safar [Tue, 30 May 2017 16:38:24 +0000 (18:38 +0200)]
Bump cecil

6 years ago[System] Add missing configuration properties to the list of properties (#4954)
Alexander Köplinger [Wed, 31 May 2017 01:52:08 +0000 (03:52 +0200)]
[System] Add missing configuration properties to the list of properties (#4954)

After looking at https://github.com/mono/mono/pull/4949 I did a
quick pass through the other config sections and found two more
cases where we missed adding to the properties list.

6 years ago[MacSDK] Bump xamarin-gtk-theme.py to latest revision from private bockbuild
Alexander Köplinger [Wed, 31 May 2017 01:50:09 +0000 (03:50 +0200)]
[MacSDK] Bump xamarin-gtk-theme.py to latest revision from private bockbuild

6 years ago[MacSDK] Port two msbuild fixes from private bockbuild
Alexander Köplinger [Wed, 31 May 2017 01:24:19 +0000 (03:24 +0200)]
[MacSDK] Port two msbuild fixes from private bockbuild

https://github.com/xamarin/bockbuild/commit/58467b852e13b4bdfc75a2a0f9b9507b417b0694:

    [msbuild] Create symlinks from lib/mono/xbuild/Microsoft/NuGet/*
    msbuild install script cannot do this as the source files are installed
    by mono, which are in a different staging directory.

https://github.com/xamarin/bockbuild/commit/fb9656a7613bab2d77c8ce7e05d673c5abbbdac5:

    Partially Revert "[msbuild] Remove redundant msbuild logic from mono_master.py"

    Use 15.0 instead of mono version! msbuild's install script cannot
    copy these since bockbuild installs msbuild to a separate staging
    directory from mono. So, it needs to be done here.

6 years agoBump bockbuild to include gtk+ patch
Alexander Köplinger [Wed, 31 May 2017 01:33:35 +0000 (03:33 +0200)]
Bump bockbuild to include gtk+ patch

6 years ago[System] Add useDefaultCredentialsProp to the list of properties. (#4949)
Cody Russell [Tue, 30 May 2017 23:39:26 +0000 (18:39 -0500)]
[System] Add useDefaultCredentialsProp to the list of properties. (#4949)

6 years ago[runtime] Don't make the domain id allocatable before we clear the domain (#4942)
Vlad Brezae [Tue, 30 May 2017 22:28:50 +0000 (01:28 +0300)]
[runtime] Don't make the domain id allocatable before we clear the domain (#4942)

Otherwise, while we are clearing the domain, another domain might be created that has the same id as the current one. This would lead to crashes due to releasing of data from the newly created domain (ex gchandles).

6 years agoMerge pull request #4938 from kumpera/optimize_ref_queries
Rodrigo Kumpera [Tue, 30 May 2017 22:20:44 +0000 (15:20 -0700)]
Merge pull request #4938 from kumpera/optimize_ref_queries

Add concurrent read version of MonoGHashTable and use it with MonoDomain::refobject

6 years ago[win32] Add new files.
Rodrigo Kumpera [Tue, 30 May 2017 20:03:35 +0000 (13:03 -0700)]
[win32] Add new files.

6 years ago[w32socket] Remove dead code
Aleksey Kliger [Tue, 30 May 2017 19:15:06 +0000 (15:15 -0400)]
[w32socket] Remove dead code

6 years ago[w32socket] Use coop handles for System.Net.Dns.GetHostByAddr_internal
Aleksey Kliger [Tue, 30 May 2017 19:14:18 +0000 (15:14 -0400)]
[w32socket] Use coop handles for System.Net.Dns.GetHostByAddr_internal

6 years ago[w32socket] Use coop handles for System.Net.Dns.GetHostByName_internal
Aleksey Kliger [Tue, 30 May 2017 18:57:09 +0000 (14:57 -0400)]
[w32socket] Use coop handles for System.Net.Dns.GetHostByName_internal

6 years ago[mcs] Don't emit param-array attribute on method overrides, it's ignored by C# compil...
Marek Safar [Tue, 30 May 2017 17:30:43 +0000 (19:30 +0200)]
[mcs] Don't emit param-array attribute on method overrides, it's ignored by C# compiler. Fixes #53244

6 years agoBump bockbuild
Alexis Christoforides [Tue, 30 May 2017 17:29:33 +0000 (13:29 -0400)]
Bump bockbuild

6 years ago[S.R.I.RuntimeInformation] Fix FrameworkDescription on Android (#4946)
Alexander Köplinger [Tue, 30 May 2017 16:34:53 +0000 (18:34 +0200)]
[S.R.I.RuntimeInformation] Fix FrameworkDescription on Android (#4946)

* [S.R.I.RuntimeInformation] Fix FrameworkDescription on Android

It turns out using `DllImport ["__Internal"]` doesn't work on
XA (and other cases where Mono is embedded) because it searches
for the method in the host which embeds Mono and doesn't find it,
resulting in an EntryPointNotFoundException.

We need to switch to an icall instead. However there's already
an existing icall+BCL wrapper: Mono.Runtime.GetDisplayName().

Added IVT from corlib to S.R.I.RuntimeInformation so we can call it.

* Update API snapshot

6 years ago[mcs] Reset catch state variable after it has been checked. Fixes #54322
Marek Safar [Tue, 30 May 2017 09:39:46 +0000 (11:39 +0200)]
[mcs] Reset catch state variable after it has been checked. Fixes #54322

6 years ago[mcs] New property/indexer cannot have accessors implementing an interface in base...
Marek Safar [Mon, 29 May 2017 21:55:47 +0000 (23:55 +0200)]
[mcs] New property/indexer cannot have accessors implementing an interface in base type. Fixes #56627

6 years agoBugfix Ping.cs (#4936)
Jochen Kühner [Mon, 29 May 2017 21:05:34 +0000 (23:05 +0200)]
Bugfix Ping.cs (#4936)

6 years ago[interp] implement RELOC_LONG_BRANCH. fixes test/imt_big_iface_test.exe
Bernhard Urban [Mon, 29 May 2017 16:41:29 +0000 (18:41 +0200)]
[interp] implement RELOC_LONG_BRANCH.  fixes test/imt_big_iface_test.exe

6 years ago[runtime] Handle mono_method_body_get_object returning NULL on success.
Rodrigo Kumpera [Mon, 29 May 2017 17:36:54 +0000 (10:36 -0700)]
[runtime] Handle mono_method_body_get_object returning NULL on success.

6 years ago[Facades] Update to match latest contracts (#4939)
Alexander Köplinger [Mon, 29 May 2017 17:31:44 +0000 (19:31 +0200)]
[Facades] Update to match latest contracts (#4939)

* [Facades] Update to match latest contracts

* Update API snapshot

6 years ago[CI] ignore appdomain-unload-asmload.exe on interp and full-aot
Bernhard Urban [Mon, 29 May 2017 13:26:00 +0000 (15:26 +0200)]
[CI] ignore appdomain-unload-asmload.exe on interp and full-aot

6 years ago[android] add hardware specific workaround for Nexus9 in armv7 mode
Bernhard Urban [Tue, 16 May 2017 15:31:59 +0000 (17:31 +0200)]
[android] add hardware specific workaround for Nexus9 in armv7 mode

we got a couple of bug reports, all with the same failure:

https://bugzilla.xamarin.com/show_bug.cgi?id=44907
https://bugzilla.xamarin.com/show_bug.cgi?id=46482
https://bugzilla.xamarin.com/show_bug.cgi?id=51791

The bugs are private, therefore here what I wrote:

```
Thank you Matthias, this was very helpful.

>>> 09-30 12:24:50.347: A/DEBUG(6211): pid: 6191, tid: 6209, name: Thread-4  >>> com.distech.x50.ui.droid <<<
>>> 09-30 12:24:50.347: A/DEBUG(6211): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
>>> 09-30 12:24:50.347: A/DEBUG(6211):     r0 d6b58728  r1 00004001  r2 00000000  r3 d6b58738
>>> 09-30 12:24:50.347: A/DEBUG(6211):     r4 00000008  r5 ea97427c  r6 00001f3c  r7 00000015
>>> 09-30 12:24:50.347: A/DEBUG(6211):     r8 00001f38  r9 00000015  sl d6b58728  fp d67fed90
>>> 09-30 12:24:50.347: A/DEBUG(6211):     ip ea9742c0  sp d67fed60  lr ea7a4504  pc ea716a58  cpsr 800e0010

The crash happens on this assignment:
https://github.com/mono/mono/blob/de1865dad5c0350f391fedcaa08f02f610530d3f/mono/mini/mini-generic-sharing.c#L418
Here the according disassembly:
https://gist.github.com/lewurm/b1094749027c9e5ea19fdc4fac7905a7

The crash happens in the last loop iteration (`r9=i`, `r7=slot`).  Looking
at the machine code it just _cannot_ happen, which is confirmed by the C
code as well: `*oti` successfully happens in the if check, but after
returning from `alloc_oti()`, `oti` doesn't contain a valid address anymore.
I suspect some weird hardware issue that fails to restore all registers
properly from the stack.
```
[...]

```
Thanks again Matthias.  Unfortunately, I'm out of ideas, and I can't
blame anything but the hardware. The situation we see is too weird. We
segfault at offset `0xdda60: str sl, [r4]`, but really we should
already segfault at offset `0xdda2c: ldrge   sl, [r4, #8]!"`.  So I
suspect two things why this could happen:

(1) The instruction at `dda2c` fails to do the post-increment correctly
    for *whatever* reason.

(2) Something along the execution path corrupts the stackslot, where
    `r4` is saved, in such a way that it *exactly* masks it with `0xf`.
    Everything else on the stack looks fine, so this is sort of very
    unlikely to be honest.

This only happens on a very specific device: The Nexus 9 is the only
device that was ever shipped with the Tegra K1 T132.  I suspect an issue
in the binary translation layer of `armv7` instruction set to the internal
micro-ops of the CPU.  I tried to stress test the instruction in
question (see https://github.com/lewurm/ldrinsntest), however I was not
able to trigger a crash.  So either, I'm missing some context in order
to trigger the bug or I'm on a completely wrong track.

That said, even if we could proof that it is indeed a hardware issue,
the workaround is also non-trivial (it would then either need a fix in
gcc or require a microcode update by the chip vendor).
```

And then we saw:
https://github.com/golang/go/issues/19809#issuecomment-290804472

Another hint that this device is buggy.

6 years agoBump bockbuild
Alexander Köplinger [Mon, 29 May 2017 10:33:02 +0000 (12:33 +0200)]
Bump bockbuild

6 years ago[runtime] Change MonoDomain::refobject_hash to use MonoConcGHashTable.
Rodrigo Kumpera [Mon, 29 May 2017 03:16:29 +0000 (20:16 -0700)]
[runtime] Change MonoDomain::refobject_hash to use MonoConcGHashTable.

This change massively improves reflection query scalability.

Given this benchmark and my 4 cores laptop:

```
const int T_C = 4;
var list = new List<Thread> ();
bool done = false;
int count = 0;
for (int i = 0; i < T_C; ++i) {
var t = new Thread(() => {
while (!done) {
typeof (Driver)
.GetMethods (
BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.Static);
Interlocked.Increment (ref count);
}
});
t.Start ();
list.Add (t);
}

Thread.Sleep (5000);
done = true;
foreach (var t in list)
t.Join ();
Console.WriteLine ("Got {0} lists done", count);
```

This change makes us go from 166.725 queries/s to 5.140.821 queries/s. Or 30x faster.

6 years ago[runtime] Add concurrent read variant of MonoGHashTable name MonoConcGHashTable.
Rodrigo Kumpera [Mon, 29 May 2017 00:24:58 +0000 (17:24 -0700)]
[runtime] Add concurrent read variant of MonoGHashTable name MonoConcGHashTable.

Use the same design as MonoConcHashTable.

Aaaaand confusing name will confuse.

6 years ago[mcs] Improves imported destructor detection. Fixes #54159
Marek Safar [Sun, 28 May 2017 11:47:45 +0000 (13:47 +0200)]
[mcs] Improves imported destructor detection. Fixes #54159

6 years agoBump bockbuild
Alexander Köplinger [Sun, 28 May 2017 00:02:31 +0000 (02:02 +0200)]
Bump bockbuild

6 years agoBump bockbuild to fix wrench build
Alexander Köplinger [Sat, 27 May 2017 23:17:47 +0000 (01:17 +0200)]
Bump bockbuild to fix wrench build

6 years agoMerge pull request #4904 from kumpera/more_opts
Rodrigo Kumpera [Sat, 27 May 2017 19:29:01 +0000 (12:29 -0700)]
Merge pull request #4904 from kumpera/more_opts

[runtime] Change jit_info_table_num_elements to O(1).

6 years agoMerge pull request #4928 from kumpera/ptr_to_struct_intrinsic
Rodrigo Kumpera [Sat, 27 May 2017 19:27:37 +0000 (12:27 -0700)]
Merge pull request #4928 from kumpera/ptr_to_struct_intrinsic

[mini] Intrinsify Marshal.PtrToStructure<T>

6 years agoInterp sdb (#4911)
Zoltan Varga [Sat, 27 May 2017 16:29:56 +0000 (12:29 -0400)]
Interp sdb (#4911)

* [interpreter] Add beginnings of debugger support.

Handle debugger support similarly to the JIT:
- Add a MINT_SDB_SEQ_POINT instruction to the debugger IR. Replace it with a MINT_BREAKPOINT instruction when a breakpoint is placed.
- Store the sequence point information in the existing sequence point data structures.

* [interp] Add support for debugger stacktraces.

* [interp] Add support for debugger frame info.

* [interp] Connect seq points inside the same basic block so simple single stepping works.

* [interp] Link sequence points in different basic blocks the same way the JIT does it.

* [interp] Allocate some bitsets from a mempool.

* [interp] Rewrite the patching in the transform pass to make it a bit easier to understand.

* [interp] Add interruption support for sdb.

* [interp] Add support for mkrefany,refanytype and refanyval.

* [interp] Fix debugger failures.

* Add support for setting byref variables.
* Fix thread interruption when the top frame is an interpreter frame.
* Allow stack walks when a thread is suspended while transforming a method.
* Implement method entry/exit events.
* Fix ldstr+dynamic methods.

* [interp] Implement support for Debugger.Break.

* [interp] Change the offsets in MonoJitInfo/seq points into byte based from short based to reduce the amount of special casing needed in other parts of the code.

* [interp] Factor out the push/pop lmf code into a pair of helper functions.

* [mixed] Fix mixed mode EH.

* [interp] Implement support for MONO_VERBOSE_METHOD. Improve sequence point placement.

* [interp] Implement support for SetIP ().

Pass the target thread as an additional argument to mono_interp_set_resume_state (). Check the resume state after single
stepping/breakpoints in the interpreter.

* [interp] Disable the usage of the STLOC_NP opcodes when running under the debugger, it doesn't work if the ip is changed when the execution is stopped.

* [interp] Fix async stack walks in the debugger when the thread is in native code called from interpreter code.

* [interp] Fix the disable interpreter build.

* [interp] Fix the calculation of native offsets in the line number info.

* [interp] Fix the build.

* [interp] Make CMD_STACK_FRAME_GET_THIS behave the same when called on managed-to-native frames, with the interpreter, frame->has_ctx is set.

* [interp] Fix typos, remove some dead code, use g_print instead of printf in a few places, move some interpreter stubs to interp-stubs.c.

6 years ago[runtime] Fix a race in mono_class_get_virtual_methods () which happens when klass...
Zoltan Varga [Sat, 27 May 2017 13:33:59 +0000 (09:33 -0400)]
[runtime] Fix a race in mono_class_get_virtual_methods () which happens when klass->method is NULL initially, but gets initialized later. Use the lowest bit of the iterator pointer to distinguish between the two cases. Fixes #56824. (#4933)

6 years ago[runtime] Change jit_info_table_num_elements to O(1).
Rodrigo Kumpera [Fri, 19 May 2017 06:24:08 +0000 (23:24 -0700)]
[runtime] Change jit_info_table_num_elements to O(1).

On very large apps such as XS, this looking can take half a second of CPU time when opening a big solution.

6 years ago[Mono.Posix] Adding .Net Core 2.0 support. (#4774)
Bill Holmes [Sat, 27 May 2017 06:24:10 +0000 (23:24 -0700)]
[Mono.Posix] Adding .Net Core 2.0 support. (#4774)

6 years ago[w32socket] addrinfo_to_IPHostEntry_handles
Aleksey Kliger [Fri, 26 May 2017 22:43:24 +0000 (18:43 -0400)]
[w32socket] addrinfo_to_IPHostEntry_handles

- change addrinfo_to_IPHostEntry to use the handles version
- next commits will update the callers to use the _handles version directly

6 years agoRe-bump bockbuild for libtiff URL change
Alexis Christoforides [Fri, 26 May 2017 20:11:08 +0000 (16:11 -0400)]
Re-bump bockbuild for libtiff URL change

6 years ago[System] Use coop handles for System.Net.Dns.GetHostName_internal
Aleksey Kliger [Fri, 26 May 2017 20:03:25 +0000 (16:03 -0400)]
[System] Use coop handles for System.Net.Dns.GetHostName_internal

6 years agoRevert "Bump bockbuild", as it breaks the build.
Alexis Christoforides [Fri, 26 May 2017 19:38:38 +0000 (15:38 -0400)]
Revert "Bump bockbuild", as it breaks the build.

This reverts commit 30f9a22f0869d727c663cc4ba2c283ce75dc73f2.

6 years agoMerge pull request #4931 from kumpera/com-interop-fix
Rodrigo Kumpera [Fri, 26 May 2017 19:28:40 +0000 (12:28 -0700)]
Merge pull request #4931 from kumpera/com-interop-fix

Fix cominterop bug

6 years ago[mini]Add test for PtrToStruct<T>
Rodrigo Kumpera [Fri, 26 May 2017 05:45:16 +0000 (22:45 -0700)]
[mini]Add test for PtrToStruct<T>

6 years agoMerge pull request #4840 from kumpera/unaligned-access
Rodrigo Kumpera [Fri, 26 May 2017 19:17:02 +0000 (12:17 -0700)]
Merge pull request #4840 from kumpera/unaligned-access

Another round of cleanups plus fix how the JIT emit unaligned access.

6 years ago[runtime] Use coop handles for ves_icall_System_Threading_Mutex_OpenMutex_internal
Aleksey Kliger [Fri, 26 May 2017 15:33:07 +0000 (11:33 -0400)]
[runtime] Use coop handles for ves_icall_System_Threading_Mutex_OpenMutex_internal

- add mono_w32mutex_open for w32mutex-unix.c

6 years ago[runtime] Use coop handles for ves_icall_System_Threading_Mutex_CreateMutex_internal
Aleksey Kliger [Fri, 26 May 2017 15:08:22 +0000 (11:08 -0400)]
[runtime] Use coop handles for ves_icall_System_Threading_Mutex_CreateMutex_internal

6 years ago[runtime] Use coop handles for ves_icall_System_Threading_Events_OpenEvent_internal
Aleksey Kliger [Fri, 26 May 2017 14:01:10 +0000 (10:01 -0400)]
[runtime] Use coop handles for ves_icall_System_Threading_Events_OpenEvent_internal

6 years ago[w32event] Use coop handles for System.Threading.NativeEventCalls.CreateEvent_internal
Aleksey Kliger [Thu, 25 May 2017 22:21:31 +0000 (18:21 -0400)]
[w32event] Use coop handles for System.Threading.NativeEventCalls.CreateEvent_internal

- Make a new mono_w32event_create_full on unix
- Convert the MonoString to utf8 (unix) or utf16 (win32) in the icall, then
  call an implementation func.
- transition to GC safe mode around the win32 api call on Windows

6 years agoBump bockbuild
Alexis Christoforides [Fri, 26 May 2017 16:19:03 +0000 (12:19 -0400)]
Bump bockbuild

6 years ago[mcs] Codegen for optimized new with valuetype load and awaited arguments. Fixes...
Marek Safar [Fri, 26 May 2017 16:22:58 +0000 (18:22 +0200)]
[mcs] Codegen for optimized new with valuetype load and awaited arguments. Fixes #56081

6 years ago[coop handles] Add mono_string_handle_pin_chars
Aleksey Kliger [Thu, 25 May 2017 22:17:59 +0000 (18:17 -0400)]
[coop handles] Add mono_string_handle_pin_chars

6 years ago[w32handle] Const-ify arg of mono_w32handle_namespace_search_handle
Aleksey Kliger [Thu, 25 May 2017 22:16:44 +0000 (18:16 -0400)]
[w32handle] Const-ify arg of mono_w32handle_namespace_search_handle

6 years ago[remoting] Use coop handles for ves_icall_System_Runtime_Activation_ActivationService...
Aleksey Kliger [Thu, 25 May 2017 18:54:20 +0000 (14:54 -0400)]
[remoting] Use coop handles for ves_icall_System_Runtime_Activation_ActivationServices_EnableProxyActivation

6 years ago[remoting] Use coop handles for ves_icall_IsTransparentProxy
Aleksey Kliger [Thu, 25 May 2017 17:57:36 +0000 (13:57 -0400)]
[remoting] Use coop handles for ves_icall_IsTransparentProxy

6 years ago[arm] use r8 instead of r5 in icall trampoline, because r5 is used as IMT reg
Bernhard Urban [Thu, 18 May 2017 21:48:50 +0000 (23:48 +0200)]
[arm] use r8 instead of r5 in icall trampoline, because r5 is used as IMT reg