Compare commits

..
Author SHA1 Message Date
Alexander Kyte 659458b3ad [runtime] Add test for equal enumerators bug 2017-09-15 17:12:23 +00:00
Jonathan Chambers 4a20e930af Implement stack overflow handling on Win64. Call _resetstkoflw to restore stack protection before calling handler, and then jump to handler via a cached MonoContext. (#5472) 2017-09-11 13:27:00 -04:00
Armin Hasitzka cf9dff4bb8 [TSan] Interlock and unlock MonoJitStats (#5437)
[TSan] Interlock and unlock MonoJitStats

This is the first part of telling TSan what to do with `MonoJitStats`; I dealt with all the `gint32` values and partly touched the `gboolean` value (see `FIXME`). However, `MonoJitStats` also contains `gdouble` which can (1) probably be interlocked and (2) will be updated in a later step, together with the `FIXME`, as soon as an updated version of the atomic interface exists.

I did my best to distinguish between perf. critical parts and parts where `Interlocked* ()` seems to work perfectly fine. As before, if I misjudged anything, I would kindly ask to comment the affected operations, and I will update them accordingly.

More (technical) details can be found in the commit messages.
2017-09-11 16:35:03 +02:00
Alexander Köplinger 2d238eeb11 [System.Xaml] Fix deadlock on exception in XamlBackgroundReader
The ManualResetEvent wouldn't be signaled when an exception happens
in the reader loop so we'd deadlock in Read().

I'm still investigating where the exception comes from but this
should at least help unblocking CI.

https://bugzilla.xamarin.com/show_bug.cgi?id=46683
2017-09-11 11:31:42 +02:00
Niklas Therning f98d0799d8 Merge pull request #5504 from ntherning/wait-for-native-thread-to-die-in-Thread-Join
Wait for the native thread to die in Thread.Join() on Windows
2017-09-11 11:07:53 +02:00
Bernhard Urban 5a758bd714 Update CONTRIBUTING.md (#5542) 2017-09-11 10:59:14 +02:00
Jason Imison d7609da34c [F#] Reinstate _DebugFileExt as it's needed for mobile debugging. (#5534)
Also added a mechanism for users to override DebugType
2017-09-09 00:07:07 +02:00
Rodrigo Kumpera 098f6e8aa8 Merge pull request #5428 from kumpera/wasm-support-p2
Mono Wasm support
2017-09-08 14:55:38 -04:00
Ludovic Henry d96de323da [threads] Fix "[threads] Fix leaking threads: SGen Worker and Finalizer (#5284)" (#5532)
* Revert "[threads] Fix leaking threads: SGen Worker and Finalizer (#5284)"

The sgen-specific cleanup cannot be run before the sgen-agnostic cleanup

This reverts commit 7db0fb0c88.

* [threads] Make sure we do not leak the finalizer and sgen threadpool threads
2017-09-08 14:07:00 -04:00
Jason Imison 65106878d5 F# portable debugging (#5531)
* Switch F# builds over to portable pdb

* Add portable pdb metadata fix from https://github.com/Microsoft/visualfsharp/pull/3553
2017-09-08 14:38:29 +02:00
Manuel de la Pena a09b912b86 [Tests] Fix Mono.Data.Tds tests on iOS (#5501)
* [Tests] Fix Mono.Data.Tds tests on iOS

The modified tests failed on iOS following PR:
https://github.com/xamarin/xamarin-macios/pull/2580 that adds support
for Xharness to run the Mono.Data.Tds on Xamarin.iOS. With the changes
the tests run a expected.

* Close Listener when done.
2017-09-08 13:05:48 +02:00
Armin Hasitzka 91149fb1e5 [TSan] Tackle MonoPerfCounters (#5413)
[TSan] Tackle MonoPerfCounters

With `MonoPerfCounters` taking part in many races, I thought it's finally time to attend to it. If I am not mistaken, most (if not all) load / store operations can be interlocked. If I am wrong, I would kindly ask to quickly comment the respective perf. critial operations and I will change them to `Unlocked* ()`.

Furthermore, a few details:

* updated all fields to signed types as `Interlocked* ()` functions exist for these types already
* upgraded a few values to `64-bit` as other `64-bit` values are assigned to them
* fixed a few `FIXME`s in `predef_writable_update ()` that were connected to `Interlocked* ()` functions
2017-09-08 11:20:28 +02:00
Miguel de Icaza bbb0a58f15 Update man page 2017-09-08 07:22:45 +02:00
Miguel de Icaza eefe01a655 Shorter 2017-09-08 07:22:45 +02:00
Miguel de Icaza 7d68dc8e71 Toggle the turbo button 2017-09-08 07:22:45 +02:00
Miguel de Icaza 0253b65888 Remove lingering bits from removed prj2make tool (#5526) 2017-09-07 23:57:53 +02:00
Marek Safar 443c85784f Bump Roslyn 2017-09-07 17:45:34 +02:00
monojenkins 4f3dde8e57 [msvc] Update csproj files (#5524) 2017-09-07 17:42:30 +02:00
Armin Hasitzka 5d36f305a5 Use Unlocked* () to mark racy counters (#5500)
[TSan] Mark racy counters in metadata.c

- using `gint32` instead of `int` should not be an issue
- `img_set_count` is interlocked by `image_sets_lock ()` - `UnlockedIncrement ()` is just used for completeness / documentation
- `++img_set_cache_(hit|miss)` is called quite often and is connected to caching: it seems to me as if interlocking these counters would be a bad idea (at least for cache hits)
2017-09-07 14:50:49 +02:00
Armin Hasitzka 7db0fb0c88 [threads] Fix leaking threads: SGen Worker and Finalizer (#5284)
* Fix leaking threads: SGen Worker and Finalizer
- https://bugzilla.xamarin.com/show_bug.cgi?id=58317
- stop SGen workers before the finalizer stops
- clean up SGen workers with the Finalizer
- remove `mono_thread_join (GUINT_TO_POINTER (gc_thread->tid));` as we detach the Finalizer with `mono_threads_join_threads ()` within `mono_gc_cleanup ()`

* [fixup!] Move counting variable into the loop initialiser and add a `(gpointer)` cast
2017-09-07 12:23:07 +02:00
Armin Hasitzka bcf0ad5860 [TSan] Reorganise / clean up counters logic in mini-generic-sharing.c (#5502)
* Reorganise counters:
- use `Interlocked* ()` and `Unlocked* ()` to fix / mark (possible) races
- change the initialisation location and the visbility of some counters
- fix a few typos

* Extend the warning when re-registering counters

* also print counter address if we have a duplicate
2017-09-07 12:19:23 +02:00
Marek Safar 5b22c773bd Updates for CODEOWNERS 2017-09-07 11:49:21 +02:00
Alexander Köplinger 9864e28ebc Update reference-assemblies (#5519) 2017-09-07 11:24:35 +02:00
Marek Safar d76f8cf1cd Bump roslyn to 2.3.2 2017-09-07 10:12:46 +02:00
Alex Rønne Petersen 645a261f9a Merge pull request #5512 from rodrmoya/fix-mono-profiler-lib
[Mono.Profiler.Log] Initialize LogEvent's properties
2017-09-07 01:01:57 +02:00
Rodrigo Moya daf47bd258 [Mono.Profiler.Log] Initialize LogEvent's properties
Make sure all events have all fields initialized. This was missing setting
Buffer and Timestamp properties when creating the different LogEvent* subclasses.
2017-09-06 22:37:43 +02:00
Alexander Köplinger a243301ee4 [WinForms/Drawing] Remove some leftover test scripts (#5518)
They're no longer used.
2017-09-06 22:24:07 +02:00
Martin Baulig 2f61cd998f [Mono.Security]: Remove some unused Mono.Security.Interface classes. (#5509)
* [Mono.Security]: Remove some unused `Mono.Security.Interface` classes.

* Mono.Security.Interface: removed `IBufferOffsetSize` and `BufferOffsetSize`
  (these were not general-purpose BOS APIs, but depend on the internal
  `SecretParameters` class).

* Mono.Security.Interface: removed `SecretParameters`, `SecureBuffer`,
  `IMonoTlsEventSink`, `TlsBuffer` and `TlsMultiBuffer`.

* Bump API snapshot submodule
2017-09-06 20:56:11 +02:00
Bernhard Urban 79e94c43dc [amd64] fix tailcall insn size (#5483)
commit
https://github.com/mono/mono/commit/9a634c1810aad46d30a674f3a97ab263dcd4272e
introduces a regression for
https://github.com/mono/coreclr/blob/mono/tests/src/JIT/Methodical/Invoke/25params/25param1c.il

```
Testing method of 25 parameters, all of int data type, tail.call
mono-sgen(46435,0x7fff9d34b3c0) malloc: *** error for object 0x101045400: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Process 46435 stopped
* thread #1, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x00007fff945c915f libsystem_malloc.dylib`malloc_error_break
libsystem_malloc.dylib`malloc_error_break:
->  0x7fff945c915f <+0>: pushq  %rbp
    0x7fff945c9160 <+1>: movq   %rsp, %rbp
    0x7fff945c9163 <+4>: nop
    0x7fff945c9164 <+5>: nopl   (%rax)
(lldb) mbt
* thread #1
  * frame #0: 0x00007fff945c915f libsystem_malloc.dylib`malloc_error_break
    frame #1: 0x00007fff945c5e81 libsystem_malloc.dylib`szone_error + 406
    frame #2: 0x00007fff945c7925 libsystem_malloc.dylib`small_free_list_remove_ptr_no_clear + 766
    frame #3: 0x00007fff945c7cb2 libsystem_malloc.dylib`free_small + 881
    frame #4: 0x00000001004d2110 mono-sgen`monoeg_g_free(ptr=0x0000000101083c00) at gmem.c:66
    frame #5: 0x0000000100007b64 mono-sgen`mono_codegen(cfg=0x000000010108c800) at mini.c:2300
    frame #6: 0x000000010000aedf mono-sgen`mini_method_compile(method=0x0000000100910310, opts=370239999, domain=0x000000010090ebd0, flags=JIT_FLAG_RUN_CCTORS, parts=0, aot_method_index=-1) at mini.c:3829
    frame #7: 0x000000010000edd0 mono-sgen`mono_jit_compile_method_inner(method=0x0000000100910310, target_domain=0x000000010090ebd0, opt=370239999, error=0x00007fff5fbfe048) at mini.c:4156
    frame #8: 0x000000010001459e mono-sgen`mono_jit_compile_method_with_opt(method=0x0000000100910310, opt=370239999, jit_only=0, error=0x00007fff5fbfe048) at mini-runtime.c:2127
    frame #9: 0x0000000100013e6d mono-sgen`mono_jit_compile_method(method=0x0000000100910310, error=0x00007fff5fbfe048) at mini-runtime.c:2173
    frame #10: 0x0000000100131eea mono-sgen`common_call_trampoline(regs=0x00007fff5fbfe128, code="H\x8bй\x01", m=0x0000000100910310, vt=0x0000000000000000, vtable_slot=0x0000000000000000, error=0x00007fff5fbfe048) at mini-trampolines.c:704
    frame #11: 0x00000001001313b7 mono-sgen`mono_magic_trampoline(regs=0x00007fff5fbfe128, code="H\x8bй\x01", arg=0x0000000100910310, tramp="����\b\x10\x03\x91") at mini-trampolines.c:835
```

turns out we smashed our code buffer.

Also, transform this comparison:

```
if (G_UNLIKELY (offset > (cfg->code_size - max_len - EXTRA_CODE_SPACE))) {

if (G_UNLIKELY ((offset + max_len + EXTRA_CODE_SPACE) > cfg->code_size)) {
```

we deal with unsigned values here, and if `max_len` is bigger then
`cfg->code_size`, we won't resize the buffer.
2017-09-06 14:28:20 +02:00
Armin Hasitzka fc524c4756 Interlock inflated_signatures_size, memberref_sig_cache_size, methods_size and signatures_size (#5489)
[TSan] Interlocking loader.c

`loader.c` contains four statistics counters and all of them are invovled in data races. This PR focuses on dealing with them:

- All of them can be `gint32` as they are registered as `MONO_COUNTER_INT` anyways.
- Since there is already a lot of locking involved in `loader.c` (including an approved usage of `Interlocked* ()` with with `mono_stats`), I think that `Interlocked* ()` can be used here instead of `Unlocked* ()`. If this assumption is wrong, I would kindly ask to correct me by commenting the affected rows and I will change it to `Unlocked* ()`.
2017-09-06 14:16:02 +02:00
Zoltan Varga 586d10d3ab [bcl] Use RuntimeHelpers.GetHashCode () for getting the hash code of … (#5511)
* [bcl] Use RuntimeHelpers.GetHashCode () for getting the hash code of the delegate target to avoid calling user defined hash code implementations which can throw exceptions. Fixes a regression introduced by a48bc43985.

* add test for #59235

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

* [fixup] RuntimeHelpers.GetHashCode handles null
2017-09-06 13:56:37 +02:00
Zoltan Varga a78a103fcb [sdb] Don't set tls->context when interrupting a thread, it could race with the thread processing a breakpoint at the same time. Fixes #58612. 2017-09-06 13:56:02 +02:00
Neale Ferguson 1cba9d8748 Add z14 support and extend z13 support 2017-09-06 12:09:13 +02:00
Rodrigo Kumpera 0f0b9c2913 [utils] Fix inet_pton fallback. 2017-09-05 14:28:37 -07:00
Niklas Therning 95f0800520 Wait for the native thread to die in Thread.Join() on Windows
This is the behavior of .NET. After this patch the code on Mono for Windows
will make sure the underlying native thread of a managed thread has died
before Thread.Join() returns.

This PR builds on PR #5454 but makes it Windows specific. PR #5454 was
reverted since it caused crashes on some Unix platforms.
2017-09-05 11:18:59 +02:00
Vladimir Kargov 90450cc148 [ci] Add the coverage collection script. 2017-09-04 16:34:30 -07:00
Marek Safar 6a95fac6d3 More codeowners update 2017-09-04 19:20:03 +02:00
cherusker e2a86a54f1 Use Unlocked* () for operations on joinable_thread_count
- mark the (harmless) data race of the fastpath
2017-09-04 14:06:01 +02:00
cherusker 57ae02b1c5 Fix racy counter and unify the styles 2017-09-04 11:30:11 +02:00
HinTak 9cba093c63 Clarifying the usage of the --library option
I found that multiple libraries need to be specified in dependency order. That was not obvious from the man page. Make it explicit.

See https://bugzilla.xamarin.com/show_bug.cgi?id=59154
2017-09-02 00:24:40 +02:00
Alexander Köplinger 29017b48d3 [ci] Retry flaky tests only on PRs (#5492)
So we can still see failures in master and release branches.
2017-09-02 00:10:40 +02:00
Rodrigo Kumpera aaf5672018 [wasm][sgen] Introduce DEFAULT_SWEEP_MODE, move DEFAULT_MAJOR to sgen-config.h and make wasm defaults serial. 2017-09-01 14:52:55 -07:00
Rodrigo Kumpera dbf3a44282 [wasm] Wasm actually has inet_pton but configure doesn't detect it. 2017-09-01 14:52:54 -07:00
Rodrigo Kumpera 4eafc3169f [wasm] Make sure we don't use the posix dl backend with wasm 2017-09-01 14:52:54 -07:00
Rodrigo Kumpera 06fcf41eae [wasm] Disable posix threading backend and fix wasm's. 2017-09-01 14:52:53 -07:00
Rodrigo Kumpera 770ea93292 [wasm] Move RETURN_ADDRESS macros to mini.h, use them in mini-exceptions.h and add wasm version. 2017-09-01 14:52:52 -07:00
Rodrigo Kumpera 13486d308d [runtime] Replace a mono_class_vtable with mono_class_vtable_full. 2017-09-01 14:52:51 -07:00
Rodrigo Kumpera cfed4f7710 [wasm] Fix eglib issues with WASM. 2017-09-01 14:52:28 -07:00
Rodrigo Kumpera 9df8e7db13 Merge pull request #5486 from kumpera/fix_array_dispatch_perf
[mini] Handle magic interfaces in common_trampoline as if they were variant.
2017-09-01 16:50:40 -04:00
Ludovic Henry fcf0cfbe75 [mini] Remove never defined MONO_ARCH_STACK_GROWS_UP (#5491) 2017-09-01 13:49:29 -04:00
Rodrigo Kumpera e64e3dbaca [mini] Handle magic interfaces in common_trampoline as if they were variant.
With the introduction of magic array interfaces, they must be handled as if they
were variant if they are being dispatched against an array.

This was not being done in common_trampoline and resulted in the IMT thunk never
getting rebuilt and getting decent perf.

With this patch, dispatch to simple methods such as Array::Count over a magic interface
in a covariant case (such as IList<object> dispatch onto string[]) will accrue gvi's.

On a trivial benchmark of executing Count 1M times, perf goes from 760ms to 50ms.
2017-09-01 09:06:53 -07:00
Armin Hasitzka 78ef7aea9a Improve class.c for TSan instrumentation: (#5485)
- use `Unlocked* ()` for `class_gparam_count`, `classes_size` and `inflated_methods_size`
- dead code: `class_ext_size`
- fix a typo: "the the" -> "let the"
2017-09-01 09:44:25 -04:00
Zoltan Varga 55dce78066 [bockbuild] Blacklist more llvm libraries/binaries. (#5488) 2017-09-01 09:42:25 -04:00
Alexander Köplinger 8d1bacae0d [ci] Reenable xunit tests on Windows (#5487)
Should be fixed now that https://github.com/mono/mono/pull/5477 was merged.
2017-09-01 14:51:43 +02:00
Egor Bogatov bc83d048ba Merge pull request #5444 from hifi/fix-tds-inputoutput
[System] Fix TDS 7.0 prepared InputOutput parameter info
2017-09-01 11:41:49 +03:00
HinTak df92047580 mkbundle: add console confirmations of actions (#5457)
Almost all the other "maker.Add()" are accompanied by console messages, except these two. User might worry about why they are missing. (I did!)
2017-09-01 10:29:25 +02:00
HinTak 2852d49c3b Fixing another confusing typo
The file being added is the config of the last assembly read, not the runtime name.
2017-09-01 10:27:17 +02:00
EgorBo 0e0c7b33f0 update comment 2017-09-01 10:26:08 +02:00
EgorBo 3686ea4022 xunit on windows doesn't like ln to xunit.execution.desktop.dll, provide a copy 2017-09-01 10:26:08 +02:00
Aleksey Kliger 7b759ee9d3 [w32file] Add 'kbfuse' filesystem type to known drive types array.
It's the https://keybase.io desktop client filesystem
2017-08-31 18:28:47 -04:00
Ludovic Henry 078463fa1f [socket] Reduce handle manipulations in native (#5378) 2017-08-31 13:21:29 -04:00
Marek Safar 118a5c70ed Merge pull request #5479 from marek-safar/cecil-bump
Bump cecil and linker
2017-08-31 19:13:04 +02:00
monojenkins 5a25467be0 Bump API snapshot submodule 2017-08-31 17:10:57 +00:00
Alexander Köplinger 7455e7cffc Add retrying of failed tests by default to reduce flaky tests (#5461)
Whenever a test fails we retry it five times and then decide the
overall result based on that. If three or more of the five retries
fail too then the overall result is FAIL, two or lower means PASS.

We're modifying nunitlite here so this only works for those tests
right now, we'd need to add it to the other test runners too.
2017-08-31 17:04:23 +02:00
Aleksey Kliger 0eb6e77c84 [cominterop] Get function ptr from interface before switching to blocking
The cominterop_get_function_pointer icall has a wrapper which has a
trampoline.  When we enter the trampoline mono_marshal_emit_native_wrapper
already switched us to blocking.
2017-08-31 10:42:19 -04:00
Aleksey Kliger 0270871238 [marshal] Don't use a wrapper for mono_marshal_set_last_error
This fixes assertions due to d0e103fcb4 in
cooperative GC mode.

mono_marshal_set_last_error is called from a P/Invoke wrapper just after the
pinvoked method returns before we transition the thread state back to running
from blocking.  If mono_marshal_set_last_error had a wrapper, we would invoke
the trampoline (mono_magic_trampoline) to JIT the wrapper while in blocking
mode, which would trigger the assertion.
2017-08-31 10:42:19 -04:00
Zoltan Varga a7f706251b [llvm] Add support for building with more recent versions of the mono llvm branch, in particular https://github.com/mono/llvm/tree/2017-07-06-5a1ffa96376e8a3ee895b782790591e5e7814ccf, which is based on llvm 5.0. (#5474) 2017-08-31 08:51:47 -04:00
Marek Safar 5179bbe40c Bump cecil and linker 2017-08-31 14:34:11 +02:00
Zoltan Varga 1904650288 [sdb] Fix support for async debugging in optimized mode, roslyn generates valuetype IAsyncStateMethod implementations. Fixes #58728. (#5476) 2017-08-31 07:17:02 -04:00
Alexander Köplinger e7a2d94f75 [bcl] Fix a few hardcoded socket ports in tests (#5471)
* [System] Fix a few hardcoded socket ports in tests

Those could've shown up as "address already in use" in CI.

* [System.Runtime.Remoting] Fix a few hardcoded socket ports in tests

Those could've shown up as "address already in use" in CI.

Additionally remove a copy of RemotingServicesTest.cs from corlib
which also exists in System.Runtime.Remoting in updated form.

* [System.ServiceModel] Fix a few hardcoded socket ports in tests

Those could've shown up as "address already in use" in CI.

* [System.Net.Http] Fix a few hardcoded socket ports in tests

Those could've shown up as "address already in use" in CI.

The additional "keep-alive" header in Send_Complete_NoContent() and
Send_Transfer_Encoding_Chunked() is because we were using the same
port for all tests before so other tests would clear the header.
This doesn't happen now that we use distinct test ports.

* [System.ServiceModel.Web] Fix a few hardcoded socket ports in tests

Those could've shown up as "address already in use" in CI.
2017-08-31 10:53:35 +02:00
Rodrigo Kumpera 55316a442f [wasm] Hack around AC_CHECK_SIZEOF bug and don't hardcode -Os in CFLAGS 2017-08-30 16:30:36 -07:00
Alexander Köplinger 2439f17bef Revert "Merge pull request #5330 from alexanderkyte/dedup_mkbundle"
This reverts commit 9a287c0412, reversing
changes made to 4a79280b3b.

It breaks tons of tests.
2017-08-31 00:41:53 +02:00
Alexander Kyte 9a287c0412 Merge pull request #5330 from alexanderkyte/dedup_mkbundle
[runtime] Add Dedup Support to MkBundle
2017-08-30 15:59:18 -04:00
Martin Baulig 4a79280b3b [Mono.Security]: Add 'MonoTlsProvider.SupportsCleanShutdown' and 'MonoTlsSettings.SendCloseNotify'. (#5465)
Only send close_notify when using BTLS and explicitly requested via 'MonoTlsSettings.SendCloseNotify'.
2017-08-30 13:43:36 -04:00
Alexander Kyte 6f270b372a [runtime] Document mkbundle AOT options in man pages 2017-08-30 12:55:35 -04:00
Alexander Kyte 2691372e86 [runtime] Fix tracking of dedup module in mkbundle 2017-08-30 12:55:24 -04:00
Alexander Kyte 9a5b75e2ba [runtime] Add mkbundle support for dedup 2017-08-30 12:55:11 -04:00
Alexander Kyte f36b03e6f0 [runtime] Clean up temp mkbundle aot directory 2017-08-30 12:55:03 -04:00
Alexander Kyte 780ef740ed [runtime] Fix mkbundle internationalization test results, build all 2017-08-30 12:54:51 -04:00
Alexander Kyte 15332a240a [runtime] Provide config to mkbundle 2017-08-30 12:54:50 -04:00
Alexander Kyte b07d50c929 [runtime] Don't re-aot when running BCL tests 2017-08-30 12:54:49 -04:00
Alexander Kyte 3802e3de1b [runtime] Skip not supported tests with mkbundle 2017-08-30 12:54:49 -04:00
Alexander Kyte ac1ce7eb4d [runtime] Build stripper and use with mkbundle
Preliminary linker support ran into dependency-finding bug
with the monolinker.exe binary. Fix postponed until later.
2017-08-30 12:54:48 -04:00
Alexander Kyte 0b0905f4de [runtime] Add target to mkbundle all tests before CI 2017-08-30 12:54:48 -04:00
Alexander Kyte a4edbde01e [runtime] Move testing dll into profile 2017-08-30 12:54:47 -04:00
Alexander Kyte c872e0a100 [runtime] Fix in-tree building for mkbundle 2017-08-30 12:54:47 -04:00
Alexander Kyte 2c71963d23 [runtime] Skip building System.Security, System.IdentityModel tests on testing_aot_full 2017-08-30 12:53:00 -04:00
Alexander Kyte f915204116 [runtime] Use mkbundle in BCL tests 2017-08-30 12:52:51 -04:00
Alexander Kyte a7154726a3 [runtime] Fix path resolving for mkbundle 2017-08-30 12:52:42 -04:00
Alexander Kyte c7046b9e9e [runtime] Add new dedup interface to mkbundle 2017-08-30 12:52:33 -04:00
Alexander Kyte 63b369e735 [runtime] Fix mkbundle compilation on OSX 2017-08-30 12:52:23 -04:00
Alexander Kyte ca29da6e2b [runtime] Enable compiling aot with mkbundle 2017-08-30 12:52:14 -04:00
Alexander Kyte b81693d648 [runtime] Add aot arguments to mkbundle 2017-08-30 12:52:03 -04:00
Armin Hasitzka d278834cd7 Update Clang's ThreadSanitizer blacklist (#5467) 2017-08-30 12:16:20 +02:00
Alexander Köplinger 687cb5d680 Bump api-snapshot 2017-08-30 12:00:12 +02:00
Joshua Peterson ee6f89642d Call g_utf8_to_utf16 with a proper argument (#5470)
* The sizes of `glong` and `gsize` differ on 64-bit Windows.
* In order to avoid uninitialized data in the high four bytes of the `bytes` argument to `mono_unicode_from_external`, call `g_utf8_to_utf16` with a `glong`, then copy the result.
2017-08-30 05:59:57 -04:00
Marek Safar 6649f23b27 Merge pull request #5469 from marek-safar/ilasm
[ilasm] Adds AggressiveInlining support
2017-08-29 23:04:53 +02:00
Alexander Köplinger c603a69e7d Revert "[runtime] Wait for the thread to really exit in Thread.Join (). (#5454)"
This reverts commit ec30afd9dc.

It causes test failures on s390x.
2017-08-29 22:05:12 +02:00
Alexander Köplinger c05d7a78f8 Revert "[llvm] Add support for building with more recent versions of the mono llvm branch, in particular https://github.com/mono/llvm/tree/2017-07-06-5a1ffa96376e8a3ee895b782790591e5e7814ccf, which is based on llvm 5.0. (#5408)"
This reverts commit f01f854818.

It broke a bunch of tests with llvm.
2017-08-29 21:45:59 +02:00
Marek Safar 5b612c5dc5 [PEAPI] Don't add mscorlib reference when no type needs it 2017-08-29 19:51:08 +02:00
Marek Safar 50490aaa7f [ilasm] Adds noautoinherit option 2017-08-29 19:51:08 +02:00
Marek Safar 0290d19c83 [ilasm] Adds AggressiveInlining support 2017-08-29 15:51:55 +02:00
Alexander Köplinger 5479e0669f Remove leftover targets from Makefile.am (#5466)
win32getdeps and win32setup don't apply anymore.
2017-08-29 09:18:43 +02:00
Zoltan Varga f01f854818 [llvm] Add support for building with more recent versions of the mono llvm branch, in particular https://github.com/mono/llvm/tree/2017-07-06-5a1ffa96376e8a3ee895b782790591e5e7814ccf, which is based on llvm 5.0. (#5408) 2017-08-28 21:42:39 -04:00
Zoltan Varga ec30afd9dc [runtime] Wait for the thread to really exit in Thread.Join (). (#5454) 2017-08-28 21:38:29 -04:00
Zoltan Varga 1a5ddd80ed [sgen] Move the mono_gchandle_ functions to sgen-mono.c for consistency, add sgen_gchandle () functions instead. (#5460) 2017-08-28 21:37:08 -04:00
Zoltan Varga 3fc452230d [sdb] Make the IL in dtest-excfilter.il valid. (#5463) 2017-08-28 21:36:42 -04:00
Zoltan Varga 9a634c1810 [amd64] Make code patching smp safe for the case where we emit a mov + call_reg. Hopefully fixes #57959. (#5452) 2017-08-28 04:37:53 -04:00
Bernhard Urban a2cf047226 [gc counters] avoid using Interlocked*64 functions as they are broken on some arches (#5451)
They are implemented via a global lock, which can lead to deadlooks in
some situations, e.g.

```
-0  0xb6c92e14 in sigsuspend () from /lib/arm-linux-gnueabi/libc.so.6
-1  0x0043f3b4 in suspend_signal_handler (_dummy=35, info=0xb4afe6d0, context=0xb4afe750) at mono-threads-posix-signals.c:177
-2  <signal handler called>
-3  0xb6de6bc4 in __pthread_mutex_unlock_usercnt () from /lib/arm-linux-gnueabi/libpthread.so.0
-4  0x00440f00 in InterlockedCompareExchange64 (dest=0x530700 <worker+64>, exch=0, comp=0) at atomic.c:578
-5  0x002f228c in InterlockedRead64 (src=0x530700 <worker+64>) at ../../mono/utils/atomic.h:398
-6  0x002f29a0 in COUNTER_READ () at threadpool-worker-default.c:194
-7  0x002f3320 in worker_park () at threadpool-worker-default.c:426
-8  0x002f3774 in worker_thread (unused=0x0) at threadpool-worker-default.c:488
-9  0x002e66b0 in start_wrapper_internal (start_info=0x0, stack_ptr=0xb4b00000) at threads.c:982
-10 0x002e6894 in start_wrapper (data=0x5a8f38) at threads.c:1044
-11 0xb6de31a8 in start_thread () from /lib/arm-linux-gnueabi/libpthread.so.0
-12 0xb6d3a1bc in ?? () from /lib/arm-linux-gnueabi/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 4 (Thread 0xb40ff440 (LWP 10198)):
-0  0xb6deb56c in __lll_lock_wait () from /lib/arm-linux-gnueabi/libpthread.so.0
-1  0xb6de584c in pthread_mutex_lock () from /lib/arm-linux-gnueabi/libpthread.so.0
-2  0x00440e6c in InterlockedCompareExchange64 (dest=0x559868 <gc_stats+8>, exch=2855648, comp=2844091) at atomic.c:570
-3  0x0039bdcc in InterlockedAdd64 (dest=0x559868 <gc_stats+8>, add=11557) at ../../mono/utils/atomic.h:392
-4  0x003a1b50 in collect_nursery (reason=0x5083f4 "Nursery full", is_overflow=0, unpin_queue=0x0) at sgen-gc.c:1865
-5  0x003a3794 in sgen_perform_collection (requested_size=4096, generation_to_collect=0, reason=0x5083f4 "Nursery full", wait_to_finish=0, stw=1) at sgen-gc.c:2539
-6  0x003a35f0 in sgen_ensure_free_space (size=4096, generation=0) at sgen-gc.c:2505
-7  0x00389db0 in sgen_alloc_obj_nolock (vtable=0xb4d174d0, size=64) at sgen-alloc.c:256
-8  0x0036e330 in mono_gc_alloc_vector (vtable=0xb4d174d0, size=64, max_length=12) at sgen-mono.c:1743
-9  0xb6c16a38 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
```

fixes https://bugzilla.xamarin.com/show_bug.cgi?id=59039
2017-08-28 07:57:00 +02:00
Alex Rønne Petersen c7c3baba31 Merge pull request #5459 from HinTak/patch-5
More informative g_error message
2017-08-28 00:17:21 +02:00
Alex Rønne Petersen 4fa03c425f Merge pull request #5458 from HinTak/patch-4
remove redundant duplicate word 'not'
2017-08-28 00:16:54 +02:00
HinTak 3dd754cbf8 More informative g_error message
Encountered this message while running the new mkbundle simple-cross functionality introduced recently. "Function not supported" is seen on both Mac OS X and Ubuntu. Will possibly file a separate bug since HAVE_MKDTEMP should be true... but it should be "Function mkdtemp not supported" in any case.
2017-08-27 22:55:11 +01:00
HinTak f26bf88250 remove redundant duplicate word 'not'
Found a consecutive 'not' pair while searching the code for somethng else.
2017-08-27 22:44:09 +01:00
Zoltan Varga 3b3b48dbb4 [runtime] Use the AC_FUNC_STRERROR_R() autoconf macro to distinguish between the two possible signatures for strerror_r (). (#5453) 2017-08-27 03:35:50 -04:00
Alex Rønne Petersen d605f45365 Merge pull request #5455 from HinTak/patch-1
Fixing confusing typos
2017-08-27 06:49:46 +02:00
HinTak ecd9af3f20 Fixing confusing typos
Fixing confusing typos - should be self-explanatory.
2017-08-27 12:21:59 +08:00
Zoltan Varga d0e103fcb4 [jit] Assert that the trampoline code is called in gc unsafe mode, throw exceptions by returning the exception to the assembly trampoline code and throwing it from there. (#5409) 2017-08-26 04:53:24 -04:00
Uri Simchoni 7263bfef55 [amd64] silence compiler warning (#5435)
Silence a GCC warning about param_regs and return_regs not being
used.
2017-08-25 23:24:47 -04:00
Alexander Köplinger ef83450ab0 [System] Disable SocketTest.SendAsyncFile for now (#5447)
It's one of the flaky tests that we have had for a very long time.

There's work in progress fixing it as part of
https://github.com/mono/mono/pull/5345 and https://bugzilla.xamarin.com/show_bug.cgi?id=43172
but I think we should disable it in the meantime for clean CI.
2017-08-25 21:58:52 +02:00
Alexander Köplinger ec9a95dd53 [configure.ac] Don't include the .build number in runtime-corlib version (#5449)
It's causing unnecessary complexity because we need to create a new
monolite when bumping the .build number in a major.minor.build
version like from 5.2.0 -> 5.2.1

corlib version bumps are very rare in those cases and even then
you can just increment the MONO_CORLIB_COUNTER variable.
2017-08-25 21:57:20 +02:00
Alex Rønne Petersen 5965357a59 [profiler] Correct the description of the 'legacy' option. 2017-08-25 21:06:36 +02:00
Martin Baulig efaec63cc8 [System]: Cleanup debugging and use the same technique from the new web stack. (#5441)
* Cleanup debugging and use the same technique from the new web stack.

* The MARTIN_DEBUG conditional has been renamed into MONO_TLS_DEBUG.

* Moved the actual implementation into MNS.MonoTlsProviderFactory.

* We now use an environment variable called 'MONO_TLS_DEBUG' to
  enable debugging (so to get debugging, you need to both compile with
  -define:MONO_TLS_DEBUG and set that environment variable).

The new web stack has a conditional and environment variable called
'MARTIN_WEB_DEBUG'.

* Use [Conditional] instead of #if.
2017-08-25 12:58:50 -04:00
monojenkins 4848d5a34c [msvc] Update csproj files (#5450) 2017-08-25 18:14:40 +02:00
Alexander Köplinger 5f523b92fc [man] Cleanup mentions of monocov in mono.1 (#5446)
Coverage support was added to the log profiler in a5ab6c642e
and the monocov profiler was removed with 1657026514.
2017-08-25 14:36:44 +02:00
Jonathan Chambers c6676b0ff8 Retrieve thread lazily and avoid special case for defer. We were trying to get thread when in defer mode even for EVENT_KIND_VM_DEATH and hitting assert since current thread was not available. (#5440) 2017-08-25 03:46:34 -04:00
Jonathan Chambers cfe7502c1c Ensure exception out argument is initialized to NULL. (#5424) 2017-08-25 03:38:11 -04:00
Toni Spets 62e2fcde73 [System] Fix TDS 7.0 prepared InputOutput parameter info
Fixes ParameterDirection.InputOutput type parameters not sending
the "output" modifier to server which creates a conflict resulting
in an exception server side.
2017-08-25 08:30:07 +03:00
Rodrigo Kumpera 7b5ec9f82c Merge pull request #5420 from nealef/z13v5
Add support for z13 processor
2017-08-24 16:58:08 -04:00
Martin Baulig 79c15b9ff0 [System]: Cleanup internal TLS APIs in preparation of adding renegotiation support. (#5426)
* [btls]: Bind new native APIs to support renegotiation.

* mono_btls_ssl_set_renegotiate_mode(), mono_btls_ssl_renegotiate_pending():
  New native methods.

* MonoBtlsSsl: Added SetRenegotiateMode() and RenegotiatePending().

* MonoBtlsSslRenegotiateMode: New internal enum.

* [System]: Cleanup internal Mono.Net.Security.MobileTlsContext APIs.

Use tuple `(int ret, bool wantMore)' return value instead of out variables.

* [System]: Check for pending exceptions in MobileAuthenticatedStream.

This should fix some issues where we're hanging instead of throwing
an exception if something went wrong.
2017-08-24 16:13:04 -04:00
Alex Rønne Petersen 53d0bba46c Merge pull request #5438 from cherusker/cherusker-2017-08-24-complete-prototype
[libtest] Complete the function prototype
2017-08-24 21:53:19 +02:00
Alex Rønne Petersen 75fd607a5c Merge pull request #5439 from alexrp/master
[profiler] Fix some stack imbalance issues due to missing method leave events.
2017-08-24 19:21:47 +02:00
Alex Rønne Petersen df4d89bd36 [profiler] Add a missing method_leave event for the CEE_MONO_RETOBJ opcode. 2017-08-24 17:08:49 +02:00
Alex Rønne Petersen 081280659a [profiler] Add a missing method_tail_call event when the tailc optimization is enabled. 2017-08-24 17:08:20 +02:00
cherusker 49c66e779a Complete the function prototype 2017-08-24 16:16:02 +02:00
Marek Safar 511a769fdd [mcs] Update logic when checking for tuple element names when overriding inherited member 2017-08-24 10:38:25 +02:00
Zoltan Varga d4390d6a12 Revert "[runtime] Fix a warning."
This reverts commit f99617537b.

Revert this as the original code was right, there is a problem with the defines.
2017-08-23 22:47:43 -04:00
Rodrigo Kumpera ff9a538941 [wasm] Add basic interpreter support for WebAssembly. 2017-08-23 16:05:01 -07:00
Rodrigo Kumpera a9107951a7 [mini] Add skeleton WebAssembly mini backend. It's not functional and some code needs to be shuffled to better places.
The wasm backend is inspired on the x86 one with a few key differences:

1) It assumes a different aot runtime will be used to deal with all the weirdness of wasm.
In particular, it can run under MONO_AOT_MODE_INTERP_LLVMONLY without an actual working AOT compiler.

2) It's the only non-ISA based backend, so lots of weird things.
Like, no registers or addressable stack - for realsies.
2017-08-23 16:04:58 -07:00
Rodrigo Kumpera b85f40ba88 [wasm] Add MONO_AOT_MODE_INTERP_LLVMONLY to MonoAotMode. This is what wasm+interpreter uses. 2017-08-23 16:04:49 -07:00
Rodrigo Kumpera 2e1afbd7b7 Merge pull request #5415 from kumpera/wasm-support
WebAssembly port
2017-08-23 19:03:16 -04:00
Rodrigo Kumpera 3b079a7939 [wasm] Don't define MONO_CROSS_COMPILE in the wasm configure.ac 2017-08-23 13:57:18 -07:00
Rodrigo Kumpera 98f4ec3ab6 [utils] Fix mono_valloc and mono_valloc_aligned malloc-based implementation. 2017-08-23 13:57:17 -07:00
Rodrigo Kumpera 9719dd2343 [wasm] Add wasm stubs for object-offsets and sgen-archdep. 2017-08-23 13:57:08 -07:00
Rodrigo Kumpera 6e31e14ba3 [wasm] Add wasm strings to mono-config.c 2017-08-23 13:57:06 -07:00
Rodrigo Kumpera 63795c0ce8 [wasm] Add comments explaining the magic strings in mono-dl-wasm.c 2017-08-23 13:57:05 -07:00
Rodrigo Kumpera 282eac6c91 [readme] Document --enable-wasm 2017-08-23 13:57:04 -07:00
Rodrigo Kumpera 1a621cfcf1 [wasm] Add threading, dl and hwcap support for wasm. 2017-08-23 13:56:55 -07:00
Neale Ferguson c007d6e0ad Remove unnecessary ifdefed code 2017-08-23 20:42:49 +02:00
Neale Ferguson 8808f52690 Skip load if same register 2017-08-23 20:42:48 +02:00
Neale Ferguson 1854763e83 Add support for z13 processor
The z13 supports some useful instructions that can be exploited
by the JIT. Most notably the compare-and-branch instructions can
reduce a two instruction sequence to one. The load-and-add command
eliminates the more complex compare-and-swap sequence.

The z13 also supports three operand instructions dst,src1,src2
which eliminate checks and loads for instructions like add and subtract.

The unaligned.cs test has been changed to cater for big-endian platforms.
For s390x only, the --trace option will result in a file per thread
being created rather than the traces being written to stdout and
sometimes intermixing incomplete trace entries.
2017-08-23 20:42:47 +02:00
Armin Hasitzka 787faec004 [TSan] Unlocking MonoStats, GCStats and JITGCStats (#5381)
[TSan] Unlocking MonoStats, GCStats and JITGCStats

As the `Unlocked* ()` functions have been approved in https://github.com/mono/mono/pull/5310, I used them to blacklist some of the most obvious counting variables whose data races should be ignored: `MonoStats`, `GCStats` and `JITGCStats` (more to follow if approved).

Please find details about all changes within the commit messages.
2017-08-23 19:50:34 +02:00
Marek Safar a716f5d143 [threadpool] Reduce logging verbosity level. Fixes #58829 2017-08-23 09:48:44 +02:00
Elastino 07d0a7b9f9 Added compile target option as library
Added -t:library since mcd does not interpret output filename for dll suffix.
Without -t:library option, it fails to compile.
{code}
mono$ mcs -debug+ -r:System.Core Options.cs -o:Mono.Options.dll
error CS5001: Program `Options.exe' does not contain a static `Main' method suitable for an entry point
Compilation failed: 1 error(s), 0 warnings
{code}
2017-08-23 09:22:34 +02:00
Alexander Köplinger cbb4ec0c88 Merge pull request #5423 from vargaz/workaround-58901
[runtime] Disable a test which asserts because of an abi break in rec…
2017-08-23 02:04:18 +02:00
Zoltan Varga 7c8acc226b Revert "Disable pinvoke2.exe test on OSX i386 for now (#5411)"
This reverts commit 4d89d5f17b.

Revert this as the problematic test is disabled in libtest.c.
2017-08-22 16:53:01 -04:00
Zoltan Varga 4188f5db54 [runtime] Disable a test which asserts because of an abi break in recent xcode/clang versions. Works around #58901. 2017-08-22 16:52:52 -04:00
Rogier Hofboer 2979bc8ba6 [Mono.Security] Bugfix of bug 23153. Certificate loop variable not used to find certificate 2017-08-22 16:41:48 +02:00
Jo Shields da9287e432 [msi] Fix typos in f9bdab7928 2017-08-22 10:18:20 -04:00
Infko fc684ff839 [Syndication]Fix Runtime crash when parsing pubTime in RFC822 format (#5416) 2017-08-22 15:11:43 +02:00
Alexander Köplinger 3c9cac96f8 [bcl] Remove unused left over .args files 2017-08-22 15:09:20 +02:00
Alexander Köplinger 27877d7103 [MacSDK] Whitelist the csi script 2017-08-22 12:49:54 +02:00
markusbeth 65e759e4a3 enable some tests for System.Text.UnicodeEncoding (#5414)
Remove attribute Category ("NotWorking") from tests GetString_Odd_Count_0
and GetString_Odd_Count_ff as they are now working.
2017-08-22 02:49:37 +02:00
Rodrigo Kumpera ad22cdbbd2 [utils] Fix atomic fallout implementation function naming. 2017-08-21 15:31:05 -07:00
Rodrigo Kumpera 61529745be [wasm] Add wasm stubs for MonoContext and membar ops. 2017-08-21 15:30:16 -07:00
Rodrigo Kumpera bb123c5de8 [WASM] Hack configure.ac to support wasm. Use --enable-wasm instead of --host / --target 2017-08-21 15:14:43 -07:00
Rodrigo Kumpera a04f104093 Merge pull request #5406 from kumpera/fix_12157
[verifier] Base constructors can only be called on uninit'd this pointers. Fix #12157.
2017-08-21 16:18:31 -04:00
Rodrigo Kumpera ffc96812e1 Merge pull request #5407 from kumpera/fix_31225
[pedump] Have the assembly search hook look at the same directory of the assembly being verified.
2017-08-21 16:04:06 -04:00
Alexander Köplinger 3cd3c4d53e Fix method-access.exe test (#5412)
The exception message of a MethodAccessException was changed in 7b88115737.
This caused the method-access.exe test to fail since it checked for the old format.
2017-08-21 17:33:40 +02:00
Alexander Köplinger 4d89d5f17b Disable pinvoke2.exe test on OSX i386 for now (#5411)
Reenable once https://bugzilla.xamarin.com/show_bug.cgi?id=58901 is fixed.
2017-08-21 17:09:06 +02:00
Jo Shields f9bdab7928 [msi] Pull in MSI changes from Mono 5.2 branch
(cherry picked from commit 929575bb0e)
2017-08-21 10:02:15 -04:00
Alexander Köplinger 538829f456 Bump libgdiplus (#5393) 2017-08-21 15:28:44 +02:00
Alexander Köplinger f567c2e5eb Bump timeout for TaskTests.Delay_Simple (#5410)
Should be reverted once https://bugzilla.xamarin.com/show_bug.cgi?id=58877 is investigated and fixed.
2017-08-21 13:45:58 +02:00
Marek Safar 5f7abc5f9d Use absolute paths to avoid ambiguity 2017-08-21 13:04:34 +02:00
Marek Safar f9d0b2f758 CODEOWNERS update 2017-08-21 10:45:49 +02:00
Jonathan Chambers 1cfd52452a Add null check for target to optimized delegate constructor code path. Fixes case 58888 (#5404) 2017-08-18 21:34:29 -04:00
Alexander Köplinger 8b43a1dd6a Update CODEOWNERS 2017-08-19 02:40:54 +02:00
Miguel de Icaza fd1d5997b0 Remove lingering bits from removed prj2make tool (#5405) 2017-08-19 02:05:32 +02:00
Rodrigo Kumpera bb2eff506a [pedump] Have the assembly search hook look at the same directory of the assembly being verified.
Unfortunately using mono_set_assemblies_path is not much of an option as it disables the MONO_PATH env var
and that's needed when working with an in-tree pedump - cuz having to `make install` all the time is BS.
2017-08-18 15:42:17 -07:00
Rodrigo Kumpera 02ca93318b [verifier] Base constructors can only be called on uninit'd this pointers. Fix #12157. 2017-08-18 15:00:45 -07:00
Marek Safar d3adf63e13 More codeowners updates 2017-08-18 23:13:58 +02:00
Rodrigo Kumpera e91a66fc94 Merge pull request #5396 from kumpera/fix_11696
[verifier] Check methodimpl table for duplicated. Fixes #11696
2017-08-18 13:04:34 -07:00
Rodrigo Kumpera 7b88115737 Merge pull request #5397 from kumpera/fix_41279
[runtime] Format MethodAccessException method names to use the same formating as reflection. Fixes #41279
2017-08-18 13:04:08 -07:00
vkargov 25436acaa9 [jit] Don't emit a redundant move in lazy fetch trampolines on AMD64. (#5346) 2017-08-18 11:09:30 -04:00
Aleksey Kliger 616fab4469 [threads] Use designated initializer syntax in MAKE_SPECIAL_STATIC_OFFSET
Originally we used a C90-style struct initializer `{ (index), (offset), (type)
}`.  Unfortunately, SpecialStaticOffset is defined with fields in a different
order on big-endian and little-endian machines.  Using a designated
initializer, we don't have to care about the order.
2017-08-18 09:52:09 -04:00
Rodrigo Kumpera f2a6335118 [runtime] Format MethodAccessException method names to use the same formating as reflection. Fixes #41279
Add mono_method_get_reflection_name that returns the string managed is expecting.
2017-08-17 15:47:27 -07:00
Rodrigo Kumpera fc6e8a27fc Merge pull request #5390 from kumpera/fix_58637
[corlib] When parsing the ECMA key, don't produce a public key. Fixes #58637
2017-08-17 18:37:16 -04:00
Alexander Köplinger eecf2d99e2 Bump bockbuild to remove gtk+ screen patch 2017-08-17 21:12:30 +02:00
Rodrigo Kumpera 04a6c2c987 [runtime] Don't set pkey to a value that will be freed immediately after. 2017-08-17 11:33:37 -07:00
Rodrigo Kumpera 966864c7a8 update CODEOWNERS 2017-08-17 11:01:04 -07:00
Rodrigo Kumpera e3e77d628a [verifier] Check methodimpl table for duplicated. Fixes #11696 2017-08-17 10:52:21 -07:00
Ludovic Henry ab90246c67 [marshal] Rethrow in native-to-managed wrapper to keep exception stacktrace (#5384)
* [marshal] Rethrow in native-to-managed wrapper to keep exception stacktrace

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

* [interp] disable tests for 58782 as they rely on appdomains
2017-08-17 19:11:23 +02:00
Ludovic Henry 91288cad6a [w32error] Add ENODEV -> ERROR_DEV_NOT_EXIST error translation (#5385)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58738
2017-08-17 19:03:40 +02:00
Alexander Köplinger 2536266232 Bump bockbuild 2017-08-17 18:46:12 +02:00
Eberhard Beilharz 9cfadcb38f [SWF] Fix string drawing truncation in combo boxes
This fixes Xamarin-10321. This change fixes the problem in SWF rather
than in libgdiplus which has the advantage that it works with both
Cairo and Pango renderers.

Without the additional NoWrap flag the text will wrap at a word boundary,
which results in the combo box showing lines with potentially a lot of
empty space at the end. With the NoWrap flag we render only one line,
displaying as many characters as possible in that one line.
2017-08-17 10:33:18 +02:00
Armin Hasitzka aa7cd58fb8 Use the Unlocked* () functions to blacklist specific load / store operations (#5387)
- avoid blacklisting whole functions with `MONO_NO_SANITIZE_THREAD`
- change `long` to `gint64` as it is more portable
2017-08-17 09:54:26 +02:00
Rodrigo Kumpera e1518daf9d [corlib] When parsing the ECMA key, don't produce a public key. Fixes #58637
The key was incorrectly encoded and triggered heap corruption.
2017-08-16 16:47:10 -07:00
Ludovic Henry 6e30ded242 [corlib] Increase timeout for MonoTests.System.Runtime.Remoting.TestSynchronizationReleasedOnMultipleAcquire (#5373) 2017-08-16 22:21:13 +02:00
Alexander Köplinger a9ffb3da97 Bump bockbuild 2017-08-16 19:09:28 +02:00
Marek Safar 6223a90aa0 Update list of denied assemblies 2017-08-16 13:15:41 +02:00
Rodrigo Kumpera d67c6000ce Merge pull request #5382 from kumpera/pedump_fix
Address pedump issues from https://bugzilla.xamarin.com/show_bug.cgi?id=58168
2017-08-15 21:58:17 -07:00
Ankit Jain 16eadad7d3 [msbuild] bump to xplat-master branch HEAD 2017-08-15 23:52:54 -04:00
Ankit Jain 823bca4aed [msbuild] Install a deniedAssembliesList.txt to support denied ... (#5358)
... assemblies.

msbuild tries to filter out the denied assemblies, which mono refuses to
load, during a build. It uses the `deniedAssembliesList.txt` installed
to `$mono_prefix/lib/mono/xbuild` to identify them.

This was generated with:

 `$ mono tools/nuget-hash-extractor/nuget-hash-extractor.exe nugets guids_for_msbuild > mcs/tools/xbuild/data/deniedAssembliesList.txt`

This file needs to be kept in sync with any changes in the assemblies
denied by the runtime.

msbuild PR that adds support for this -
https://github.com/mono/msbuild/pull/23 .
2017-08-15 23:51:29 -04:00
Ankit Jain 45ca7b3851 [msbuild] bump to xplat-master branch HEAD 2017-08-15 22:56:03 -04:00
Rodrigo Kumpera c385035a80 [verifier] Add workaround for verifying corlib and valid-only output. 2017-08-15 14:56:09 -07:00
Rodrigo Kumpera b5546715f6 [verifier] Handle csc encoding of enums in cattr blobs. Fixes #58168. 2017-08-15 14:54:47 -07:00
Rodrigo Kumpera 83e71411ab [runtime] Add WINDOWS_RUNTIME type attribute that csc generates 2017-08-15 14:53:17 -07:00
Rodrigo Kumpera 4fe8b900a7 [verifier] Avoid double init of metadata when using pedump.
This is a workaround for the larger problem of it using a non-standard init sequence.

Tracked as https://bugzilla.xamarin.com/show_bug.cgi?id=58793
2017-08-15 14:32:38 -07:00
Rodrigo Kumpera 97bc10361b [verifier] Partially revert 6d37ffdf53. It adds internal a header to a public one. 2017-08-15 14:28:21 -07:00
Marek Safar c603ce5df5 netstandard dependant facades update after 2.0 release (#5371) 2017-08-15 23:14:36 +02:00
Aaron Bockover 97f42f6046 mkbundle: avoid NREs and print useful errors
When scanning for references, emit an error when loading the assembly
into the universe fails or when loading a referenced assembly by
name fails.
2017-08-15 23:08:06 +02:00
Ankit Jain ca0c2f51b7 [msbuild] bump to help debug wrench build failure 2017-08-15 16:39:51 -04:00
Martin Baulig 83020f1270 Add scripts/csi to .gitignore. 2017-08-15 13:25:00 -04:00
Martin Baulig 9b8bb0edbe Cosmetic; remove unnecessary cast and fix compiler warning. 2017-08-15 13:12:47 -04:00
Martin Baulig 093915cf83 [System]: Fix minor leaks in AppleTls. (#5369)
These should be automatically collected by the GC, but explicitly disposing
will keep memory usage more stable over time and keep pressure off the GC.
2017-08-15 13:08:12 -04:00
Martin Baulig c74f44126e [System]: Fix major AppleTls memory leak. Bug #56814. (#5370) 2017-08-15 13:00:18 -04:00
Zoltan Varga 9ba3fa0ba3 [runtime] Use HOST_ defines instead of PLATFORM_ defines. (#5362) 2017-08-15 11:16:48 -04:00
Rodrigo Kumpera b89b696e71 Merge pull request #5355 from kumpera/fix_58379
[mini] Emit widen ops when storing to locals of size < 4. Fixes #58379.
2017-08-14 21:38:40 -04:00
Ankit Jain 746d97a043 [msbuild] bump to help debug wrench build failure 2017-08-14 21:07:15 -04:00
Alexis Christoforides 1413e21a63 [MacSDK] Update bockbuild to work around build/staging issue
Commit message: Allow for non-fatal shell execution, and turn “install_name_tool” staging failures to warnings as we find a more permanent solution to AOT dylibs not always having enough field space for the new path (all other dylibs made in the build with the XCode toolchain typically do, as they are built with the “-headerpad_max_install_names” flag.
2017-08-14 16:27:34 -04:00
Rodrigo Kumpera 1c97e98115 [mini] Add test for implicit widen on argument stores. 2017-08-14 13:22:20 -07:00
Aleksey Kliger 7a0979e2be [remoting] transparent proxy GetType of an interface should return the
interface Type, not MarshalByRefObject. (Fixes #17325)

If a RealProxy instance is created (using the protected RealProxy(Type)
constructor) for an interface, mono internally sets up a MonoRemoteClass which
looks like a proxy for a MarshalByRefObject instance that happens to implement
the given interface.  However mono_class_proxy_vtable just does a memcpy() to
setup the MonoVTable:type field of the transparent proxy's vtable.  That type
field is hit by the JIT when System.Object.GetType() is called - and on .NET
Framework GetType for a transparent proxy of an interface returns the interface
not (as Mono used to) typeof(MarshalByRefObject).

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=17325
2017-08-14 15:38:53 -04:00
Aleksey Kliger 0a58940696 [test] Add regression test for GetType() of a transparent proxy.
Check that calling GetType() on a transparent proxy of a RealProxy of an
interface returns that interface type.
2017-08-14 15:38:53 -04:00
Zoltan Varga f99617537b [runtime] Fix a warning. 2017-08-14 14:52:55 -04:00
Alexander Köplinger a9a08890cb Bump nuget to latest 4.3.0 release (#5368) 2017-08-14 19:27:13 +02:00
Alexander Köplinger e88178655b Bump nuget-buildtasks
Includes https://github.com/NuGet/NuGet.BuildTasks/pull/35
2017-08-14 14:15:18 +02:00
Zoltan Varga a622c9c8ce Fix a warning. 2017-08-14 00:28:50 -04:00
Alex Rønne Petersen 6bd6da1ae6 Merge pull request #5360 from urisimchoni/fix-mon
[profiler] Fix log profiler SetMonitorEvents icall
2017-08-13 13:56:09 +02:00
Uri Simchoni fe29d23c7d [profiler] Fix log profiler SetMonitorEvents icall
Set the right flag when enabling/disabling monitor
event profiling
2017-08-13 09:53:03 +03:00
Jonathan Chambers 537a24f852 Use eglib g_* allocators rather than malloc/calloc (#5359) 2017-08-12 10:54:01 -04:00
Alex Rønne Petersen 1f635c1532 [acceptance-tests] Increase the profiler-stress timeout to 9 hours.
msbiology seems to take longer than 8 hours on 32-bit OS X.
2017-08-12 16:37:03 +02:00
Zoltan Varga 8f0de0cbfb Bump roslyn-binaries. 2017-08-12 03:07:47 -04:00
Rodrigo Kumpera 5968ff1992 [jit] Add implicit widening of stores to args of types < 4 bytes.
This fix follows what was done for #58379 but for arguments.
2017-08-11 15:19:30 -07:00
Alexander Köplinger e6a2cb8763 [ci] Add CI_TAGS for apidiff and ms-test-suite
Easier to maintain than the "label" which could change depending on the bots.
2017-08-11 23:56:43 +02:00
Ankit Jain 43cec6c0dd Install Roslyn binaries, including msbuild tasks to msbuild/Roslyn (#5251)
.. directory, which is `$mono_prefix/lib/mono/msbuild/15.0/bin/Roslyn/`

Mono installs `csc.exe` but the corresponding
`Microsoft.Build.Tasks.CodeAnalysis.dll` required for supporting msbuild C#
projects is installed by msbuild. But these two can get out of sync,
like they did and had to be worked around in
https://github.com/mono/msbuild/pull/19 .

Instead, we now install all the relevant roslyn bits (C# and VB) from the same
source. Only the msbuild specific files are copied to the Roslyn folder.
VBCSCompiler, csi and their dependencies are symlinked from `lib/mono/4.5`.

Also:

- csi.exe is included since the tool is surfaced as an msbuild task,
  and that requires the *Scripting.dll assemblies.
- VBCSCompiler* - shared compiler is installed
- vbc.exe doesn't work on mono currently, so skipping that
- And `Microsoft.DiaSymReader.Native.{amd64,x86}.dll` are dropped.
2017-08-11 17:53:45 -04:00
Rodrigo Kumpera 242987b59b Address reviewer feedback. 2017-08-11 14:53:37 -07:00
Ankit Jain 13dc0bb2c2 [msbuild] Bump to xplat-master branch HEAD 2017-08-11 17:29:48 -04:00
Alexander Köplinger 62458f4b9e [acceptance-tests] Bump coreclr submodule 2017-08-11 22:20:53 +02:00
Alexis Christoforides 9d0b1967c0 Merge pull request #5353 from jonpryor/jonp-mono-api-html-ignore-class-removal
[mono-api-html] Allow `-r` to ignore class removals
2017-08-11 16:02:11 -04:00
Alexis Christoforides aa2ea3b812 [MacSDK] Switch to HTTPS for downloading SQLite 2017-08-11 14:13:09 -04:00
Alex Rønne Petersen 610c764662 [profiler] Fix code coverage support. 2017-08-11 19:31:05 +02:00
Alexis Christoforides dc3aa8cd27 Update Bockbuild for a CI fix/update (shorter build paths for MacSDK) 2017-08-11 12:22:36 -04:00
Alex Rønne Petersen 47cd88f0f8 Merge pull request #5352 from urisimchoni/fix-logprof-manpage
[docs] fixes to log profiler manpage
2017-08-11 16:34:50 +02:00
Alexander Köplinger bf8cc86306 [bcl] Clean up FRAMEWORK_VERSION 4.0 and 2.0 checks (#5356)
We don't build those profiles anymore, we have a net_4_x configuration instead.
2017-08-11 16:22:02 +02:00
Uri Simchoni 7ce175b023 [docs] mprof-report manpage - remove "onlycoverage" log profiler option
This option does not exist in the code.
2017-08-11 09:57:19 +03:00
Uri Simchoni 941108ca07 [docs] mprof-report manpage - document heapshot-on-shutdown
Document the heapshot-on-shutdown log profiler option.
2017-08-11 09:57:19 +03:00
Uri Simchoni 9aac2a41c4 [docs] mprof-report manpage - document '#' output option
Document ability to use the log profiler with an open file
descriptor.
2017-08-11 09:56:20 +03:00
Zoltan Varga 5b2ac5b1d9 [llvm] Avoid generating invalid llvm IR when a finally clause contains a loop which branches back to the beginning of the finally clause. (#5354) 2017-08-10 20:29:10 -04:00
Rodrigo Kumpera 85270afe51 [mini] Emit widen ops when storing to locals of size < 4. Fixes #58379. 2017-08-10 15:22:07 -07:00
Rodrigo Kumpera c695c1ee8b Merge pull request #5323 from cherusker/cherusker-2017-08-07-fix-strerror
[eglib] Fix g_strerror / monoeg_g_strerror
2017-08-10 17:12:02 -04:00
Jonathan Pryor f19bdb47e4 [mono-api-html] Allow -r to ignore class removals
Allow `mono-api-html -r REGEX` to be used to silence messages
regarding class and namespace removals in addition to member removals.
2017-08-10 16:27:31 -04:00
Uri Simchoni fa3dcfdc87 [docs] mprof-report manpage -- fix desctiption of existing file behavior
Fix the description of what happens when the output file already exists.
2017-08-10 22:53:28 +03:00
Uri Simchoni 9dc8579c11 [docs] remove non-existant option from log profiler manpage
The option of prepending a '-' to the log profiler output
filename is not supported by the code - remove it.
2017-08-10 22:53:28 +03:00
Uri Simchoni 246d4ffcc0 [docs] Capitalization / puctuation fixes in mprof-report manpage. 2017-08-10 22:53:28 +03:00
Marek Safar c6e50e868f More codeowners updates 2017-08-10 21:00:31 +02:00
Marek Safar 90d09a591e Update codeowners 2017-08-10 20:17:37 +02:00
cherusker dffb0dd178 Distinguish between the XSI-compliant and the GNU-specific version of strerror_r ()
- add USE_STRERROR_R_XSI to use the feature test macros conveniently later
- deal with the GNU-specific version of `strerror_r ()` separately (leave the code for the XSI-compliant version untouched)
- make `buff_len` size_t as this is ISO compliant (even though it should not really matter in this case)
2017-08-10 18:47:08 +02:00
Armin Hasitzka 5141dc7f2c Add rules to run TSan with run-jenkins.sh (#5254)
- export TSan flags that are used by the compiler and the compiled program
- introduce `make_timeout` to set individual timeouts for `make` based on the config (e.g. TSan will only get 30 minutes to complete)
2017-08-10 18:22:16 +02:00
Mikhail Filippov 6a5fbca3d9 Add implementation and tests for MatrixValueSerializer and MatrixConverter 2017-08-10 17:53:55 +02:00
Mikhail Filippov 88c76920be Uncomment fixed SizeConveter tests 2017-08-10 17:53:55 +02:00
Aleksey Kliger 5ff3b55860 [monodis] Not all override methods are errors
Check whether mono_get_method_checked returned an error, if not, just decode
the override normally.

This partly reverts f100c2f5ff
2017-08-10 10:28:38 -04:00
Armin Hasitzka bc84302196 [TSan] Yet another idea about whitelisting data races (#5310)
* Introduce racing.h
- introduce the `RacingIncrement* ()` functions
- test the `RacingIncrement* ()` functions with races of `mono_stats` in class.c
- add racing.h to Makefile.am, libmonoutils.vcxproj and msvc/libmonoutils.vcxproj.filters

* [fixup!] Rename "racing" to "unlocked"
- rename racing.h to unlocked.h
- update new file name in Makefile.am and *.vcxproj* files
- rename the functions from Racing* to Unlocked*
- update the macro logic
2017-08-10 16:16:02 +02:00
Ankit Jain a46c587880 [msbuild] Bump to xplat-master branch HEAD 2017-08-09 21:07:45 -04:00
Alexander Köplinger c82fab64a0 [mono-symbolicate/mdoc] Don't fail tests in mcs mode (#5348)
The checked in test files which the test suites in mono-symbolicate
and mdoc verify their output against have a few roslyn-specific
things in them and would fail when running in mcs mode.

While in theory we could check in both mcs- and roslyn-specific
test files it seems not worth the effort and we should just skip
the tests in mcs mode so we get greener builds on platforms
where we still use mcs by default.
2017-08-10 02:33:23 +02:00
Alexander Köplinger 9d84dcb2fc Revert "[runtime] Avoid building a separate static library, use the shared object files for the static library as well. (#5233)"
This reverts commit 56a1881bff.

It caused a consistent test error on ARM64:
https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/2810/testReport/regression-tests/dummy/MonoTests_regressions_100percentsuccess/
2017-08-09 20:06:37 +02:00
Bernhard Urban f3d3e2beae Update CODEOWNERS 2017-08-09 19:57:44 +02:00
Bernhard Urban c93589ae97 [interp] builtin types (#5339)
* [interp] support System.{nint,nuint,nfloat} (64bit only so far)

* [interp] 32bit support for System.{nint,nuint,nfloat}

* [fixup] explain mint_niy
2017-08-09 19:49:43 +02:00
Martin Baulig 0fdb5fae2f [System]: Fix memory leak in AppleTls. (#5305)
* [System]: Fix memory leak in AppleTls.

* Apply Miguel's patch to use GCHandleType.Weak.

* Actually assign context.
2017-08-09 12:27:28 -04:00
Aleksey Kliger (λgeek) 4d4594d8b8 Merge pull request #4379 from ermshiperete/master
[runtime] Fix bug when marshaling COM interfaces in arrays
2017-08-08 23:00:55 -04:00
Alexander Köplinger ee8c7c80b7 Default powerpc to mcs instead of roslyn (#5326)
It is crashing still way more than it works and now that the mcs
configuration works again we should default to that to make our CI
more pleasant.
2017-08-09 03:03:50 +02:00
Zoltan Varga 629948534e [runtime] Remove ves_icall_object_new_fast (), its only a bit faster than object_new_specific (), fast allocation is done by the managed allocators. Also remove mono_class_get_allocation_ftn () which is not needed anymore. (#5304) 2017-08-08 19:56:21 -04:00
Zoltan Varga 62c576b042 [btls] Compile btls using ninja if available. (#5333) 2017-08-08 19:54:51 -04:00
Aleksey Kliger 242dce8c9e [eglib] (goutput.c) Revert Android logging host-target change
Revert part of 590473d01b - the Android-specific
logging in eglib/goutput.c should be used when the host is Android, not the
target.
2017-08-08 18:37:33 -04:00
Eberhard Beilharz 2a5200b596 Fix allocation of memory to match the way it gets freed
Since we use g_free() to free the memory we should use g_malloc()
to allocate it.
2017-08-08 17:18:23 -04:00
Damien Daspit dc0400056c [runtime] Fix bug when marshaling COM interfaces in arrays
* use the correct COM interface when creating native array
* do not free CCWs when freeing the native array

This fixes Xamarin-47560.
2017-08-08 17:18:23 -04:00
Eberhard Beilharz fe836ec756 [runtime] Unit test for Xamarin-47560 2017-08-08 17:18:23 -04:00
Uri Simchoni 555041c8c2 Fix xdebug (#5309)
* [mini] fix xdebug null pointer dereferencing

Some trampolines are nameless, avoid crashing when generating their
debug info.

This change is released under the MIT license.

* [mini]: image-writer - move definition of USE_BIN_WRITER to header file

USE_BIN_WRITER is being used by xdebug for conditional compilation.

This change is released under the MIT license.

* [mini]: xdebug - obtain definition of USE_BIN_WRITER from header file

This re-enables xdebug on supported platforms.

This change is released under the MIT license.
2017-08-08 16:38:25 -04:00
Zoltan Varga 074c3c2693 [runtime] Fix a case where klass->blittable was written without holding the loader locked. (#5331) 2017-08-08 16:35:54 -04:00
Zoltan Varga eabbcf5332 [btls] Enable ccache support for cmake. (#5332) 2017-08-08 16:35:06 -04:00
Michael DeRoy ef9ca7ac17 add #if MONO around change to make it easier for merging upstream referencesource changes for the xamaran folks 2017-08-08 22:26:10 +02:00
Michael DeRoy bdb9f21dad Call array sort function that takes comparison instead rather than allocating for a wrapper struct 2017-08-08 22:26:10 +02:00
Mikhail Filippov fd708a1ab6 Add implementation and tests for SizeValueSerializer 2017-08-08 21:55:36 +02:00
Marek Safar ad06981f78 [mcs] Soften referenced assemblies unification rules. Fixes #58621 2017-08-08 17:30:56 +02:00
Jason Imison 2d9df9123c Merge pull request #5335 from mono/master-bump-fsharp
Bump F# to 4.1.25 and remove already merged patches
2017-08-08 12:55:10 +01:00
nosami 00b6bc472b Bump F# to 4.1.25 and remove already merged patches 2017-08-08 12:35:28 +01:00
Alexander Köplinger d0fc6f4ec6 Bump API snapshot 2017-08-08 11:56:55 +02:00
Alex Rønne Petersen 5ac651e7b4 Merge pull request #5317 from alexrp/master
[profiler] Some profiler API improvements.
2017-08-08 08:55:11 +02:00
Zoltan Varga 56a1881bff [runtime] Avoid building a separate static library, use the shared object files for the static library as well. (#5233) 2017-08-07 23:48:52 -04:00
Zoltan Varga f99af5280e [jit] Remove unused mono_arch_print_tree () function. (#5258) 2017-08-07 17:44:02 -04:00
Zoltan Varga 8ab54099c4 [runtime] Remove empty eglib/ dir. 2017-08-07 17:19:30 -04:00
Zoltan Varga 9be68f8952 [runtime] Move eglib into mono/eglib so it becomes a convenience library similar to utils/ etc. (#5297) 2017-08-07 17:14:31 -04:00
Alex Rønne Petersen a5bc0ce8a0 [profiler] Split method_leave callback into a method_tail_call callback.
With this, profilers can distinguish between the two, and also know what the
target method of a tail call is.

The call instrumentation flags have been renamed accordingly and a new flag has
been added for instrumenting tail calls. I've also added a flag for exceptional
leave events, and method_exception_leave is only raised if this flag is given
for a method.

Also refactored the relevant JIT code a bit so it's easier to follow.
2017-08-07 22:47:55 +02:00
Alex Rønne Petersen b40ae96a9b [profiler] Mark generated raise functions as ICALL_DECL_EXPORT.
This is currently needed for method_enter, method_leave, and gc_allocation.
2017-08-07 22:38:26 +02:00
Alex Rønne Petersen 54d73d3bfe [runtime] Declare MonoProfilerCallContext::return_value offset. 2017-08-07 22:38:26 +02:00
Alex Rønne Petersen 66420c76f7 [runtime] Add ICALL_DECL_EXPORT.
ICALL_EXPORT is only used on function definitions, not declarations.
2017-08-07 22:38:26 +02:00
Alex Rønne Petersen f35875568b [profiler] Properly clean up the resources used by the profiler API on shutdown.
Also introduce mono_profiler_set_cleanup_callback ().
2017-08-07 22:38:26 +02:00
Alex Rønne Petersen d97e190c7e [profiler] Some improvements to the code coverage API.
Code coverage must now be explicitly enabled. This simplifies initialization
of some coverage-related structures and also lets us enable debug info which
is needed to produce good data.

Also change the signature of mono_profiler_get_coverage_data so it returns a
value indicating whether coverage data was available.
2017-08-07 22:38:26 +02:00
Alexander Köplinger f1ff42789b [msvc] Update csproj files 2017-08-07 22:14:00 +02:00
Alexander Köplinger 83dde0759f [genproj] Simplify strong name key handling
It doesn't need to be in a separate PropertyGroup.
2017-08-07 22:10:58 +02:00
Armin Hasitzka 757741bd90 [mono-threads-posix] Fix a buffer overflow (rather an information leak / over-read) (#5285)
[mono-threads-posix] Fix a buffer overflow (rather an information leak / over-read)

While testing Clang's AddressSanitizer, I found and fixed a buffer overflow.

Up for discussion: it might be worth importing `strlcpy` (http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/string/strlcpy.c?rev=1.11) for similar purposes as it provides additional safety and also helps with the readability?
2017-08-07 21:10:32 +02:00
Alex Rønne Petersen d1de81f0c6 Merge pull request #5321 from urisimchoni/prof-lin
Profiler - inlining fixes
2017-08-07 19:11:25 +02:00
Uri Simchoni b6397061dd [profiler] Avoid instrumenting inlined methods
An inlined method does not require instrumentation (if it
did, it would not have been inlined). The flags that
control instrumentation options are valid for the caller
method and are not to be consulted.

This patch replaces an assertion with a check and early
return. A method that "wants to be instrumented" does not
get inlined, but a method that "doesn't want to be instrumented"
can get inlined. However, the flags that control instrumention
options have been calculated against the caller method, hence
they should not be consulted at all. The extra check renders
the assertion unnecessary.
2017-08-07 19:54:45 +03:00
Uri Simchoni 65e92f4cef [profile] set the "no profiling" bitmask equal to zero
This makes constructs such as "if (!mono_profiler_get_call_instrumentation_flags(methos))"
correct. See mono_method_check_inlining()
2017-08-07 19:54:45 +03:00
Aleksey Kliger (λgeek) ef684b2041 Merge pull request #5313 from lambdageek/corefx-sre-fixup
[sre] Fix some argument checks, enable xtests
2017-08-07 11:58:50 -04:00
Alexander Köplinger 0f7389f5bb [System.ServiceModel.Web] Simplify AssemblyInfo.cs
We don't need separate AssemblyInformationalVersion for mobile and
non-mobile.
2017-08-07 17:09:34 +02:00
Alexander Köplinger 4e32895440 [ci] Add CI_TAGS option for --disable-mcs-build
Useful if you don't want to build the class libraries e.g. for
some static analysis of the runtime.
2017-08-07 16:28:47 +02:00
Ludovic Henry ddcdec0314 Bump version to 5.7 (#5325) 2017-08-07 16:03:24 +02:00
Ludovic Henry bf3ac1d7fc [w32handle] Remove use of w32handle for File, Console, Pipe and Socket (#5319)
* [w32file] Remove io_ops indirection

* [w32file] Replace use of w32handle by a GHashTable for File, Console and Pipe

* [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Remove force closing of sockets on shutdown

* fixup! [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Replace use of w32handle by a GHashTable

* [w32handle] Remove dead function mono_w32handle_new_fd

* fixup! [w32file] Replace use of w32handle by a GHashTable for File, Console and Pipe

* [w32handle] Remove dead variable mono_w32handle_fd_reserve

* [fdhandle] Factor w32file and w32socket common fdhandle code

* fixup! [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Fix GC safe/unsafe transitions

* fixup! [w32handle] Remove dead variable mono_w32handle_fd_reserve
2017-08-07 15:52:12 +02:00
Alexander Köplinger 7845ed2d91 [eglib] Add back NEWS file, it's required for the tarball 2017-08-07 14:32:13 +02:00
Ludovic Henry 6bfb2f1cf1 Revert "Bump version to 5.7"
This reverts commit 82eafc02e4.
2017-08-07 14:30:20 +02:00
Ludovic Henry 82eafc02e4 Bump version to 5.7 2017-08-07 14:20:29 +02:00
Alexander Köplinger 91dd686981 [System.Drawing] Simplify mobile profile check 2017-08-07 14:11:59 +02:00
Zoltan Varga 33d2d52644 [bcl] Specify the name of the key file on the command line instead of using the AssemblyKeyFile attribute for consistency and to make it easier to do path name manipulation on the file name. (#5316) 2017-08-07 14:03:48 +02:00
Alex Rønne Petersen c65f48052a Merge pull request #5320 from urisimchoni/prof-sample
[profiler] fixes to profiler sample
2017-08-07 08:45:36 +02:00
Uri Simchoni e3a57ead2e [profiler] fixes to profiler sample
- Fix the Linux build instructions.
- Remove eglib dependencies, as they complicate the build of an
  extenral module.
- Make instance static instead of heap-allocated.
- Make the call counter 64 bits.
- Adjustments to accommodate the new profiling API.
2017-08-07 06:33:01 +03:00
Ludovic Henry 6e23736a07 Revert "[w32handle] Remove use of w32handle for File, Console, Pipe and Socket (#5283)" (#5318)
This reverts commit 78735091b6.
2017-08-05 12:59:08 -04:00
Ludovic Henry 78735091b6 [w32handle] Remove use of w32handle for File, Console, Pipe and Socket (#5283)
* [w32file] Remove io_ops indirection

* [w32file] Replace use of w32handle by a GHashTable for File, Console and Pipe

* [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Remove force closing of sockets on shutdown

* fixup! [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Replace use of w32handle by a GHashTable

* [w32handle] Remove dead function mono_w32handle_new_fd

* fixup! [w32file] Replace use of w32handle by a GHashTable for File, Console and Pipe

* [w32handle] Remove dead variable mono_w32handle_fd_reserve

* [fdhandle] Factor w32file and w32socket common fdhandle code

* fixup! [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Fix GC safe/unsafe transitions

* fixup! [w32handle] Remove dead variable mono_w32handle_fd_reserve
2017-08-05 12:51:15 -04:00
Marek Safar 508effd434 Bump boostrap mono dependency 2017-08-05 11:47:05 +02:00
Marek Safar 6e65ed7cf8 Bump corefx 2017-08-05 11:47:05 +02:00
Alexander Köplinger a3806d1745 [ci] Disable corlib-xunit on Windows for now
It seems to fail.
2017-08-05 02:10:21 +02:00
Marek Safar 858f025f69 [mcs] Adds handling for declared variables from while loop condition 2017-08-04 23:49:42 +02:00
monojenkins 94bb3cadd2 Bump API snapshot submodule 2017-08-04 22:41:09 +02:00
Marek Safar 7592b15865 Bump cecil and linker 2017-08-04 22:41:09 +02:00
Aleksey Kliger d56bdb34e8 [test] (corlib) Enable more xtest SRE tests
- MethodBuilderDefineParameter
- ConstructorBuilderDefineParameter
- FieldBuilderSetCustomAttribute
- GenericTypeParameterBuilderSetCustomAttribute
- FieldBuilderSetOffset
- ModuleBuilderDefineInitializedData
- ModuleBuilderDefineUninitializedData
2017-08-04 16:38:27 -04:00
Aleksey Kliger 39b2b769d5 [sre] ModuleBuilder.DefineUnitializedData argument checks
1. Fix off by one in size check.
  Largest usable size is 0x3effff, first unusable size is 0x3f0000
  (Also change order of ArgumentException arguments - param name is second.
   Set it to null because of misguided CoreFX SRE test that expects a null name)
2. Check for empty string field name.
2017-08-04 16:38:24 -04:00
Aleksey Kliger 41393735d6 [sre] negative FieldBuilder.SetOffset should throw ArgumentException 2017-08-04 16:38:24 -04:00
Aleksey Kliger 9eee5a5221 [sre] Add explicit null checks of CustomAttributeBuilder arguments 2017-08-04 16:38:23 -04:00
Aleksey Kliger 07b8fd3cf1 [sre] ConstructorBuilder.DefineParamter(0,...) shouldn't throw
.NET Framework says:

> If you specify 0 (zero) for iSequence, this method returns a ParameterBuilder
>  instead of throwing an exception. There is nothing useful that you can do
>  with this ParameterBuilder.

So let's do that.
2017-08-04 16:38:23 -04:00
Alex Rønne Petersen 4cf197d22b [runtime] Install profiler-events.h as a public header. 2017-08-04 21:05:12 +02:00
Alexander Köplinger 24c3624fee [bcl] Grab free ports randomly in NetworkHelpers (#5312)
* [bcl] Grab free ports randomly in NetworkHelpers

We're frequently seeing "address already in use" errors on Jenkins.

The theory is that when we're running tests and grab the next free
port via our custom NetworkHelpers we're getting a port which will
also be returned to a simultaneously running test (e.g. another chroot)
because we're closing the TcpListener and thus releasing the port until
we start using it in actual test code. By that time the other test
might've already opened the port, causing our test to fail.

Instead we now try to use a random port in the range 10000-60000
and try if it's available. This doesn't completely fix the inherent
race but should hopefully make it way less likely.
2017-08-04 20:22:50 +02:00
Aleksey Kliger a7f5328ca1 [sre] Throw ArgumentOutOfRange exn in MethodBuilder.DefineParameter if called
before SetParameters.

Fixes xunit testpoint MethodBuilderDefineParameter:DefineParameter_NoParameters_NonZeroPosition_ThrowsArgumentOutOfRangeException
2017-08-04 12:55:38 -04:00
Aleksey Kliger (λgeek) 2d4ea2b604 Merge pull request #5306 from lambdageek/corefx-sre-tests
[test] (corlib) Use CoreFX System.Reflection.Emit xunit tests
2017-08-04 12:40:54 -04:00
Aleksey Kliger (λgeek) cb85c56a58 Merge pull request #5303 from lambdageek/cattr-bcheck
[custom_attrs] Add bounds checking to custom attribute parsing
2017-08-04 12:29:19 -04:00
Zoltan Varga e6e0fb8226 [btls] Disable BUILD_SHARED_LIBS while building boringssl, so its symbols are not exported from the btls shared lib. (#5307) 2017-08-04 11:39:28 -04:00
Marek Safar d0f51b4e83 [mcs] Fixes codegen for type pattern matching in probing expressions over hoisted local variables 2017-08-04 15:15:14 +02:00
Marek Safar 69c20abafe [mcs] Flow analysis on reduced expressions need to run on original expression 2017-08-04 13:30:06 +02:00
Marek Safar 8790799a12 [mcs] Warnings clean up 2017-08-04 10:52:23 +02:00
Marek Safar 3749debbec [mcs] Pending implementation of accessors cannot hide base implementation with different member type 2017-08-04 00:24:38 +02:00
Aleksey Kliger 51176ec4eb [ci] (run-test-default) Run the corlib xunit tests 2017-08-03 17:31:15 -04:00
Aleksey Kliger 5e33d810bd [test] (corlib) Use CoreFX System.Reflection.Emit xunit tests 2017-08-03 16:48:10 -04:00
Aleksey Kliger c2f4d0439d [custom_attrs] Add bounds checking to mono_reflection_create_custom_attr_data_args
and load_cattr_value_boxed
2017-08-03 14:26:52 -04:00
Aleksey Kliger 4d17243fd1 [custom_attrs] Add bounds checking to load_cattr_value 2017-08-03 13:51:08 -04:00
Aleksey Kliger fab01c2cff [custom_attrs] Add (some) bounds checking to create_custom_attr
In principle, mono_verifier_verify_cattr_content should prevent malformed custom
attribute blobs from being passed in here.

In practice:

1. The verifier is not on by default

2. System.Reflection.Emit allows an arbitrary byte[] to be passed in which
   means that code like this can cause mono to read past the end of the array.

   ```
   // "1 1-byte constructor argument and then 65280 named properties follow"
   assembly.SetCustomAttribute(constructor, new byte[] { 1, 0, 1, 0x00, 0xFF });
   var attributes = assembly.GetCustomAttributes(true);
   ```
2017-08-03 13:32:25 -04:00
Marek Safar 77f563b5f2 Updates codeowners 2017-08-03 17:09:32 +02:00
Ankit Jain 3fd6c71d19 [msbuild] Add option to nuget-hash-extractor to generate a list of the
.. denied assemblies usable by a msbuild task for filtering them.
2017-08-03 09:28:44 +02:00
Zoltan Varga 3885890e49 Bump ikdasm. 2017-08-02 20:38:02 -04:00
Vlad Brezae 23fa02853e [tests] Disable test on llvm
On llvm aborts can happen during finally blocks. This test was not failing before because the method in question had llvm disabled, which has recently changed.
2017-08-03 02:22:52 +03:00
monojenkins 8bbca2bada Merge pull request #5299 from cherusker/cherusker-2017-08-01-next-generic-inst-id
[metadata] Fix racy next_generic_inst_id

Like suggested by @luhenry, I would like to propose this fix which was discussed in https://bugzilla.xamarin.com/show_bug.cgi?id=58423. As `next_generic_inst_id` is `int`, `InterlockedIncrement64 ()` seems to be the right choice.

Also, I cannot add any reviewers or assignees, which is why I would kindly ask @lambdageek to review this as well :)
2017-08-03 01:10:32 +02:00
Alex Rønne Petersen 266c991d6f [profiler] Fix MonoProfilerState::context_free_buffer type. 2017-08-02 23:10:57 +02:00
Atsushi Eno c60a28c8ad [mono-api-html] Fix bogus IgnoreParameterNameChanges behavior.
It never ignored parameter name changes. Make the entire code just simple.
2017-08-02 21:26:08 +02:00
cherusker 47535f557d Fix racy next_generic_inst_id
- as discussed in https://bugzilla.xamarin.com/show_bug.cgi?id=58423
- in addition, unify `int` and `guint` into `gint32` which can be used flawlessly with `InterlockedIncrement ()`
2017-08-02 21:17:43 +02:00
Zoltan Varga a48bc43985 [bcl] Fix Delegate.GetHashCode () so it takes into account the target too. Fixes #58399. (#5296) 2017-08-02 02:58:41 -04:00
Zoltan Varga 2a648ccdb8 [runtime] Fix msvc build. 2017-08-02 02:08:17 -04:00
Vlad Brezae 1cd20b27b4 Update CODEOWNERS 2017-08-02 02:39:14 +03:00
Alex Rønne Petersen 0dac4223b2 Merge pull request #5298 from baulig/work-offsets-profiler
[offset-tool]: Add MonoProfilerCallContext to MonoAotOffsetsDumper.
2017-08-02 01:35:41 +02:00
Martin Baulig db8d45b66d [offset-tool]: Add MonoProfilerCallContext to MonoAotOffsetsDumper. 2017-08-01 18:11:40 -04:00
Alex Rønne Petersen e0b279ec61 [mini] Remove the functions that were unexported in b05d4b9322. 2017-08-01 21:53:01 +02:00
Alex Rønne Petersen f4c3c959b4 [runtime] Declare MonoProfilerCallContext::method offset. 2017-08-01 21:52:35 +02:00
Zoltan Varga f3a8d72bfb [jit] Fix the DISABLE_JIT build. 2017-08-01 15:13:30 -04:00
Martin Baulig 8ffdc724ec Add myself to CODEOWNERS. 2017-08-01 13:54:27 -04:00
Martin Baulig 2b574b2c5e [System]: Fix memory leak in BTLS. (#5291) 2017-08-01 12:59:23 -04:00
Aleksey Kliger (λgeek) 3109b7cfeb Merge pull request #5288 from lambdageek/bug-58454
[sre] Pass declaring type to GetMethodFromHandle in GenericTypeParameterBuilder:InternalResolve (Fixes #58454)
2017-08-01 12:08:56 -04:00
Alex Rønne Petersen f8dfe7066e Merge pull request #5292 from alexrp/profiler-symbol-fixes
[profiler] Move legacy profiler code to profiler.c.
2017-08-01 17:05:37 +02:00
Alex Rønne Petersen fc869e76b9 Update CODEOWNERS. 2017-08-01 06:54:14 +02:00
Alex Rønne Petersen 6c3adfeac1 [profiler] Move legacy profiler code to profiler.c.
These symbols weren't being properly exported in the final mono executable on
Mac because no code in the runtime called these functions. As long as they're
defined in an object file that contains used functions, they'll be exported.
2017-08-01 06:50:05 +02:00
Alex Rønne Petersen 45d9cc1b5a Merge pull request #5274 from alexrp/profiler-call-contexts
[profiler] Implement call context introspection for enter/leave events.
2017-08-01 06:35:36 +02:00
Alex Rønne Petersen 4aa090cf11 [mini] Add a mono_jit_aot_compiling () function. 2017-08-01 06:15:06 +02:00
Alex Rønne Petersen b05d4b9322 [mini] Remove some unstable exports that are no longer used by the profiler. 2017-08-01 06:15:06 +02:00
Alex Rønne Petersen f9ae98ab88 [profiler] Implement call context introspection for enter/leave events.
When this feature is enabled for a method, the enter/leave event receives an
additional argument, a so-called 'call context'. This call context contains
enough information about the stack frame of the instrumented method to allow
the enter/leave callback to inspect the 'this' reference, method arguments,
local variables, and the return value (for non-void methods).

This feature enables some interesting scenarios that were not possible with
the regular enter/leave events. For example, a profiler could instrument
well-known methods in the managed thread pool code to get an idea of how an
application is using the thread pool, or it could instrument network-related
methods to gather statistics or even log all network traffic.

This is implemented by storing a MonoProfilerCallContext on the stack, whose
MonoContext field is populated by executing an OP_FILL_PROF_CALL_CTX opcode
which stores the stack pointer, frame pointer, and all callee-saved registers
to it. For the epilogue, a pointer to the return value (for non-void methods)
is also stored in the MonoProfilerCallContext. An address to this context is
then passed to mono_profiler_raise_method_enter/leave. Based on debug info,
all arguments and locals can then be looked up in the instrumented method's
stack frame.

For the interpreter, we just store an InterpFrame pointer on the
MonoProfilerCallContext and look everything up from that. We don't need debug
info in this case.

This feature is currently not supported with LLVM (for regular LLVM mode, it
will fall back to Mono's JIT, while for LLVM-only mode, it's not available).

I also refactored the interpreter code so that enter/leave events are generated
not only when interpreter debugging is enabled. Also, the interpreter will only
call mono_profiler_get_call_instrumentation_flags () once per method now.
Finally, I made the interpreter also generate exception leave events.
2017-08-01 06:15:06 +02:00
Aleksey Kliger 8997ef3b6a [sre] Pass declaring type to GetMethodFromHandle in
GenericTypeParameterBuilder:InternalResolve (Fixes #58454)

When the parameter belongs to a method builder, we need to pass the declaring
type (appropriately resolved) to GetMethodFromHandle to avoid an
ArgumentException.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58454
2017-07-31 18:35:16 -04:00
Alexander Köplinger a71c1c7196 [ci] Compile the class lib tests in a separate step
Compiling in parallel via -j should also be faster.
We had this on Wrench but it didn't make it over to Jenkins.
2017-08-01 00:33:36 +02:00
Alexander Köplinger 05bd2d2ffa [mono-symbolicate] Run tests with "run-test" target instead of "test"
The "test" target is used to precompile the tests but actual running
should happen with the "run-test" target.
2017-08-01 00:33:36 +02:00
Aleksey Kliger 62a24cf4ac [test] Check that GenericTypeParamBuilder:InternalResolve passes declaring type
to GetMethodFromHandle

Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=58454
2017-07-31 18:33:19 -04:00
vkargov e0d515ec32 Merge pull request #5234 from vkargov/vk-kiokunegi
[jit] Check method cache first in mono_get_method_constrained_checked.
2017-07-31 16:49:58 -04:00
Martin Baulig 256dbaaa20 [corlib]: Fix race condition in ExceptionDispatchInfo. (#5279) 2017-07-31 13:01:41 -04:00
Zoltan Varga f0398a70a5 [llvm] Fix the calling of fault clauses in llvm compiled code. Fixes #58446. (#5286) 2017-07-31 11:20:22 -04:00
Marek Safar 9a1d66fa3a [mcs] Implements C#7 expression bodied members enhancement 2017-07-31 17:01:12 +02:00
Marek Safar 1837a71ea1 [mcs] Add parser sequence for case type pattern matching 2017-07-31 17:01:12 +02:00
Vlad Brezae 82bc0ca4ce Merge pull request #5260 from BrzVlad/fix-handler-block
[runtime] Fix handler block abort
2017-07-28 22:14:33 +03:00
Aleksey Kliger (λgeek) 11961e0202 Merge pull request #5272 from lambdageek/bug-58421
[sre] Handle typeref tokens in fixup_method (Fixes #58421)
2017-07-28 12:00:09 -04:00
Marek Safar 455cfb3b95 [mcs] Implements cloning for yield break. Fixes #57796 2017-07-28 11:14:08 +02:00
Zoltan Varga 590473d01b Eglib integrate (#5267)
* [runtime] Integrate eglib's configure into mono's configure to simplify and speed up the configure process.

* [runtime] Delete some duplicate eglib configure code.
2017-07-28 00:16:18 -04:00
Aleksey Kliger (λgeek) c18b403fa5 Merge pull request #5271 from lambdageek/bug-58361
[sre] Resolve EnumBuilder tokens in managed (Fixes #58361)
2017-07-27 17:55:47 -04:00
Aleksey Kliger 25233ec2ee Bump corlib version
Due to changed semantics of ModuleBuilder:RegisterToken icall (it now does not
allow an EnumBuilder argument)
2017-07-27 11:47:34 -04:00
Aleksey Kliger 186600778e [sre] Resolve EnumBuilder tokens in managed. (Fixes #58361)
In particular, delegate to the TypeBuilder within the EnumBuilder.

Also do not register the EnumBuilder object with the runtime.  (Fixes
https://bugzilla.xamarin.com/show_bug.cgi?id=58361)
2017-07-27 11:41:29 -04:00
Aleksey Kliger 7993a0d9e4 [test] EnumBuilder regression tests for #58361
Cause the creation of a token for an EnumBuilder object.  Test both typedef
tokens (EnumBuilder from same assembly) and typeref token (EnumBuilder in another assembly)
2017-07-27 11:41:29 -04:00
Aleksey Kliger 792b5367cd [sre] Add MonoDynamicImageTokCollision arg to mono_dynamic_image_register_token
The new argument controls what should happen when the given token is already
present.

In some situations it's expected that we either see the same object, or we
unconditionally want to replace it (for example if we previously registered a
TypeBuilder or a MethodBuilder, after the type or method is created, we will
re-register the RuntimeType or MonoMethod in its place).  In other cases (for
example when a module references a MonoMethod from a different assembly), we
may still call `mono_image_create_token()` multiple times but we expect to see
the same MonoMethod object.
2017-07-27 11:41:28 -04:00
Aleksey Kliger 0054c555b3 [sre] Handle typeref tokens in fixup_method (Fixes #58421)
This may occur if there are two AssemblyBuilders in progress and one of them
refers to a TypeBuilder from the other.

https://bugzilla.xamarin.com/show_bug.cgi?id=58421
2017-07-27 11:00:10 -04:00
Aleksey Kliger dc4c79a52f [test] Check that one AssemblyBuilder can refer to a TypeBuilder from another.
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=58421
2017-07-27 11:00:10 -04:00
Zoltan Varga d6141be2ef [interp] Make the 'td' variable a pointer in generate () for consistency with the rest of the code. 2017-07-27 14:23:08 +02:00
Zoltan Varga ea21013fb5 [interp] Rename some types to better reflect their function.
MonoInvocation -> InterpFrame
RuntimeMethod -> InterpMethod
runtime_method -> imethod
2017-07-27 14:23:08 +02:00
Marek Safar 9c7b4038d3 [mcs] Another workaround for enum builder SRE crash (this time on Mono) 2017-07-27 10:38:15 +02:00
Marek Safar 63c3593370 Updates codeowners 2017-07-27 09:07:37 +02:00
Zoltan Varga 62835ec068 [runtime] Move object.c to 'common_sources', as it no longer has compile time gc dependencies. 2017-07-26 21:35:38 -04:00
Zoltan Varga 5622889849 Sre not gc dependent (#5264)
* [runtime] Move the sre source files to 'common_sources', they no longer have compile time gc dependencies after the Boehm GC root changes. sre.c still depends on the gc dependent caching code in reflection-cache.h.

* [runtime] Remove compile time gc dependencies from the reflection caching code.

* [runtime] Move reflection.c/sre.c to 'common_sources', they no longer have compile time gc dependencies.
2017-07-26 21:33:12 -04:00
Marek Safar 632e1354b6 [corlib] Update Assembly class xml descriptor 2017-07-27 00:00:35 +02:00
monojenkins c8df608851 [msvc] Update csproj files 2017-07-26 19:35:28 +02:00
Zoltan Varga 966d2b4292 [sre] Add some tests for saving assemblies. (#5265) 2017-07-26 10:16:03 -04:00
Marek Safar fdae69d222 [Mono.CSharp] Updates csproj 2017-07-26 13:27:35 +02:00
Marek Safar 716ff39b42 [mcs] Adds workaround for repl enum declaration on .net SRE 2017-07-26 13:27:35 +02:00
Marek Safar ebfae1efa8 [corlib] ModuleBuilder pseudo-token lookup needs to use references insteads of logical equality comparer.
Fixes #58291
2017-07-26 13:04:27 +02:00
Alex Rønne Petersen 266076030a [acceptance-tests] Another attempt fix a StringBuilder race in the profiler stress runner. 2017-07-26 13:03:52 +02:00
Zoltan Varga 5d9d139e0a [runtime] Remove compile time gc dependencies from object.c. (#5266) 2017-07-25 23:07:49 -04:00
Zoltan Varga 38b9617c77 [runtime] Remove compile-time gc dependencies from domain.c/appdomain.c. (#5263)
* [runtime] Remove compile-time gc dependencies from domain.c/appdomain.c.

* [runtime] Move domain.c/appdomain.c to 'common_sources' since they no longer have compile time gc dependencies.
2017-07-25 20:31:42 -04:00
Marek Safar 211594fb3c Merge branch 'vladimir-kazakov-xml-dsig-transforms-from-corefx' 2017-07-25 23:46:27 +02:00
Marek Safar 6b6c324e06 Merge branch 'xml-dsig-transforms-from-corefx' of git://github.com/vladimir-kazakov/mono into vladimir-kazakov-xml-dsig-transforms-from-corefx 2017-07-25 23:46:04 +02:00
monojenkins 422a7103d1 [msvc] Update csproj files 2017-07-25 23:34:54 +02:00
Alex Rønne Petersen 4484646a0b [interp] Fix a copy/paste error in ea4e4a9ef6. 2017-07-25 16:16:11 +02:00
Marek Safar 5d8d1285d7 Bump roslyn (to include more files) 2017-07-25 15:01:22 +02:00
monojenkins b08c54265b Bump API snapshot submodule 2017-07-25 12:51:52 +02:00
Marek Safar efc7e54e14 Bump CoreFX 2017-07-25 12:51:52 +02:00
Vlad Brezae df7f474937 [runtime] Remove handler block trampoline code 2017-07-25 12:25:53 +03:00
Vlad Brezae ba95f34c0a [runtime] Fix handler block
Instead of hijacking the return address when suspending a thread in a finally block for an abort, do an explicit check in managed code when we are returning from the handler in order to see if we need to abort. Hijacking the return address is arch specific and it doesn't work if we are suspended before it is initialized in handler start.

Fixes #5798
2017-07-25 12:23:34 +03:00
Alexis Christoforides 4526bbb722 Update bockbuild. Fixes #57002 2017-07-25 01:25:54 -04:00
Zoltan Varga 3daaa4d39c [runtime] Fix the size calculation for CustomAttributeType coded indexes, they can only point to the MethodDef/MemberRef tables even through 3 bits are used to encode them, only 2 values are used. Fixes #58210. (#5256) 2017-07-24 23:20:43 -04:00
Zoltan Varga 11ce9cab62 [jit] Handle OP_VCALL_MEMBASE in get_simd_vreg (). Fixes #58344. 2017-07-24 18:28:52 -04:00
Zoltan Varga 4d56a808cf Bump bockbuild. 2017-07-24 17:35:08 -04:00
Marek Safar d26bec1721 Bump roslyn to 2.3.1 2017-07-24 19:49:48 +02:00
Vladimir Kazakov 7ede70ad8e XMLDSIG transforms from .NET Core. 2017-07-24 19:57:26 +03:00
Zoltan Varga 9b1fa3e38f Bump bockbuild. 2017-07-24 11:31:34 -04:00
Alex Rønne Petersen 2a3006438d Update CODEOWNERS 2017-07-23 07:24:55 +02:00
Alex Rønne Petersen 548854a9c6 Merge pull request #5252 from alexrp/profiler-stress-fixes
[acceptance-tests] A few fixes for the profiler stress test suite.
2017-07-23 06:06:28 +02:00
Alex Rønne Petersen 1d14ecc9ed Merge pull request #5253 from alexrp/profiler-lib
[Mono.Profiler.Log] Catch SecurityException for missing icalls.
2017-07-22 20:26:16 +02:00
Alex Rønne Petersen aebb8f0d85 [Mono.Profiler.Log] Catch SecurityException for missing icalls.
This is the exception that is thrown on .NET because icalls are not allowed in
non-GAC assemblies.
2017-07-22 17:15:56 +02:00
Alex Rønne Petersen 709871bd6e [acceptance-tests] Disable the ironjs-v8 test on arm32/arm64.
It times out even with a 24-hour timeout. Eventually we should investigate why,
but disable it for now so the lane can become green.
2017-07-22 15:59:52 +02:00
Alex Rønne Petersen e013096c65 [acceptance-tests] Fix a crash in the profiler stress runner caused by racey modification of a StringBuilder. 2017-07-22 14:42:06 +02:00
Alex Rønne Petersen f0e6bd2f96 [acceptance-tests] Set individual timeout for profiler stress tests back to 8 hours. 2017-07-22 14:35:33 +02:00
Alex Rønne Petersen b7e4f0c0b9 [acceptance-tests] Build profiler stress runner with debug info. 2017-07-22 14:33:35 +02:00
Zoltan Varga 16309a7561 [bockbuild] Avoid overwriting self.local_configure_flags in some packages, extend them instead. (#5239) 2017-07-21 20:02:43 -04:00
Alex Rønne Petersen e4b5152a9b Merge pull request #5248 from alexrp/profiler-api
[profiler] Add back some legacy profiler API functions.
2017-07-21 20:09:54 +02:00
Armin Hasitzka 792a0169b9 [mempool] Annotate functions for clang's ThreadSanitizer (#5191)
* [mempool] Annotate functions for ThreadSanitizer
Whitelist `mono_mempool_alloc`, `mono_mempool_new_size` and `mono_mempool_destroy` according to https://bugzilla.xamarin.com/show_bug.cgi?id=57936

* [fixup!] Test the NO_SANITIZE_THREAD macro

* [fixup!] Merge comments / documentation
2017-07-21 11:39:04 +02:00
Alex Rønne Petersen eb0209be29 [acceptance-tests] Temporarily increase the profiler stress timeout to 24 hours.
This is temporary and is just to see how long ironjs-v8 actually takes to complete on ARM. We may need to just exclude it there.
2017-07-21 11:12:58 +02:00
monojenkins d26e9c18e8 Bump API snapshot submodule 2017-07-21 10:52:05 +02:00
pjt33 952c9145b2 Implement ServiceEndpoint.EndpointBehaviors
This follows the reference source in understanding `EndpointBehaviors` to be an alias of `Behaviors` with a more general type.

Note that although an alias might not seem necessary to implement, when using netstandard1.3 the [`System.ServiceModel.Primitives`](https://www.nuget.org/packages/System.ServiceModel.Primitives) package exposes `EndpointBehaviors` but not `Behaviors`.
2017-07-21 10:52:05 +02:00
Alex Rønne Petersen 68fe403e46 [msvc] Update project files with new profiler-related source files. 2017-07-21 09:53:46 +02:00
Miguel de Icaza 061f782c4b [Marshal.IsComObject] Make this predicate return false instead of throwing an exception which is what the calling code expects (#5246) 2017-07-20 22:47:48 -04:00
Ludovic Henry e58e0fcf57 Reenable MonoTests.Remoting.IpcChannelTest.Bug609381 (#5245)
Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=36634
2017-07-20 16:08:26 -04:00
Alex Rønne Petersen 145842ded5 [msvc] Update def files. 2017-07-20 21:14:02 +02:00
Alex Rønne Petersen b6082446c2 [profiler] Add back some legacy profiler API functions.
These are used by XA/XI/XM and because XM in particular needs to work with
both old and new versions of system Mono, we need to make sure these functions
still exist.
2017-07-20 20:46:59 +02:00
Alex Rønne Petersen 9ab31d0213 [profiler] Rename mono_profiler_install to mono_profiler_create. 2017-07-20 20:07:47 +02:00
Vlad Brezae 2657d9cb1e [runtime] Fix abort ignore when suspended in first instruction from finally block 2017-07-20 20:35:23 +03:00
Vlad Brezae 42874b6479 Merge pull request #5198 from BrzVlad/fix-binprot-stats
[sgen] Parallel gc improvements
2017-07-20 20:30:49 +03:00
Bernhard Urban 2ce28c626c [jit] test builtin types (#5208)
* [builtin-types] import test suite

List of original contributors:

Zoltan Varga <[email protected]>
Rodrigo Kumpera <[email protected]>

* [builtin-types] import updated definitions from xamarin-macios

https://github.com/xamarin/xamarin-macios/blob/8fbbfa5ca7154fcfd553f7a7b242ffee9a95f240/src/NativeTypes/Primitives.tt

* [builtin-types] make regression suite work

* [builtin-types] disable broken tests

* [fixup] disable failing tests on arm64
2017-07-20 19:24:11 +02:00
Bernhard Urban a5a3a52e10 [interp] reuse finally_ips infrastructue for fault clauses 2017-07-20 19:21:50 +02:00
Mikayla Hutchinson d3b8558190 Tweak the Unreal profile 2017-07-20 17:52:39 +02:00
Alex Rønne Petersen b1aa5c0074 Merge pull request #5243 from alexrp/profiler-stress-fixes
[acceptance-tests] Don't mark msbiology as a failure if it OOMs on 32-bit.
2017-07-20 15:34:06 +02:00
Vlad Brezae 0a35d095bf [sgen] Fix function signature 2017-07-20 13:53:50 +03:00
Vlad Brezae b319e134ef [sgen] Compact allocated block list
It helps with its repeated traversal and improves work distribution when using parallel modes.
2017-07-20 13:53:50 +03:00
Vlad Brezae 5ff8de7322 [sgen] Improve card table parallelization
Improve caching by scanning consecutive blocks and avoiding full block list travesal.
2017-07-20 13:53:49 +03:00
Vlad Brezae 7692bfc5a9 [sgen] Run a single worker cycle in major parallel finish case
This was not the case when we were doing a forced concurrent finish.
2017-07-20 13:53:48 +03:00
Vlad Brezae 58a947d9c5 [sgen] Avoid logging unnecessary binary protocol events 2017-07-20 13:53:48 +03:00
Vlad Brezae 1f19829f91 [sgen] Add explicit binary protocol stats for collections
Using the cardtable scan and finish_gray_stack start and end events is cumbersome to parse and require a lot of logging, especially in the case of the parallel collector.
2017-07-20 13:53:47 +03:00
Vlad Brezae 1e58d75461 [sgen] Include mod union times to stats 2017-07-20 13:53:46 +03:00
Vlad Brezae 88c89b2a0d [sgen] Use parallel minors for pause mode
It should makes pauses less influenced by workload spikes
2017-07-20 13:53:46 +03:00
Vlad Brezae f7cf1b7e07 [sgen] Avoid waiting for workers to report their own finish
If a worker is stuck doing work in another context, it might not be very responsive in transitioning its own state from WORK_ENQUEUED to WORKING and finally to FINISHING. When joining worker threads, we check whether we have any threads working in the corresponding context and, if there aren't any, change their state directly from the gc thread.

We can do this because work is distributed from centralized pools (worker_distribute_gray_queue and the job_queue), instead of per worker. Therefore we don't need all the workers to perform actual work in the context.
2017-07-20 13:53:43 +03:00
Marek Safar f1df763e67 Update CODEOWNERS 2017-07-20 11:42:01 +02:00
Alex Rønne Petersen fff286cdfa [acceptance-tests] Don't mark msbiology as a failure if it OOMs on 32-bit.
This is known to happen on some platforms.
2017-07-20 02:23:17 +02:00
Ludovic Henry 82a7e5bb70 [threads] Add checks around libc calls (#5240) 2017-07-19 17:50:07 -04:00
Ludovic Henry 78bcf6aa14 [threads] Make mono_thread_detach_internal static (#5241) 2017-07-19 17:49:20 -04:00
Alex Rønne Petersen 8b53bbfa5f [acceptance-tests] Further increase the individual test timeout in the profiler stress runner.
It seems ironjs-v8 takes even longer to run on ARM than fsharp, msbiology, and roslyn.
2017-07-19 21:32:21 +02:00
Zoltan Varga e0c549679a [bcl] Fix the parallel build in the tools dir. (#5236) 2017-07-19 15:03:58 -04:00
Bernhard Urban b57202ea18 [offset-tool] fix assignment for GeniOS
fixes this compilation error

MonoAotOffsetsDumper.cs(279,59): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
2017-07-19 15:40:04 +02:00
Zoltan Varga 574f999d55 [btls] Remove create-object-library.sh script which is no longer used. (#5232) 2017-07-19 00:21:32 -04:00
Alexander Köplinger 09aa3bcc30 Fix build of "unreal" profile 2017-07-19 01:14:02 +02:00
Alex Rønne Petersen aabcc3e60e Merge pull request #5224 from alexrp/profiler-multiple-args
[profiler] Better support for multiple profilers.
2017-07-19 00:39:40 +02:00
Martin Baulig d1555c7c72 [System.Net.Http]: Close request stream when HttpClientHandler.SendAsync() is done writing data. (#5226) 2017-07-18 11:09:37 -04:00
Alex Rønne Petersen 30c163826c [acceptance-tests] Increase individual timeout of profiler stress tests to 8 hours.
fsharp, roslyn, and msbiology take a very long time to run on ARM. Hopefully this is enough.
2017-07-18 10:04:29 +02:00
Zoltan Varga a8a03515fa [llvm] Disable an optimization in LLVM where we deleted and recomputed the MONO_INST_INDIRECT flags during codegen. This doesn't work since the INDIRECT flag prohibits the insertion of phi nodes, so its later removal leads to the generation of LLVM IR which is missing phi nodes. (#5227) 2017-07-18 02:21:59 -04:00
Ankit Jain b4ef279dd7 [msbuild] Bump msbuild, fix build breakage 2017-07-17 20:19:43 -04:00
Zoltan Varga 6207a4932a [llvm] Set the MonoJitInfo.from_llvm flag for methods loaded from llvm, it got broken by 1debf39341. (#5223) 2017-07-17 19:14:02 -04:00
Zoltan Varga b705b1c2aa [offsets-tool] Add a --gen-ios argument which can be used together with --targetdir= to generate ios offsets without having to specify the macos path. (#5218) 2017-07-17 18:54:59 -04:00
Ankit Jain d7a9834218 [msbuild] Bump msbuild to fix build breakage
.. specifically get msbuild@81687aa7dd4ad9b76c52c1efa841b4527e0f45f9
2017-07-17 17:58:26 -04:00
Alex Rønne Petersen 918da31c51 [profiler] Fix a crash in the AOT profiler when the output option isn't given. 2017-07-17 23:35:55 +02:00
Alex Rønne Petersen d63f005908 [mini] Support loading multiple profilers with the --profile option.
The runtime has ~always supported having multiple profilers loaded, so it
didn't make much sense that only the last --profile option given would be used.
2017-07-17 23:35:20 +02:00
Alex Rønne Petersen 074c3e056e [Mono.Profiler.Log] Remove coverage event support.
I intend to move code coverage support to a separate profiler module, so these
events will eventually be removed from the log format. As such, I'd rather not
commit to having these event classes in the API.

This won't affect users of the library who don't enable code coverage.
2017-07-17 22:47:30 +02:00
Alex Rønne Petersen 2e449ae199 [profiler] Profiler entry point name must now include the module name.
So mono_profiler_init becomes e.g. mono_profiler_init_log.

This allows us to link together multiple profilers into a single module and
load them selectively. This is especially useful for XA/XI/XM.
2017-07-17 22:45:02 +02:00
Andi McClure a7ae3550e9 Merge pull request #5194 from xmcclure/orbis-freeswept
Do not major_free_swept_blocks on Orbis.
2017-07-17 13:48:53 -04:00
Ankit Jain a30d0c3da9 [msbuild] Bump to get new changes on xplat-master 2017-07-17 13:36:45 -04:00
Vladimir Kargov ed744164fb [jit] Don't allocate a new method in mono_get_method_constrained_checked, check the cache first. 2017-07-17 10:31:52 -07:00
Alex Rønne Petersen e217c5ae86 Merge pull request #5206 from alexrp/profiler-gc-base-init
[profiler] Don't call mono_gc_base_init () before loading profilers.
2017-07-17 19:25:17 +02:00
Alex Rønne Petersen 982e1549fd [profiler] Don't call mono_gc_base_init () before loading profilers.
Calling this function could cause us to miss some profiler events.

In the past, we needed to call this function so that SMR and mono-threads were
initialized. Since then, 8dec9848f6 changed
profiler initialization to happen later during startup, so this is no longer
necessary.
2017-07-17 19:22:47 +02:00
Alex Rønne Petersen 9f2c4f328d Merge pull request #5216 from alexrp/profiler-runtime-settings
[profiler] Introduce runtime control API.
2017-07-17 19:15:13 +02:00
Albert Ruff 9c79e7a3ae Add SoapAction to Content-typ for SOAP 1.2 (#5219) 2017-07-17 18:30:44 +02:00
monojenkins 526d957b4f [msvc] Update csproj files (#5220) 2017-07-17 17:38:53 +02:00
Alexander Köplinger 68ba6c1456 Bump corefx (#5217) 2017-07-16 19:59:41 +02:00
Alexander Köplinger 4fa0463aa9 [System] Suppress a few instances of CS0618 obsolete warnings 2017-07-16 02:44:03 +02:00
Alexander Köplinger c4d38b54ad [corlib] Preserve List<T>.ConvertAll in TypeTest (#5215)
TypeTest.GetGenericMethodDefinitionOverInflatedMethodOnGTD accesses
List<T>.ConvertAll() via reflection but doesn't use the method
elsewhere so the linker can remove it. Added some usage to avoid that.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=56242
2017-07-16 01:49:00 +02:00
Alex Rønne Petersen 16385fe576 [profiler] Use g_strerror () instead of strerror (). 2017-07-15 23:13:37 +02:00
Alex Rønne Petersen 6214c2e6ed [profiler] Change sample frequency to a 32-bit int.
The unit is hertz, so values above 100-1000 are already extremely unusual.
Changing it to a 32-bit int avoids word tearing on 32-bit platforms.
2017-07-15 23:08:24 +02:00
Alex Rønne Petersen c44957bab3 [profiler] Introduce runtime control API. 2017-07-15 23:08:12 +02:00
Alex Rønne Petersen caa28c999c Merge pull request #5210 from alexrp/profiler-runtime-settings
[profiler] Housecleaning
2017-07-15 13:33:20 +02:00
Alex Rønne Petersen 903644f8f1 [profiler] Move heapshot logic to the correct GC event.
MONO_GC_EVENT_START is actually sent _after_ all the 'stop world' events. The
heapshot logic being in this switch case only worked by accident previously.
2017-07-15 02:12:38 +02:00
Alex Rønne Petersen 21bc9cf4cd [profiler] Clean up MonoProfilerGCEvent enum.
* Remove the mark/reclaim events as they've been broken for a long time and
  aren't particularly useful.
* Reorder the enum member declarations to the order they actually arrive in.
2017-07-15 02:08:40 +02:00
Alexander Köplinger 9b4b6d6211 [bcl] Remove the ValueAdd and InetAccess NUnit categories (#2212)
ValueAdd was added over a decade ago and all the tests marked with this category are passing now.

We have *tons* of tests that rely on working DNS/Internet that aren't marked with
InetAccess (and they actually provide good value so we don't want to exclude them).

Since these categories don't really make sense and just causes confusion
it's better to just remove them.
2017-07-14 23:38:31 +02:00
Alex Rønne Petersen 7f6943705e [profiler] Add a heapshot-on-shutdown option. 2017-07-14 23:31:50 +02:00
Aleksey Kliger aa07d1c2d5 [pedump] Print failure cause message when a class cannot be initialized 2017-07-14 16:16:58 -04:00
Ludovic Henry 98442ff12c Add @luhenry and @kumpera to CODEOWNERS for some files 2017-07-14 15:59:12 -04:00
Zoltan Varga bef8c4d0f8 [llvm] Reserve the proper number of got entries in the llvm got instead of 16 which used to be enough in the past. Hopefully fixes #56111. (#5207) 2017-07-14 15:39:16 -04:00
Aleksey Kliger 4ee553f888 [metadata] Encode public key length correctly for keys longer than 128 bytes
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=57691

For keys longer than 1024 bits, we encoded the length incorrectly as
   0x80 (length & 0xff)
instead of the correct algorithm:
  if (length < 0x80)
    length
  else if (length < 0x4000)
    0x80|(length>>8) (length & 0xff)
  else
    0xc0|(length>>24) (length>>16)&0xff (length>>8)&0xff length&0xff

which is provided by mono_metadata_encode_value.

See ECMA-335 II.24.2.4 #US and #Blob heaps

N.B.: we now always allocate the memory for the key as (keylen + 4) which
over-allocates by a couple of bytes in the cases where the key is shorter.
2017-07-14 14:43:18 -04:00
Aleksey Kliger 01eaabd5d4 [tests] Add regression test for InternalsVisibleTo with long PublicKey
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=57691

We build a library that has an InternalsVisibleTo attribute that references an
executable that is signed with a long (>128bytes) public key.  Previously we
were using an incorrect method of encoding the key length.
2017-07-14 14:43:18 -04:00
Aleksey Kliger f3281df8c2 [tests] Use test runner for test-internalsvisibleto
Also add the source files to EXTRA_DIST
2017-07-14 14:43:18 -04:00
Alexander Köplinger e20962e7e3 [Microsoft.Build] Relax check in BuildSubmissionTest a bit more 2017-07-14 20:27:08 +02:00
Alex Rønne Petersen 569749b214 [Mono.Profiler.Log] Fix LogProcessor.ReadObject (). 2017-07-14 20:25:04 +02:00
Alex Rønne Petersen 520fb508e6 [msvc] Update VTune project files. 2017-07-14 20:25:02 +02:00
Alex Rønne Petersen f5fd9e0b3e [profiler] Fix sampling thread shutdown logic to handle idle mode correctly. 2017-07-14 20:24:59 +02:00
Alex Rønne Petersen 9a6ef035c4 [profiler] Use tabledefs.h constants for method attributes. 2017-07-14 20:24:57 +02:00
Alex Rønne Petersen 6a1ceec1fa [profiler] Move the log format description to the header. 2017-07-14 20:24:54 +02:00
Alex Rønne Petersen 7071fe64af [acceptance-tests] Update the profiler-stress runner for removed options. 2017-07-14 20:24:52 +02:00
Alex Rønne Petersen 92ac04725e [profiler] More options reworking/refactoring.
This commit does a few different things.

First, metadata event options have been removed. We now always emit these
events. This is done because they contain important data that must be present
in order for dynamic event mask changes at runtime to result in useful data.
Also, almost all uses of the profiler require this data to be present, so
letting it be turned arguably just adds confusion for users.

Second, the PROFLOG_*_FEATURE flags have been removed. These made the code a
bit confusing because it was unclear whether code in log.c should be checking
the PROFLOG_*_FEATURE flag or the PROFLOG_*_EVENTS flag for a particular kind
of event. For heapshot in particular, the heapshot mode is now a separate enum
configuration variable. For enter/leave and coverage, switching those on and
off in the log profiler at runtime is not something we want to support at this
time.

As a result of the above change, some options are now processed manually rather
than being part of the event_list array.

Third, the way we turn off GC root events when needed is now by setting the
callback to NULL. This is more efficient as it signals to the runtime that it
doesn't have to gather root information. This will especially matter later on
when the profiler root info revamp lands, as it collects a lot more data than
we do today. Also, GC roots are no longer gathered unless we're doing a
heapshot.

Fourth, the profiler now always starts the sampling thread in idle mode. This
is so that we can reconfigure and enable/disable it at runtime as needed.

Finally, the alloc alias option now includes GC move events, and GC resize
events are only emitted if the gc option is given.
2017-07-14 20:23:32 +02:00
Ludovic Henry db1476e1cb [w32error] Add ENXIO error case (#5199)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58100
2017-07-14 10:58:25 -04:00
Alexander Köplinger 5dd17f8942 [Microsoft.Build] Make BuildSubmissionTest.EndBuildWaitsForCompletion more reliable (#5209)
We've seen this test failure a few times:

```
MESSAGE:
  #2
  Expected: greater than or equal to 00:00:01
  But was:  00:00:00.9544900

+++++++++++++++++++
STACK TRACE:
  at MonoTests.Microsoft.Build.Execution.BuildSubmissionTest.EndBuildWaitsForSubmissionCompletion () [0x000d8] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-amd64/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildSubmissionTest.cs:110
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-amd64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
```

Rewriting the test to use Stopwatch instead of DateTime
for measuring elapsed time should make it more reliable.
2017-07-14 14:47:14 +02:00
Alex Rønne Petersen ed7352ea63 [profiler] Clarify docs for mono_profiler_set_sample_mode (). 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen 93680ffb36 [profiler] Use mono_cpu_count () from utils/proclib. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen 9030c7acda [utils/proclib] Export mono_cpu_count () for use in the profiler. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen 501ded4a5e [profiler] Update file headers. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen bb725e72b0 [profiler] Use EXIT_LOG instead of EXIT_LOG_EXPLICIT where possible. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen da652801a1 [profiler] Clean up counter data structures a bit. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen 84518bc046 [profiler] Consolidate log profiler state.
Previously, the profiler's state was spread all over the place. Some stuff was
in the MonoProfiler structure, some stuff was in global variables littered
throughout log.c. Now everything is stored in MonoProfiler and ProfilerConfig.
2017-07-14 12:59:27 +02:00
Alex Rønne Petersen 1764b7e263 [profiler] Drop support for the old-style sample option. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen 275e5a5e0d [profiler] Remove the need to pass a MonoProfiler pointer around everywhere. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen dbc31d3a23 [profiler] Clean up logging to use the new logging functions. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen 0db33fa933 [profiler] Remove support for the output=-FILENAME option. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen ae67391964 [profiler] Remove the debug-coverage option. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen 776aba3f7c [utils/logger] Export logging functions for the profiler. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen bc95b8ff1e [profiler] Use explicit values for enum members. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen 8249d970e6 [profiler] Remove unused TYPE_END enum member. 2017-07-14 12:59:27 +02:00
Alex Rønne Petersen edca7989e3 [profiler] Update sample hit size calculation. 2017-07-14 12:59:27 +02:00
Zoltan Varga 2c59986b44 [llvm] Add support for fault clauses. Fixes #58114. (#5203) 2017-07-14 00:43:23 -04:00
Alexander Köplinger fce35160dd Add myself to a few paths in CODEOWNERS
Also fix a few broken markdown links in contributing.md that that I noticed.
2017-07-14 01:36:51 +02:00
Jonathan Pryor e1feed1042 @jonpryor reviews Mono.Options (#5204) 2017-07-13 21:51:19 +02:00
Alex Rønne Petersen 4e0981da06 Merge pull request #5201 from alexrp/code-owners
Add initial CODEOWNERS file.
2017-07-13 21:39:02 +02:00
Alex Rønne Petersen 6758bfec38 Add initial CODEOWNERS file. 2017-07-13 18:30:39 +02:00
Zoltan Varga 777fa66d5b [amd64] Mark RBP as 'same value' in the unwind info for the epilog so the unwind info is correct if the method is interrupted after cleaning up its frame. (#5197) 2017-07-11 17:32:46 -04:00
Johan Lorensson 46bc4f393e Incorrect parameters passed to GetDiskFreeSpaceEx causing random memory corruption. (#5196)
The call to GetDiskFreeSpaceEx passes uninitialized pointers to GetDiskFreeSpaceEx
instead of pointers to stack variables. This will cause random memory corruption and random
crashes on Windows builds.

This is a regression caused by the refactoring work done in this PR:

https://github.com/mono/mono/pull/4255
2017-07-11 23:23:54 +02:00
Alex Rønne Petersen efd961c721 Merge pull request #5190 from alexrp/profiler-roots-deprecation
[profiler] Hide the GC roots callback behind a macro and mark it obsolete.
2017-07-11 18:52:59 +02:00
Johan Lorensson 665d8d4141 Remove partial path for ml.exe and ml64.exe in mono VS runtime builds. (#5195)
Location of ml.exe and ml64.exe is different in VS2017 compared to VS2015.
By removing the partial path from the command, the VS environment will locate
the tool depending on selected build configuration and VS version.

This should work for both VS2015 and VS2017.
2017-07-11 15:21:04 +02:00
Alexander Köplinger ce3ddc2073 [System.Drawing] Remove tab from .sources 2017-07-11 02:14:45 +02:00
Andi McClure f75c72dd2d Do not major_free_swept_blocks on Orbis.
Also, the existing major_free_swept_blocks exemption for Windows is more appropriate for Windows *hosts* than Windows *targets*.
2017-07-10 17:03:17 -04:00
cherusker 7aa4bfe352 Check return value of asn1_generalizedtime_to_tm () 2017-07-10 19:05:43 +02:00
Zoltan Varga 43957a4dd7 [bitcode] Disable tests which use filter clauses when running with bitcode. 2017-07-10 12:57:52 -04:00
Alex Rønne Petersen 53482f70bc Merge pull request #5189 from alexrp/profiler-sample-type-field
[profiler] Remove the type field from TYPE_SAMPLE_HIT.
2017-07-10 17:27:03 +02:00
Alex Rønne Petersen f8ca228b2e [profiler] Remove the type field from TYPE_SAMPLE_HIT.
It's unlikely that we'll add support for other kinds of sampling in the future
as we've dropped support for perf on Linux.
2017-07-09 03:16:03 +02:00
Alex Rønne Petersen f1e68da190 [profiler] Hide the GC roots callback behind a macro and mark it obsolete. 2017-07-08 06:41:38 +02:00
Katelyn Gadd 57239e923f Add new version of SocketTest.ConnectedProperty that works on all platforms. The current version is broken on Linux FullAOT and on Mac, so this adds a new version tuned to work reliably on Windows, Linux and Mac (including FullAOT). This addresses https://bugzilla.xamarin.com/show_bug.cgi?id=52157.
Revise new ConnectedProperty test
2017-07-07 17:15:56 -07:00
Alex Rønne Petersen 1fb43ec60d Merge pull request #5187 from alexrp/debugger-fix-callback-signature
[sdb] Fix signatures of thread-related profiler callbacks.
2017-07-08 01:28:58 +02:00
Alex Rønne Petersen e7d4a0e1f7 [sdb] Fix signatures of thread-related profiler callbacks.
This was an unintended change in the profiler API overhaul.
2017-07-07 21:13:46 +02:00
Alexander Köplinger d90075ff7c Bump api-snapshot 2017-07-07 21:12:26 +02:00
Alex Rønne Petersen e5de7dacf9 Merge pull request #5180 from alexrp/profiler-zero-freq
[profiler] Don't enable sampling if frequency is zero.
2017-07-07 20:48:40 +02:00
Alex Rønne Petersen abd2d39d6b Merge pull request #5179 from alexrp/profiler-thread-name
[profiler] Report main thread name after attaching.
2017-07-07 20:45:58 +02:00
Martin Baulig f1a9bc25a1 [System]: minor cleanups. (#5186)
* [Mono.Security]: Add missing IMonoSslStream.WriteAsync() method.

* Cosmetic.

* [System]: MonoTlsStream: put implementation inside #SECURITY_DEP, not the entire class.
2017-07-07 14:12:14 -04:00
Alexander Köplinger 1418f0d58b [System.ServiceProcess] Remove "browser" service from dependencies in test (#5183)
LanmanWorkstation and SamSs services don't depend on the Browser
service anymore, at least in the Windows Server build that our
Azure VM agents on Jenkins are using now. This started failing a
few days ago so I assume a new build was rolled out.
2017-07-07 19:36:22 +02:00
Marius Ungureanu aaf9d40318 Merge pull request #5184 from mono/gtk-bump
Bump bockbuild for gtk# API compat fixes.
2017-07-07 19:50:14 +03:00
Marius Ungureanu 37ff0bcb9d Bump bockbuild for gtk# API compat fixes. 2017-07-07 19:48:52 +03:00
Alexander Köplinger 167d1a6c19 [corlib] Add test for deleting non-existing file
It shouldn't throw in that case.

Helps cover https://bugzilla.xamarin.com/show_bug.cgi?id=57629
(note that we don't explicitly test on a readonly FS as that is hard
to do in a unit test, but running this test on Android should suffice).
2017-07-07 16:17:56 +02:00
Alexander Köplinger 4de1501831 [metadata/corlib] Add apfs to list of fixed drive types
Also added some tests for DriveInfo since we didn't have any.
2017-07-07 16:17:56 +02:00
Alex Rønne Petersen 1025d82b3e [profiler] Don't enable sampling if frequency is zero.
Otherwise we would get a SIGFPE at runtime.
2017-07-07 06:21:48 +02:00
Alex Rønne Petersen ed0cefd19a Merge pull request #5181 from alexrp/master
[profiler] Fix a type name conflict.
2017-07-07 04:33:57 +02:00
Alex Rønne Petersen 70c7f2ef1d [profiler] Fix a type name conflict. 2017-07-07 03:08:33 +02:00
Zoltan Varga fd5843e964 [arm64] Really fix handler block trampolines. 2017-07-06 21:00:22 -04:00
Alex Rønne Petersen 4d35043211 [profiler] Report main thread name after attaching. 2017-07-07 02:41:57 +02:00
Alex Rønne Petersen b0057f2259 Merge pull request #5088 from alexrp/profiler-lightweight-coverage
[profiler] No longer use enter/leave instrumentation for code coverage.
2017-07-07 01:09:15 +02:00
Alex Rønne Petersen 3a7874cd61 [profiler] Don't enable GC and thread events for code coverage. 2017-07-07 01:00:27 +02:00
Alex Rønne Petersen 57962479d7 [profiler] No longer use enter/leave instrumentation for code coverage.
This was only enabled to populate a hash table that wasn't actually used.
2017-07-07 01:00:27 +02:00
Alex Rønne Petersen 076e44ac27 Merge pull request #5101 from alexrp/profiler-api
[runtime] New profiler API.
2017-07-07 00:57:16 +02:00
Alex Rønne Petersen f84179d397 [msvc] Update def files after profiler API changes. 2017-07-07 00:24:49 +02:00
Alex Rønne Petersen beabfddefb [utils] Mark mono_dl_open () as MONO_API.
This is needed on Windows.
2017-07-07 00:24:47 +02:00
Alex Rønne Petersen 8417f42847 [metadata] Mark mono_loader_register_module () as MONO_API.
This is needed on Windows.
2017-07-07 00:24:09 +02:00
Zoltan Varga 4ceda0772d [runtime] Rework process waiting. (#5175)
Instead of using fragile lockless code in the sigchld signal handler, wake up the finalizer thread and make it call back
into the process code to signal finished processes.
2017-07-06 16:23:35 -04:00
Zoltan Varga 75d5e92311 [arm] Fix the handler block trampoline, it didn't actually call the helper function. 2017-07-06 15:06:51 -04:00
Zoltan Varga 936697aa97 Revert "[arm] Fix the handler block trampoline, it didn't actually call the helper function."
This reverts commit 745a6bec4a.
Revert this as it wasn't tested properly.
2017-07-06 14:45:35 -04:00
Zoltan Varga 745a6bec4a [arm] Fix the handler block trampoline, it didn't actually call the helper function. 2017-07-06 14:30:13 -04:00
Zoltan Varga 8aaf80d011 [arm64] Fix the handler block trampoline, it didn't actually call the helper function. 2017-07-06 14:27:27 -04:00
Alex Rønne Petersen 21fb262df5 [profiler] Add MONO_PROFILER_API_VERSION macro. 2017-07-06 11:32:42 +02:00
Alex Rønne Petersen 5abf30d893 [profiler] Split shutdown callback into early/late callbacks. 2017-07-06 11:32:41 +02:00
Alex Rønne Petersen ea4e4a9ef6 [runtime] New profiler API.
* Profiler callbacks can now be changed and disabled at any point.
* API users no longer have to set event flags. The API instead uses a counter
  internally for each type of callback.
* Filter functions for enter/leave instrumentation can be installed, and they
  can choose whether to instrument the prologue, epilogue, or both.
* Managed allocators can now be instrumented for allocation profiling.
* A profiler must now declare that it wishes to use allocation profiling and/or
  sampling in its init function.
* Sampling parameters can now be changed at any point, and the sampling thread
  can be put into an idle mode when no sampling is needed.
* Only one profiler can have control over the sampling parameters. Whichever
  profiler enables sampling first gets control.
* Adding new events is now very easy: One line in profiler-events.h and one
  line wherever the event should be raised.
* Lifted the restriction that enter/leave instrumentation would cause an abort
  in full AOT mode.
* Support for call chain sampling has been removed.
* Support for the old, platform-specific code coverage mode has been removed.
* The new profiler module entry point is mono_profiler_init. If a module has
  a mono_profiler_startup symbol (the old entry point), a warning will be
  printed and the module won't be loaded.
* Updated the profiler test suite to work with instrumented managed allocators.
2017-07-06 11:32:29 +02:00
Rodrigo Kumpera dc2e330a9f Merge pull request #5172 from kumpera/proc-handles-pt2
[System] Fix handle leak in Process::GetProcess.
2017-07-05 18:25:10 -04:00
Rodrigo Kumpera cfc5d4fb3d [System] Fix handle leak in Process::GetProcess.
The runtime returns a inc'd handle to managed, so the SafeHandle should decrement on dispose.
2017-07-05 15:24:36 -07:00
Aleksey Kliger 1f93e5326c [sgen] Use an OS mutex for memory governor log entries
The mutex is used by sgen worker threads that are not attached to the mono
runtime - they cannot use a coop mutex.
2017-07-05 13:38:48 -04:00
Alexander Köplinger ee6c6efcfc [tools] Fixup 098de0b8, inadvertently deleted the wrong csproj 2017-07-05 18:02:54 +02:00
monojenkins 178bb86b7e [msvc] Update csproj files (#5170) 2017-07-05 16:10:14 +02:00
Alexander Köplinger 727cf39986 [packaging] Fixup mistake from f7c9be 2017-07-05 16:10:06 +02:00
Alexander Köplinger 098de0b8e8 [tools] Cleanup unused files in mdoc
mdoc now lives in https://github.com/mono/api-doc-tools
2017-07-05 16:02:21 +02:00
Bernhard Urban 92a45afd7b [offsets-tool] allow to set targetdir for iOS targets, so it's possible to dump offsets without maccore 2017-07-05 12:01:10 +02:00
Zoltan Varga 0c6932a985 [jit] Optimize ldloc+ldfld operations for valuetypes, so they don't require making a copy of the valuetype. Hopefully fixes #56452. (#5166) 2017-07-04 13:02:05 -04:00
Zoltan Varga ddb061f776 Revert "[jit] Optimize ldloc+ldfld operations for valuetypes, so they don't require making a copy of the valuetype. Hopefully fixes #56452. (#5166)"
This reverts commit 025ee6399b.

Revert this as it seems to break the f# build.
2017-07-04 10:08:27 -04:00
Alexander Köplinger f7c9be4890 [packaging] Add Windows hostfxr.dll to MSBuild in MSI
Part of https://bugzilla.xamarin.com/show_bug.cgi?id=57930
2017-07-04 15:01:55 +02:00
Ankit Jain 13aeb8836a Revert "[packaging/msbuild] Bump to get new changes on xplat-master (#5145)"
This reverts commit 94dcde7291.
2017-07-03 21:47:26 -04:00
Alexander Köplinger 6295559e04 Bump corefx (#5167)
* Bump corefx

* Bump API snapshot submodule
2017-07-03 23:35:53 +02:00
Zoltan Varga 025ee6399b [jit] Optimize ldloc+ldfld operations for valuetypes, so they don't require making a copy of the valuetype. Hopefully fixes #56452. (#5166) 2017-07-03 16:53:56 -04:00
Alexander Köplinger 8e88de76bb [ci] Tell babysitter where profiler stress result XML lives
This allows it to parse the XML and provide better results
about which tests failed.
2017-07-03 21:09:11 +02:00
Alexander Köplinger cbc43ad527 [Microsoft.Build] Improve assert in BuildSubmissionTest.EndBuildWaitsForSubmissionCompletion
It started failing more frequently, let's see if we can get better data.
Also did the same change to a similar test.
2017-07-03 00:43:55 +02:00
Zoltan Varga 2efd64587f [jit] Fix mono_debug_count () so it doesn't confuse COUNT=0 with COUNT not being used. 2017-07-02 18:05:38 -04:00
Alexander Köplinger 9e91b6687e [System.ServiceModel] Don't use DateTime.Now for measuring elapsed time
Use Stopwatch or DateTime.UtcNow instead which aren't affected
by things like daylight-saving time
2017-07-02 23:31:34 +02:00
Alexander Köplinger ca55ce871f [Mono.Posix] Don't use DateTime.Now for measuring elapsed time
Use Stopwatch or DateTime.UtcNow instead which aren't affected
by things like daylight-saving time
2017-07-02 23:31:34 +02:00
Alexander Köplinger b3e3e4cc40 [System] Don't use DateTime.Now for measuring elapsed time
Use Stopwatch or DateTime.UtcNow instead which aren't affected
by things like daylight-saving time
2017-07-02 23:31:34 +02:00
Alexander Köplinger 2d9f497748 [corlib] Don't use DateTime.Now for measuring elapsed time
Use Stopwatch or DateTime.UtcNow instead which aren't affected
by things like daylight saving time
2017-07-02 23:31:34 +02:00
Zoltan Varga 86ccab6997 [jit] Use the right type when handling shared versions of RuntimeHelpers.IsReferenceOrContainsReferences (). The previous version only worked by accident. (#5160) 2017-07-02 02:08:44 -04:00
Alexander Köplinger 5ad055154b [utils] Fix CppCheck warning in mono-threads-posix.c (#5161)
After the refactoring in 9aaa0083d0
CppCheck complained about using 'result' uninitialized (looks like
it can't deduce that g_error will abort the process anyway).
2017-07-01 21:06:24 +02:00
monojenkins 2247603bd8 [msvc] Update csproj files (#5162) 2017-07-01 18:53:58 +02:00
Marek Safar 18dc4ebcd0 [mcs] C#7 tuples var deconstruct 2017-07-01 00:34:37 +02:00
Marek Safar 2ceb6e9402 [mcs] Adds missing file 2017-06-30 20:22:27 +02:00
Marek Safar d2a26c9595 [mcs] C# 7 tuple (foundation only).
Still couple of advanced features not implemented and parser cannot
deal with unnamed tuple type at type declaration level.
2017-06-30 19:47:06 +02:00
Rodrigo Kumpera bb99b3ef99 Merge pull request #5159 from MaurGi/patch-1
Console.Error.WriteLine in System.Net.NetworkInformation
2017-06-30 12:18:20 -04:00
Mauro Giusti 39af47841f Console.Error.WriteLine in System.Net.NetworkInformation
Console.Error.WriteLine ("Got a bad hardware address length for an AF_PACKET {0} {1}",...

This Console.WriteLine interferes with Apache Storm that reads from the console I/O.

See bug: https://bugzilla.xamarin.com/show_bug.cgi?id=57887
2017-06-30 09:13:31 -07:00
Rodrigo Kumpera bb0e787f60 Merge pull request #5144 from kumpera/handle-fixes-part1
[io-layer] Fix two race conditions, one on FD handle creation and one on interrupt install.
2017-06-30 10:56:08 -04:00
Rodrigo Kumpera 83832615fa Merge branch 'master' into handle-fixes-part1 2017-06-30 10:55:20 -04:00
Aleksey Kliger (λgeek) 6559b16c14 Merge pull request #5156 from lambdageek/bug-57850+57851
[sre] Deal with ResolveEventHandler returning an AssemblyBuilder (Fixes #57850, #57851)

Fix a couple of bugs in the situation where a `ResolveEventHandler` happens to return an `AssemblyBuilder`.

* [#57850](https://bugzilla.xamarin.com/show_bug.cgi?id=57850) - if the `ResolveEventHandler` returns a reflection only assembly, throw a `FileNotFoundException`
* [#57851](https://bugzilla.xamarin.com/show_bug.cgi?id=57851) - don't look for a `ReferenceAssemblyAttribute` on assemblies returned by a `ResolveEventHandler` if they happen to be an `AssemblyBuilder`. (the native code path to get there is to try and instantiate a custom attribute in some other assembly, hence the fairly convoluted test in `assemblyresolve_event5` and its helper files)
2017-06-30 10:24:57 -04:00
Aleksey Kliger 225848bd65 [loader] Don't try to look for ReferenceAssemblyAttribute on dynamic assemblies (Fixes #57851)
.NETFramework seems to ignore this custom attribute and allows instantiating
types from on assembly builders.
2017-06-30 00:36:28 -04:00
Aleksey Kliger fa6194cc19 [loader] Throw exn if ResolveEventHandler returns a refonly assembly (Fixes #57850)
(Also depends on previous commit to ensure that MonoAssembly:refonly is set
correctly for dynamic assemblies)
2017-06-30 00:36:27 -04:00
Aleksey Kliger a1eb52aa13 [sre] Mark AssemblyBuilderAccess.ReflectionOnly assemblies as refonly
This will ensure they show up in AppDomain.ReflectionOnlyGetAssemblies(), and
won't be allowed to execute
2017-06-30 00:36:27 -04:00
Aleksey Kliger a2ee7059d0 [sre] use AssemblyBuilderAccess bitmask to set MonoDynamicImage flags
In particular this makes sure that AssemblyBuilderAccess.ReflectionOnly aren't
allowed to run.  And AssemblyBuilderAccess.CollectAndRun aren't allowed to save.
2017-06-30 00:36:26 -04:00
Aleksey Kliger 572f79d0f3 [sre] Add MonoAssemblyBuilderAccess enum in native code
in sync with System.Reflection.Emit.AssemblyBuilderAccess
2017-06-30 00:36:25 -04:00
Aleksey Kliger 30223ad01d [mono-error] Add mono_error_set_file_not_found
To throw System.IO.FileNotFoundException
2017-06-30 00:36:25 -04:00
Aleksey Kliger 6221c90f95 [tests] ResolveEventHandler that returns an AssemblyBuilder shouldn't crash mono
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=57851
2017-06-30 00:36:24 -04:00
Zoltan Varga 27ce756030 [runtime] Use pthread_cond_timedwait_relative_np () function on osx if available. (#5147) 2017-06-29 23:05:00 -04:00
Zoltan Varga 51d1c47c8b [aot] Load aot images only in the root domain. (#5151) 2017-06-29 22:02:08 -04:00
Aleksey Kliger 57ae95d7aa [tests] Throw an error if ResolveEventHandler returns a reflection only AssemblyBuilder
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=57850
2017-06-29 19:28:13 -04:00
Aleksey Kliger 810e4a15dd [tests] Add some missing files to EXTRA_DIST 2017-06-29 19:28:11 -04:00
Zoltan Varga ed6183c2b9 [runtime] Make runtime invoke wrappers for dynamic methods non-shareable, so they can be freed when the dynamic method is freed. (#5152) 2017-06-29 18:10:34 -04:00
Eberhard Beilharz cd39375a39 [System] Request 32-bit capabilities
This fixes a crash that happened when running in the debugger.
This fixes Xamarin-21261.

Change-Id: I0ccda9f3c11ec02457a932073665721be5e4e83e
2017-06-29 23:16:46 +02:00
Alex Rønne Petersen 87c125c435 Merge pull request #5140 from alexrp/profiler-stress-fpe-fix
[acceptance-tests] Don't pass a zero sampling/heapshot frequency in the profiler stress runner.
2017-06-29 18:52:20 +02:00
monojenkins 07959b40bb [msvc] Update csproj files (#5149) 2017-06-29 18:21:43 +02:00
Ankit Jain 94dcde7291 [packaging/msbuild] Bump to get new changes on xplat-master (#5145) 2017-06-29 08:41:29 -04:00
Alexander Köplinger b59125ca81 [bcl] Drop a bunch of unused _2_1.cs files (#5112)
* [bcl] Drop a bunch of unused _2_1.cs files

They weren't used anywhere, not even mobile, so we can remove them.
2017-06-29 13:21:49 +02:00
Zoltan Varga 6c37483822 Revert "[runtime] Use pthread_cond_timedwait_relative_np () function on osx if available. (#5143)"
This reverts commit 616ea50718.

Revert this as it fails to build on wrench.
2017-06-29 02:20:50 -04:00
Zoltan Varga 616ea50718 [runtime] Use pthread_cond_timedwait_relative_np () function on osx if available. (#5143) 2017-06-29 01:02:53 -04:00
Rodrigo Kumpera 1a8bdd5aff [io-layer] Fix two race conditions, one on FD handle creation and one on interrupt install.
mono_w32handle_new_fd: We must hold scan_mutex while initializing an unallocated handle otherwise
mono_w32handle_foreach might think it's a valid handle.

mono_w32handle_timedwait_signal_handle: We must increment the refcount before installing the interrupt handle
as the other end can be called right after we finish installing and would trigger a failure.
2017-06-28 15:48:28 -07:00
Ludovic Henry 6d88df8d82 [w32handle] Replace mono_w32handle_{ref,unref} by mono_w32handle_{duplicate, close} (#5106)
* [w32handle] Fix handle dumped ref

* [w32handle] Replace exposing mono_w32handle_{ref,unref} by mono_w32handle_{duplicate,close}, it is closer to what the win32 API exposes.

* [w32handle] Remove unrefing of handles on shutdown

If one of the handle is a file handle for example, then w32file has already be cleaned up, so we cannot guarantee that the handle we are going to close is not going to call into w32file code.
2017-06-28 18:42:35 -04:00
Jonathan Chambers 6ca11b76d6 Implement GC roots ourselves in Boehm rather than relying on their concept of roots which is mainly for static data segments in binaries and not implemented on all platforms (cannot remove roots on Windows) (#564) 2017-06-28 14:43:38 -04:00
Alexander Köplinger 6400a71595 [packaging] Remove git_branch from msbuild and mono-extensions (#5141)
We're checking out a specific commit for both now so the git branch
is no longer required.

Also fixes warnings that a 2017-06 branch doesn't exist in mono-extensions.
2017-06-28 19:42:46 +02:00
Jo Shields a12daa47e0 Manually invoke Xvfb, don't depend on the xvfb plugin (#5132) 2017-06-28 19:41:25 +02:00
Marek Safar 90ca313240 [build] Add a new profile 2017-06-28 18:51:26 +02:00
Aleksey Kliger 505695fcd1 [nullgc] When building nullgc, don't try to link Boehm libs
Previous nullgc commit (52d9a55a86) didn't actually work in a clean tree.
2017-06-28 10:20:05 -04:00
Alex Rønne Petersen 3298fe7f21 [acceptance-tests] Don't pass a zero sampling/heapshot frequency in the profiler stress runner.
Also change the code to make it more likely that we actually do some runs
without sampling or heapshot enabled.
2017-06-28 14:07:39 +02:00
Vlad Brezae 5599130b36 [sgen] Make job waiting reliable
While this is not an issue yet, sgen_thread_pool_wait_for_all_jobs is logically expected to be called by the main thread and resume execution after all jobs have been executed. Concurrent M&S can enqueue additional jobs as part of its finishing phase, which means that we could detect early that no more jobs are to be processed. Make sure this is not the case.
2017-06-28 13:12:06 +03:00
Zoltan Varga 17d4227002 [w32handle] Add some debugging code to help track down handle wait problems. (#5136) 2017-06-27 19:44:58 -04:00
Zoltan Varga 85a3e77247 [w32handle] Zero out the handle specific data in the handle dtor to help debugging. (#5135) 2017-06-27 18:05:34 -04:00
monojenkins 71c58f8fb0 [msvc] Update csproj files (#5131) 2017-06-27 18:32:41 +02:00
Alexander Köplinger 08559f8a29 [man] Fix AOT temp path option description
It's `temp-path` in the code, not `temp_path`
2017-06-27 16:58:46 +02:00
Aleksey Kliger (λgeek) af2b3eb197 Merge pull request #5120 from lambdageek/bug-57744
[reflection] Convert correct MonoError to an exn in Assembly.GetTypes ()
2017-06-27 10:44:30 -04:00
cherusker 4aa28ede12 Fix various compiler warnings (#5064)
* Fix compiler warnings (w32)

- add explicit (long long (unsigned)) type casts

- change %ld to %lld once, to match the general style of these logging messages

* Fix compiler warnings (threadpool)

- add explicit (void *) type casts

* Fix compiler warnings (boehm)

- add an explicit (long) type cast; the values are defined as gint64, an upgrade to at least "%ld" seems like a good idea

- about dropping const: const does not seem to be necessary as g_getenv() returns pointers to freshly allocated buffers whenever called. const might have been used to protect the return value of g_getenv() on unix systems with earlier versions of Mono (as a comment in gmisc-unix.c suggests). keeping const here causes a compiler warning, as the const qualifier gets dropped when *env is being used with g_free(). that led to the decision to drop the qualifier altogether.

* Fix compiler warnings (sgen)

- specify the arguments (void) to avoid -Wstrict-prototypes warnings

* Fix compiler warnings (misc - metadata)

- specify the arguments (void) to avoid -Wstrict-prototypes warnings

* Fix compiler warnings (misc)

- specify the arguments (void) to avoid -Wstrict-prototypes warnings

- add an explicit (void *) type cast; changing the return type to char* might be more usable and could be discussed

- ret is not being used and can be removed; fixes a -Wunused-but-set-variable warning

* Fix compiler warnings (mini)

- specify the arguments (void) to avoid -Wstrict-prototypes warnings

* [fixup!] Correct indentation

* [fixup!] Correct (void *)
- use GUINT_TO_POINTER and MONO_NATIVE_THREAD_ID_TO_UINT instead of (void *) to cast mono_native_thread_id_get () to %p

* [fixup!] Correct indentation of boehm-gc.c and add FIXME

* include <inttypes.h> and test the G_GINT64_FORMAT macro

* [fixup!] Use G_G*_FORMAT and PRIx32 macros instead of type casts wherever possible
2017-06-27 16:21:34 +02:00
Ankit Jain 67f753a893 [packaging/msbuild] Bump to get new changes on xplat-master (#5127) 2017-06-27 00:57:07 -04:00
Zoltan Varga 492438a431 [jit] Avoid emitting op_load_got_addr opcodes on x86 when using llvmonly, its not needed. (#5125) 2017-06-26 23:19:07 -04:00
Aleksey Kliger bebd8dc438 [reflection] Convert correct MonoError to an exn in Assembly.GetTypes () (Fixes #57744)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=57744
2017-06-26 16:09:34 -04:00
Aleksey Kliger 13d0bab910 [bcl] Delete our ReflectionTypeLoadException
We use the referencesource version
2017-06-26 16:07:11 -04:00
Alexander Köplinger f892c7c574 [cil-strip] Move comment out of .sources file
I forgot that we only run gensources.sh on libraries but not
tools so the comments don't get stripped out...
2017-06-26 19:19:10 +02:00
Zoltan Varga 5e6e6df993 [runtime] Add more logging in case mono_os_cond_timedwait () fails. 2017-06-26 13:04:45 -04:00
Alexander Köplinger 5d69157964 Bump API snapshot 2017-06-26 17:13:11 +02:00
Marius Ungureanu fd185fb454 [System.Core] Implement MemoryMappedFile.OpenExisting
Reuse the existing icall infrastructure to give the same handle back.

This PR implements all OpenExisting methods (with the access rights parameter discarded) and the SafeHandle property.
In the runtime, we don't check the capacity parameter if we try to open a mmap file, and we fallthrough the handle refcount case.
2017-06-26 16:57:31 +02:00
Alexander Köplinger a8c53ebf16 Revert "[cil-strip] Remove old private copy of Mono.Cecil"
(reverted from commit 4ea3122758)
2017-06-26 12:35:56 +02:00
Alexander Köplinger f068fb6b66 Revert "[cil-strip] Upgrade to latest Mono.Cecil API"
(reverted from commit 0c9eb70a46)

Using newer Cecil means metadata tokens will be different which
breaks AOT compilation: https://github.com/mono/mono/pull/5102#issuecomment-310801767
2017-06-26 12:33:36 +02:00
monojenkins 1db2001526 [msvc] Update csproj files 2017-06-26 08:55:42 +02:00
Zoltan Varga 7ccddf9832 [llvm] Align aot variables to 8 bytes, parts of the aot code depend on it. 2017-06-24 15:12:47 -04:00
Aleksey Kliger 52d9a55a86 [null_gc] Get null GC building again.
- Had to borrow a gchandles implementation from mono/metadata/boehm-gc.c
- Added coop handles support for NULL GC
- Fixed typos in configure.ac
- To use: `./configure --with-libgc=none --without-sgen --enable-boehm`
  You get a mono-boehm which actually is not collecting anything.
2017-06-24 11:29:16 -04:00
Ankit Jain 80165d2117 [packaging/msbuild] Bump to get new changes on xplat-master (#5113) (#5114) 2017-06-23 23:35:53 -04:00
Ludovic Henry 8724ace98a [System] Fix compilation on watchos (#5108) 2017-06-23 19:32:35 -04:00
Alexander Köplinger 4ea3122758 [cil-strip] Remove old private copy of Mono.Cecil
No longer needed now that we're using the new Cecil.
2017-06-24 01:25:03 +02:00
Alexander Köplinger 0c9eb70a46 [cil-strip] Upgrade to latest Mono.Cecil API
This greatly simplifies the code and as a bonus also shaves off
about 300ms when stripping mscorlib.dll.
2017-06-24 01:25:03 +02:00
Rodrigo Kumpera ff285585d4 Merge pull request #5103 from alexrp/profiler-signal-ack-fix
[profiler] Do the signal ack after checking that the thread is detached.
2017-06-23 15:30:14 -07:00
Zoltan Varga 14867dbabe [aot] Fix aot image loading messages in static mode. 2017-06-23 16:17:34 -04:00
Vlad Brezae 27b67e3586 Merge pull request #5084 from BrzVlad/feature-worker-context
[sgen] Implement sgen worker context
2017-06-23 21:10:18 +03:00
Vlad Brezae e693ce5077 [sgen] Use concurrent mark concurrently with parallel minors 2017-06-23 20:47:49 +03:00
Vlad Brezae 606677431a [sgen] Implement work context for thread pool threads
We need to run jobs on the thread pool threads for parallel minor, parallel major, concurrent mark and concurrent sweep, some of which can run simultaneously. Instead of making separate threads reserved for each type of work, we create a work context abstraction (this contains a set of pending jobs to run and the sgen-worker callbacks). When a thread pool thread looks for work, it searches for work (jobs and idle work) through all contexts and finishes work from each one of them, from the highest to the lowest priority.

This is implemented by having different thread pool contexts (which contain the job list, work callbacks that indicate whether it should work and its ineherent priority), overall unrelated to the GC. The sgen worker infrastructure also creates separate worker contexts (which contain the object ops to be used and information about each worker, like the state and the private gray queue). We use at most two worker contexts (for minor and for major) and each worker context makes use of a sgen thread pool context.
2017-06-23 20:47:49 +03:00
Vlad Brezae 271c88f8a8 [sgen] Remove redundant code
We always init worker distribute gray queue when initialising worker infrastructure.
2017-06-23 20:46:09 +03:00
Vlad Brezae 506d5d4049 [sgen] Include split count in the parallel job
We were getting the split_count at job run time which makes little sense. Include it in the job, alongside the job index.
2017-06-23 20:46:09 +03:00
Vlad Brezae 6bb78cace3 [sgen] Run the scan pinned object job concurrently with minors
Concurrent mark doesn't normally scan objects in the nursery since they can be moved. At the end of the concurrent mark, we were locking over the entire gc pause in order to make sure that the we can scan the latest pinned object list (aka none of those objects can be moved). Lock only over the pinning phase of the collection, since it is enough.
2017-06-23 20:46:09 +03:00
Vlad Brezae 5348325a64 Merge pull request #5098 from BrzVlad/fix-sgen-pagesize
[sgen] Fix sgen pagesize
2017-06-23 20:06:51 +03:00
Marius Ungureanu d181fe7194 Merge pull request #5104 from mono/bump-bockbuild
Bump bockbuild
2017-06-23 19:08:23 +03:00
Marius Ungureanu 26eacdc3dc Bump bockbuild 2017-06-23 19:05:48 +03:00
Alex Rønne Petersen 87d8bdef08 [profiler] Do the signal ack after checking that the thread is detached.
Otherwise we could crash in mono_thread_info_current ().
2017-06-23 16:52:24 +02:00
Chris Lapa 04b6339bd1 [aot] fixes temp-path argument only working when using LLVM compiler. (#5099)
Signed-off-by: Chris Lapa <[email protected]>
2017-06-23 09:30:23 -04:00
Ankit Jain c7b19b52fd [packaging/msbuild] Bump to get new changes on xplat-master 2017-06-23 02:16:31 -04:00
Ankit Jain 5b2437d62f [packaging/msbuild] Update commit hash to point to xplat-master HEAD (#5100) 2017-06-22 21:35:09 -04:00
Vlad Brezae 3ea09f9c8f [sgen] Performance improvement for ms_block_size computations
This reduces regressions for switching from MS_BLOCK_SIZE compile time constant
to ms_block_size variable by 85% on the tests where this was showing up. In the
future we should implement a block allocator, which would, amongst other benefits,
enable us to remove the block-size/page-size dependency.
2017-06-23 01:14:27 +03:00
Vlad Brezae abd1bd5d8f [sgen] Fix MS block size calculation.
The block size must be a multiple of the system page size. Page size simply
cannot be determined reliably at compile time, so we must obtain the page size
through a system call on startup and use it as the block size. We still enforce
a minimum block size of 16kb on systems where the page size is smaller than
that.

The old code hardcoded page sizes for certain architectures with large pages.
THe problem is that those architectures don't necessarily have to have large
pages and on systems where this wasn't the case, we'd end up with a block size
much larger than needed.

Rebase of @alexrp's work.
2017-06-23 01:06:49 +03:00
Rodrigo Kumpera 86968831ec Merge pull request #5095 from kumpera/fix_fullaot
[aot] Fix the name of the mono_gc_wbarrier_range_copy icall. FullAOT with direct calls requires it.
2017-06-22 14:55:52 -07:00
Zoltan Varga af835fc6de [arm] Handle large offsets in OP_SEQ_POINT. Fixes #57476. (#5094) 2017-06-22 17:15:27 -04:00
Alex Rønne Petersen ab5220be93 Merge pull request #5090 from alexrp/profiler-class-unload-removal
[profiler] Remove class unload events.
2017-06-22 21:03:01 +02:00
Alex Rønne Petersen 32801300d1 [profiler] Remove class unload events.
These are never actually emitted by the profiler API because they make no sense
in the context of Mono's metadata layer.
2017-06-22 21:02:18 +02:00
Alex Rønne Petersen 1ec9117f63 Merge pull request #5089 from alexrp/profiler-deadlock-fix
[profiler] Fix a deadlock due to recursive use of the buffer lock.
2017-06-22 20:56:48 +02:00
Rodrigo Kumpera adc4d3c471 [aot] Fix the name of the mono_gc_wbarrier_range_copy icall. FullAOT with direct calls requires it. 2017-06-22 11:48:13 -07:00
Alex Rønne Petersen 0279b08ccb Merge pull request #5092 from alexrp/mini-coverage-increment
[mini] Use an atomic add for the code coverage counter when possible.
2017-06-22 20:39:37 +02:00
Eddie Hedges 2602f25eb7 Docs: added missing ) to RelaxngPattern snippet (#5093) 2017-06-22 18:48:40 +02:00
Alex Rønne Petersen de3fa74e12 [mini] Use an atomic add for the code coverage counter when possible. 2017-06-22 17:32:10 +02:00
Zoltan Varga 522c8b69f5 [runtime] Add a few missing error_init () calls to the mono_custom_attrs_from_... functions. Fixes #57488. (#5076) 2017-06-22 10:27:07 -04:00
Zoltan Varga f8a1ab5d75 [sre] Fix the signature of the create_dynamic_method () icall, make it static since the C implementation only takes two parameters, this only caused problems if the icall set the error, since it overwrite the DynamicMethod object instead. Fixes #57301. (#5081) 2017-06-22 10:26:46 -04:00
Alex Rønne Petersen 6f43750475 Merge pull request #5091 from alexrp/mini-enter-leave-cleanup
[mini] Remove codegen special cases around MONO_PROFILE_ENTER_LEAVE.
2017-06-22 15:55:26 +02:00
Alex Rønne Petersen e0e341c7d1 [mini] Remove codegen special cases around MONO_PROFILE_ENTER_LEAVE.
Enter/leave instrumentation is now done with icalls at the IR level, so these
special cases are no longer needed.
2017-06-22 12:02:14 +02:00
Alex Rønne Petersen b0be338837 [profiler] Fix a deadlock due to recursive use of the buffer lock.
The lock no longer supports recursion as of 10ba222234.
Not that it ever really did, since the old implementation was buggy.
2017-06-22 10:30:29 +02:00
Ludovic Henry 9df453295e [threads] Enable blocking transition with MONO_ENABLE_BLOCKING_TRANSITION env variable (#5087) 2017-06-21 20:46:18 -04:00
Alex Rønne Petersen e40724e169 [utils/mmap] Prefer sysconf () over getpagesize () in mono_pagesize ().
The former is async-signal-safe, while the latter makes no guarantees and also
isn't actually portable.
2017-06-21 22:40:12 +03:00
Aleksey Kliger (λgeek) 310be7a2fb Merge pull request #5079 from lambdageek/dev-setvalue
[coop handles] Implement various SetValue methods
2017-06-21 15:32:29 -04:00
Rodrigo Kumpera 824b01d4fc Merge pull request #5082 from kumpera/fix-ro-fs-file-delete
[io-layer] When deleting a file, check for EROFS and verify if the file exists. Fixes #57629.
2017-06-21 10:34:01 -07:00
Rodrigo Kumpera fec0e65560 [runtime] Update comment with link to Linux Kernel fix. 2017-06-21 09:56:58 -07:00
Bernhard Urban 55293097e1 [interp] disable context-static.exe on CI as it suffers from stack usage issue 2017-06-21 17:26:25 +02:00
Bernhard Urban d1aa491294 [interp] fix BARRIER_IF_VOLATILE usage 2017-06-21 17:26:25 +02:00
Alex Rønne Petersen 32a5d1fc3b [interp] Handle the no. prefix instruction as a no-op. 2017-06-21 17:26:25 +02:00
Alex Rønne Petersen 18f2255ecd [interp] Add support for the volatile. prefix instruction. 2017-06-21 17:26:25 +02:00
Alex Rønne Petersen f44ff23078 [interp] Add MINT_MONO_MEMORY_BARRIER. 2017-06-21 17:26:25 +02:00
Alex Rønne Petersen c738a606d2 [interp] Fix oplength of MINT_MONO_TLS. 2017-06-21 17:26:25 +02:00
Alex Rønne Petersen 983b5a8cbe [interp] Update comment to clarify meaning of oplength. 2017-06-21 17:26:25 +02:00
Marek Safar 21192c8424 [mcs] Add missing vector cloning of definite assignment on-true. Fixes #57505 2017-06-21 15:13:31 +02:00
Alex Rønne Petersen 7ed46ff6e1 Merge pull request #5072 from alexrp/profiler-stability
[profiler] A bunch of profiler bug/stability fixes.
2017-06-21 02:06:28 +02:00
Marek Safar d2b64bb5cf [mcs] Fixes regression introduced by a0fc3f4dcf to consider user set values. Fixes #57242 2017-06-21 00:14:05 +02:00
Rodrigo Kumpera 3454feb426 [io-layer] When deleting a file, check for EROFS and verify if the file exists. Fixes #57629.
Linux has this particular behavior of returning ENOFS when unlinking from an read only FS.
Even if the file doesn't exists! Darwin does the sane thing and return ENOENT in this case.

To workaround this, if unlink returns EROFS, we stat the file and deal with that.
2017-06-20 14:59:09 -07:00
Marek Safar 5acc6be700 Bump roslyn to 2.3 beta 2 2017-06-20 23:18:07 +02:00
Aleksey Kliger 3e514ce907 [runtime] Use coop handles for System.Array.SetValue 2017-06-20 15:00:04 -04:00
Aleksey Kliger 1f85a462e9 [runtime] Use coop handles for System.Array.SetValueImpl 2017-06-20 15:00:02 -04:00
Aleksey Kliger 51c97ade65 [runtime] Make array_set_value_impl single-exit 2017-06-20 15:00:01 -04:00
Aleksey Kliger c2f95645ca [runtime] Don't call icall ves_icall_System_Array_SetValueImpl directly
add a helper function array_set_value_impl and call that from elsewhere in
native code.
2017-06-20 14:59:59 -04:00
Aleksey Kliger 3611e8ec48 [runtime] Add mono_error_set_invalid_cast () 2017-06-20 14:59:57 -04:00
Aleksey Kliger 6344d4be9f [runtime] Use coop handles for System.Reflection.MonoField.SetValueInternal 2017-06-20 14:59:56 -04:00
Marek Safar 1334748e5a Bump corefx 2017-06-20 20:17:08 +02:00
Aleksey Kliger b5d64ebd0a [runtime] Add mono_nullable_init_from_handle 2017-06-20 13:53:46 -04:00
monojenkins ef29b9fbfa [msvc] Update csproj files (#5075) 2017-06-20 18:30:37 +02:00
Aleksey Kliger 7ee123b1e2 [coop handles] Add MONO_HANDLE_SET_FIELD_REF macro
Set a field in an object when you have a MonoClassField*
2017-06-20 11:29:43 -04:00
Aleksey Kliger 5831edbc3f [coop handles] Add mono_object_handle_pin_unbox 2017-06-20 11:29:43 -04:00
Bernhard Urban 68f5463685 [bcl tests] do not attempt to delete non-existing files
This fixes an issue we see on the BCL test suite when run in the context
of Xamarin Android:

```
I/mono-stdout( 2534):     Certificate1 [FAIL] : TearDown : System.UnauthorizedAccessException : Access to the path "temp.b64" is denied.
```

It seems like those files aren't generated anymore.  Not sure why this
starts to be a problem now.
2017-06-20 16:36:28 +02:00
Alex Rønne Petersen f4346ebc54 [profiler] Remove an unnecessary check that could hide potential bugs. 2017-06-20 06:38:21 +02:00
Alex Rønne Petersen 4cf3f02cac [acceptance-tests] Update the profiler-stress test runner for the profiler's new argument style.
This allows us to test a lot more combinations than previously.
2017-06-20 06:22:28 +02:00
Alex Rønne Petersen afa9a853fb [profiler] Fix 'no' argument parsing. 2017-06-20 05:49:58 +02:00
Alex Rønne Petersen 10ba222234 [profiler] Implement a new buffer reader/writer lock algorithm.
See the comment + assertions to get an idea of how it works.
2017-06-20 05:39:16 +02:00
Alex Rønne Petersen ccd373f429 [profiler] Require an ack of the previous sampling signal before sending another.
This avoids situations where we could end up filling the signal queue
completely, leading to the undocumented EAGAIN return value from pthread_kill,
which breaks ~everything in the STW/GC code because it thinks an error return
value from pthread_kill means the thread has exited.

The actual reason why this happened is that when a thread is suspended, we mask
all signals except the restart signal for that thread. This means that a
program with a large number of threads or where GC collections could take
longer than usual would end up with tens of thousands of sampling signals
queued up, eventually reaching the limit of the user-level signal queue (see
`ulimit -i` and `RLIMIT_SIGPENDING`).

We only do this on systems where we use real time signals. Non-RT signals do
not have this problem as the kernel will throttle them.
2017-06-20 05:39:14 +02:00
Alex Rønne Petersen bdfa3ef2ca [utils/threads] Export small ID functions as part of the API.
These will be used in the log profiler.

Also, make mono_thread_info_register_small_id () only allocate a new small ID
if one isn't already allocated for the current thread. This is necessary so
that we can allocate a small ID for a thread and not have it be overwritten
if/when that thread is later attached probably (which also results in this
function being called).
2017-06-20 05:39:12 +02:00
Alex Rønne Petersen 9aaa0083d0 [utils/threads] Print an error and abort if pthread_kill returns an error that isn't ESRCH. 2017-06-20 05:39:11 +02:00
Alex Rønne Petersen 333c6665a2 [profiler] Remove a FIXME that likely won't be addressed now. 2017-06-20 05:39:09 +02:00
Alex Rønne Petersen 1ebb4e4cbd [profiler] Ensure that buffer size is adjusted to whatever an event actually needs.
Very large events could previously result in potential overflows because
buffers always had the same size (BUFFER_SIZE, 64k).
2017-06-20 05:39:07 +02:00
Alex Rønne Petersen 1448821251 [profiler] Remove the buffer size hack in ensure_logbuf_unsafe ().
This is blatantly hiding potential bugs. This kind of code is not okay.
2017-06-20 05:39:06 +02:00
Alex Rønne Petersen 37ddfb1da4 [profiler] Attach threads automatically in all callbacks.
This hardens the profiler against cases where an unattached thread causes some
event callback to be invoked. This is particularly relevant when embedding.
2017-06-20 05:38:51 +02:00
Alex Rønne Petersen ce31c277fb [profiler] Flush the dumper thread every second.
If a program is idle, we likely won't get enough samples to prompt the dumper
thread to send its log buffer to the writer thread. This can make it seem like
the profiler isn't working when it actually is. So, just send the dumper
thread's log buffer every second to make sure data is delivered in a timely
fashion.
2017-06-20 03:19:44 +02:00
Alex Rønne Petersen 38d0080cf5 [profiler] Take the reader lock when modifying the thread-local method list.
It can be modified by other threads during sync points.
2017-06-20 03:19:44 +02:00
Ludovic Henry a08574bf9e [threads] Store MonoInternalThread in MonoThreadInfo for use when detaching (#5058)
* [threads] Make mono_thread_attach_full static

* [threads] Remove  prefix on MonoThreadInfoCallbacks callbacks

* [threads] Rename mono_threads*_init functions to mono_thread_info*_init

* [threads] Remove dead method mono_runtime_is_critical_method

* [threads] Move MonoThreadInfoCallbacks to metadata/threads

* [threads] Store MonoInternalThread in MonoThreadInfo for use when detaching

When the native thread would exit, the TLS keys are destroyed. There is a TLS destructor for MonoThreadInfo, but not for MonoInternalThread. If MonoInternalThread is destroyed before MonoThreadInfo, then MonoThreadInfoCallbacks.thread_detach wouldn't successfully detach the current MonoInternalThread as mono_thread_internal_current would return NULL. This would lead to MonoInternalThread still laying around, while their corresponding MonoThreadInfo has already been destroyed. This fixes this problem, since we now rely on MonoThreadInfo to store the MonoInternalThread for detach.
2017-06-19 20:35:54 -04:00
Alex Rønne Petersen 3765f987d5 Merge pull request #5070 from alexrp/profiler-version-bump
[profiler] Bump log profiler version to 2.0 due to breaking argument changes.
2017-06-20 01:29:15 +02:00
Alex Rønne Petersen 523e9ff615 [profiler] Bump log profiler version to 2.0 due to breaking argument changes. 2017-06-20 01:24:51 +02:00
Alex Rønne Petersen 8da9924557 Merge pull request #5062 from alexrp/profiler-library
[profiler] Introduce the Mono.Profiler.Log library. (take 2)
2017-06-20 01:04:18 +02:00
Alex Rønne Petersen fbb36d5500 [profiler] Introduce the Mono.Profiler.Log library. API still unstable. 2017-06-20 00:47:52 +02:00
Alex Rønne Petersen bcd8b38b57 Merge pull request #5063 from alexrp/profiler-format-changes
[profiler] A few small format changes
2017-06-20 00:46:50 +02:00
Alex Rønne Petersen a308a7cd22 [profiler] Bump format version to 14. 2017-06-20 00:31:21 +02:00
Alex Rønne Petersen 7ef2b4f919 [profiler] Update format description comment. 2017-06-20 00:31:19 +02:00
Alex Rønne Petersen 33db577741 [profiler] Encode the address in TYPE_SAMPLE_UBIN as a pointer. 2017-06-20 00:31:18 +02:00
Alex Rønne Petersen 1fc8f5631c [profiler] Add an exception object field to TYPE_CLAUSE. 2017-06-20 00:31:16 +02:00
Alex Rønne Petersen c4c6a9373d [profiler] Add an image pointer field to assembly load events. 2017-06-20 00:31:14 +02:00
Alex Rønne Petersen 1520a7aaba [profiler] Simplify the encoding of monitor events.
The way the event was encoded was highly irregular with respect to the rest of
the format.
2017-06-20 00:30:45 +02:00
Zoltan Varga 533bcc0c49 [jit] Fix a warning. 2017-06-19 16:52:57 -04:00
Aleksey Kliger (λgeek) 26cad094ee Merge pull request #5059 from lambdageek/tbt
[tests] Rework TypeBuilderTest SetUp/TearDown
2017-06-19 15:41:14 -04:00
Zoltan Varga bee68ad79f [arm64] Remove an assert which is hit when mono_arch_get_call_target () is called with a 'b' instead of a 'bl'. 2017-06-19 14:33:54 -04:00
Rodrigo Kumpera b5d36a9abb Merge pull request #5027 from kumpera/damn-you-strerror
[eglib] Replace strerror with strerror_r as the former is not thread safe.
2017-06-19 14:00:03 -04:00
Zoltan Varga ca7b288837 [jit] Treat the mono_threads_attach_coop () icall specially, since it can be called from native-to-managed wrappers on unattached threads, so calling it shouldn't go through the trampoline infrastructure. (#5056) 2017-06-19 13:49:31 -04:00
Aleksey Kliger f99700a264 [tests] Don't run SRE saved assembly in current process
Windows doesn't like deleting the file, and the original bug was a problem in
SRE, not in the AssemblyBuilder.Save ()
2017-06-19 12:35:38 -04:00
Zoltan Varga df203f3532 [interp] Implement runtime invokes by executing the runtime-invoke wrappers using the interpreter. This saves some code and allows better interop with JIT exceptions. (#5057) 2017-06-19 11:12:33 -04:00
Alexander Köplinger f98b92ea6c [MacSDK] Bump msbuild 2017-06-19 15:20:03 +02:00
Alexander Köplinger dbaab5d01a [packaging] Add a few more missing files to Windows MSI
Also add a safeguard so we don't accidentally leave files with
OSX paths in the package.
2017-06-19 14:58:50 +02:00
Alexander Köplinger e5207856a0 Bump cecil and api-snapshot 2017-06-19 13:58:15 +02:00
Alexander Köplinger 1aef35403d [btls] Fix a small memleak in btls-x509-lookup.c (#5065)
Noticed this while looking at the Clang Analysis Report[1] as the
only memory leak in the report and thought why not fix it :)

[1] https://jenkins.mono-project.com/job/test-mono-mainline-staticanalysis/Clang_Analysis_Report/
2017-06-19 12:54:32 +02:00
Alexander Köplinger 68130ebec9 [packaging] Add a few missing msbuild files to Windows MSI 2017-06-19 01:39:07 +02:00
Alex Rønne Petersen 9e469d7b9e [profiler] Add an exception clause callback that receives the exception object. 2017-06-18 05:40:05 +02:00
Zoltan Varga d421ee95b0 [sdb] Fix invokes to string ctors. Fixes #57197. 2017-06-17 01:32:34 -04:00
Ludovic Henry 6fc58f529b [w32handle] Unify WaitHandle.Wait{One,Any,All} icalls (#5051) 2017-06-16 21:01:51 -04:00
Aleksey Kliger 5c06650885 [tests] Rework TypeBuilderTest SetUp/TearDown
- Create a unique temporary directory for each test in TypeBuilderTest and delete
  it on TearDown.

- Change tests to use tempDir instead of Path.GetTempPath ()

- Change IsSerializable () test to how it was 11 years ago and have it write to a
  file with a simple name (but now in a directory where noone else is writing)

- Change FieldsWithSameName (), FieldsWithSameNameAndType () and
  MethodsWithSameNameAndSig () to use the default temp assembly (now in a
  unique tempDir) instead of using the CreateTempAssembly ()

- Remove CreateTempAssembly function. It is dead code.
2017-06-16 19:58:27 -04:00
Ludovic Henry 77a8ed1b39 [threads] Rework MonoThreadInfoCallbacks.thread_{register,detach,unregister} callbacks (#5055)
* [threads] Use MonoThreadInfo.{stack_start_limit,stack_end} in more places

* [threads] Remove dead code

* [threads] Rename MonoThreadInfoCallbacks.thread_{register,detach,unregister} to MonoThreadInfoCallbacks.thread_{attach,detach,detach_with_lock} respectively
2017-06-16 19:14:13 -04:00
Zoltan Varga cf39a9cd43 [runtime] Add a mono_marshal_get_runtime_invoke_full () function with an extra need_direct_wrapper argument to allow generation of runtime-invoke wrappers which directly call a method without using the 'addr' argument. (#5053) 2017-06-16 17:45:41 -04:00
Zoltan Varga 7e220bf4ff [interp] Implement CEE_RETHROW properly by allocating a separate exception variable for each clause, and not overwriting stack traces on a rethrow. (#5040) 2017-06-16 16:01:38 -04:00
Rodrigo Kumpera d4bd4f0091 Merge pull request #5014 from vkargov/vk-kasha
[jit] Always cache the latest image set in case of a cache miss.
2017-06-16 14:42:20 -04:00
monojenkins afd9c96b3f [msvc] Update csproj files (#5052) 2017-06-16 18:32:26 +02:00
Alexander Köplinger 6c6ab73705 [packaging] Add back IronLangs to Windows MSI
It was just temporarily removed from the Mac package to work around
a build break. This was fixed so we need to add iron* back.
2017-06-16 17:55:15 +02:00
Alexander Köplinger aaceb6f0cf Bump API snapshot 2017-06-16 17:12:44 +02:00
Aleksey Kliger (λgeek) cfa6ff88d1 Merge pull request #5010 from Unity-Technologies/boehm-gc-alloc-fixed-sre
Boehm GC Fixes - SRE and Handle Stack
2017-06-16 10:38:37 -04:00
David Karlaš ff3a3a6fad Merge pull request #5049 from mono/fixSdbTests
Fixed Mono.Debugger.Soft unit tests
2017-06-16 15:04:54 +02:00
Marek Habersack 9285e189c1 Enable translation of WSEACCESS (10013) on mobile (#5050)
This error can occur on mobile devices during network operations
as evidenced in https://bugzilla.xamarin.com/show_bug.cgi?id=56653
and having an actual description of the error printed in this case
makes it easier for the user to discover what's going on.
2017-06-16 11:30:16 +02:00
David Karlaš 5a0573df99 Fixed Mono.Debugger.Soft unit tests and added new new String('a', 3); unit test after return; 2017-06-16 09:46:57 +02:00
David Karlaš c329548380 Merge pull request #5042 from mono/sdbSyncDebuggerLibs
Upstreaming changes from mono/debugger-libs to Mono.Debugger.Soft
2017-06-16 08:41:17 +02:00
David Karlaš 9549385e47 Bug 44266 - Unable to change variable values whilst debugging
https://github.com/mono/debugger-libs/commit/ac17c08938408abc7f5aaf0f862d83bbd2b56d42
2017-06-16 08:23:29 +02:00
David Karlaš 3f899a3198 caching thread state
https://github.com/mono/debugger-libs/commit/e3e665525a59823563c23babaf5d0e29a44a644a
2017-06-16 08:23:29 +02:00
David Karlaš dd15ef7b68 Updated SourceLocation with end line and end column
https://github.com/mono/debugger-libs/commit/479a84ce506e7cf25d6aac4353d59b7fc6526a17
2017-06-16 08:23:28 +02:00
David Karlaš a427893839 Fix one extra allocation on MethodMirror.FullName
https://github.com/mono/debugger-libs/commit/cfea89011ef690fe2cd9fefccf6b34ee1d4b1584
2017-06-16 08:23:28 +02:00
David Karlaš 866ad511fe Bug 36053 - Broken enum values conversion
plus moved some code to correct location
https://github.com/mono/debugger-libs/commit/d65261617baddb5b41f665b0eb717cd1f81873b6
2017-06-16 08:23:28 +02:00
David Karlaš 86f8dd621a Fixed fetching Enum values on older runtimes
https://github.com/mono/debugger-libs/commit/525c3a685d52eb6ed053ee23c358e54dc091d9cb
2017-06-16 08:23:28 +02:00
David Karlaš daa673f978 [Debugger] Set the encoding of the error/output readers.
Bug 40556 - Output pad no longer displays unicode characters
https://github.com/mono/debugger-libs/commit/c10de4dd44493156a112fdc0d315db75e0457a2d
2017-06-16 08:23:28 +02:00
Rodrigo Kumpera a21319d1ca Merge pull request #5032 from kumpera/profiler-reorder-heap-events
Fix how HEAP_START / HEAP_END works
2017-06-15 20:56:05 -04:00
Alexander Köplinger cfe36830d4 Add back missing TypeConverter that got removed in last commit
Also bump API snapshot with the latest changes.
2017-06-16 01:20:03 +02:00
Frederik Carlier 831381caa9 Use CoreFX sources for System.Printing (#5041) 2017-06-16 00:57:02 +02:00
Frederik Carlier e33294bf22 Use CoreFX sources for System.Drawing.Imaging (#5048)
* Use CoreFX sources for System.Drawing.Imaging

* Bump API snapshot
2017-06-16 00:55:18 +02:00
Aleksey Kliger 762ac3d618 In mono_thread_info_suspend_lock in non-coop, don't assert MonoThreadInfo* is non-NULL
mono_thread_info_suspend_lock () can be called from boehm-gc.c
on_gc_notification before the new thread's start_wrapper calls
mono_thread_info_attach but after pthread_create calls the start wrapper.

As a result, the asserts in mono_thread_info_suspend_lock_with_info can catch
the new thread in an inconsistent state.
2017-06-15 13:50:10 -04:00
monojenkins 259afc7850 [msvc] Update csproj files 2017-06-15 19:49:57 +02:00
Frederik Carlier c238778b63 Use Drawing2D classes from CoreFX 2017-06-15 18:51:09 +02:00
Jo Shields 4a054b40ae Ensure monodoc/Test/ exists, with an empty file
This prevents build failures building monodoc tests, as git cannot check out empty directories, but Test/ must exist for `make check` to work
2017-06-15 18:49:53 +02:00
Aleksey Kliger be684e09b4 Initialize new handle chunks on in mono_handle_stack_alloc () 2017-06-15 10:39:57 -04:00
Frederik Carlier 3830eca92c Use Brush classes from CoreFX (#5039) 2017-06-15 11:29:35 +02:00
Bernhard Urban aa59a09fd7 Revert "[win] set HAVE_ONLINE_VES" (#5038)
This reverts commit 501e77f912.

superseded by https://github.com/mono/mono/pull/5000
2017-06-15 00:45:50 -04:00
Zoltan Varga e600333511 [arm64] Fix the patching of MONO_PATCH_INFO_METHOD_JUMP so it handles thunks properly. Allocate thunk space for tail calls. Fixes asserts in the System.Numerics xunit tests. (#5026) 2017-06-14 21:54:01 -04:00
Alexander Köplinger 581b46d90d [packaging] Add missing .pc files to Windows folder
It got accidentally ignored by the root .gitignore.
2017-06-15 02:16:18 +02:00
Rodrigo Kumpera 17af65a784 [profiler] Handle zero object heap dumps in mprof-report and fix the test suite. 2017-06-14 14:54:18 -07:00
Rodrigo Kumpera 5ebdc64ef8 [profiler] Emit post-gc sync point with the world stopped to avoid racing with allocating threads not stopped on the GC lock. 2017-06-14 14:54:17 -07:00
Rodrigo Kumpera 6f740b5bc3 [sgen] Don't report GC moves with the world running and before a GC happened - it makes no sense!. 2017-06-14 14:54:15 -07:00
Rodrigo Kumpera cfe5263372 [sgen] Move STW GC events to sgen-stw.c so they are properly reported. 2017-06-14 14:54:10 -07:00
Rodrigo Kumpera c23173ee4b [profiler] Move HEAP_START and HEAP_EVENTS to happen outside of heap shots.
They now are produced every time a GC spills heap events such as roots, moves and objects.

Additionally, I changed GC syncpoints to happen in case any GC events are active.
It's a safer choice with little penalty. Figuring out the actual combinations that would require them is non-trivial.
2017-06-14 14:53:59 -07:00
Rodrigo Kumpera 7c284c8c2b [eglib] Linux needs errno.h for ERANGE 2017-06-14 11:36:59 -07:00
Alexander Köplinger acf546b1ba [packaging] Fix wrong argument in Windows script 2017-06-14 20:35:50 +02:00
Zoltan Varga 89fa700441 [jit] Add a ExceptionTraceIp structure to represents entries in MonoException.trace_ips, making it easier to add more information to it in the future. NFC. (#5025) 2017-06-14 14:28:01 -04:00
Rodrigo Kumpera 2e68bc17e3 [eglib] Handle ERANGE in g_strerror 2017-06-14 11:25:27 -07:00
Aleksey Kliger (λgeek) f97b7bd2a2 Merge pull request #5020 from lambdageek/fix-strict-loader-image-cache-hit
[loader] If using strict strong names, recheck loaded assm before returning it.
2017-06-14 14:17:10 -04:00
Alexander Köplinger 7f28de8559 [packaging] Fix prerequisite in Windows script 2017-06-14 18:29:43 +02:00
Frederik Carlier 3307394dba Use CoreFX sources for System.Drawing.Text (#5036) 2017-06-14 18:20:07 +02:00
Frederik Carlier fb4877a8d7 Use CoreFX sources for System.Drawing.Imaging (#5035)
* Use CoreFX sources for System.Drawing.Imaging

* Bump API snapshot
2017-06-14 18:17:19 +02:00
Frederik Carlier d31ccce651 Use source from CoreFX for System.Drawing.Drawing2D (#5034) 2017-06-14 18:12:32 +02:00
Alexander Köplinger 348ec2cf7a [packaging] Remove msiexec prerequisite from Windows script
We're using lessmsi now.
2017-06-14 17:31:04 +02:00
Alexander Köplinger b85f34d763 [packaging] Exit Windows packaging script on error
Also quote passed in mdk path.
2017-06-14 16:29:29 +02:00
Jonathan Chambers 466c00b8f0 Use GC memory for handle stack under Boehm so it's scanned. Cleanup handle stack on thread unregister. 2017-06-14 09:18:17 -04:00
Bernhard Urban a0bf70a140 [metadata] s/HAVE_ONLINE_VES/ENABLE_ILGEN/g 2017-06-14 15:03:21 +02:00
Bernhard Urban d720e3368c [configure] move HAVE_ONLINE_VES away from autotools to a header file 2017-06-14 15:03:21 +02:00
Alexander Köplinger 1ebd866eaa Bump corefx 2017-06-14 07:58:28 +02:00
saraedum 39d1e1889f [Mono.Security] Fix typo in CryptographicException message
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52621
2017-06-14 01:43:46 +02:00
Aleksey Kliger 5f0dd2998d [loader] If using strict strong names, recheck loaded assm before returning it.
Suppose we have two versions of an assembly: AsmA 1.0.0.0 and AsmA 2.0.0.0 that
we want to load into the same domain at the same time (for example we want to
load AsmB and AsmC that statically reference the two versions, respectively, or
maybe we used reflection).  Suppose version 1 got loaded first (and we found it
on our MONO_PATH in "somepathdir/AsmA.dll").  Now we want to load version 2.
The problem is that if version 1 is on MONO_PATH first, we'll find a filename
that matches ("somepathdir/AsmA.dll") and try to open that image.  Then we'll
end up here in mono_assembly_open_predicate() after the mono_image_open_a_lot()
call hits the image cache.  So we get back an image and image->assembly is
version 1.

The old behavior would just return any non-NULL image->assembly.  The new
behavior is to check the predicate and reject opening the propose file if the
predicate doesn't match.  (If we're not using the strict loader, or if there's
no predicate set, return the existing image->assembly as before).
2017-06-13 19:07:52 -04:00
Aleksey Kliger 87714d8a45 [tests] Strict assembly loading of two version of the same assm should work.
In particular, we should be able to use classes/methods that are unique to each
version.  We should not get only one version loaded.
2017-06-13 19:07:51 -04:00
Alexander Köplinger 258efac3c6 [MacSDK] Remove quotes in nuget wrapper script
None of the other wrapper scripts quote the Mono path and this
broke the Windows packaging script which extracts nuget from the
Mac package.
2017-06-14 00:45:58 +02:00
Bernhard Urban 1a4ce67a49 Revert "[exceptions] only do SIGSEGV related actions for SIGSEGVs in mono_handle_native_crash"
This reverts commit a27bc024f1.

We never want the crash handler to be recursive.
2017-06-13 23:43:06 +02:00
Rodrigo Kumpera e68c3b8027 [eglib] Replace strerror with strerror_r as the former is not thread safe.
This change would be nicer if the code was moved to the runtime so we could use our PAL.
2017-06-13 13:40:34 -07:00
Bernhard Urban 2640a8d862 [aot] fix compilation for targets that do not set MONO_ARCH_HAVE_FULL_AOT_TRAMPOLINES (#5017) 2017-06-13 15:56:52 -04:00
Rodrigo Kumpera aa8605d0eb Merge pull request #5011 from kumpera/quiet-mode
Don't emit profiler events we don't need to.
2017-06-13 15:53:46 -04:00
Rodrigo Kumpera 4b9d0677c9 [profiler] Don't emit sync point on restart the world unless gc moves are enabled. 2017-06-13 12:53:31 -07:00
Rodrigo Kumpera 6ccea37726 [profiler] Add + prefix to file names to append the pid. This makes enabling it with env vars doable. 2017-06-13 12:52:53 -07:00
Marius Ungureanu 56d5fce7f4 Bump bockbuild (#5023) 2017-06-13 20:52:42 +02:00
Alexander Köplinger 00f7811683 [ci] Get rid of remaining usages of WORKSPACE env var
Most of it was already removed in ea519ada8c
2017-06-13 18:07:47 +02:00
Marek Safar c5b00568ba Bump corefx 2017-06-13 16:43:10 +02:00
Alexander Köplinger 27bf99ebed [packaging] Fix path to wrapper.bat for Windows MSI 2017-06-13 16:18:21 +02:00
Vlad Brezae 2015a4ab21 Merge pull request #5002 from BrzVlad/feature-sgen-modes
[sgen] SGen modes
2017-06-13 14:14:47 +03:00
Vlad Brezae 2eb33cebf5 Merge pull request #5021 from BrzVlad/fix-parallel-fixes
[sgen] Fix parallel fixes
2017-06-13 14:07:29 +03:00
Rodrigo Kumpera ccda92d896 [profiler] Fix issue found by review. 2017-06-12 22:08:28 -07:00
Alexander Köplinger 69f8abf794 [packaging] Simplify Windows packaging scripts
We don't need to build in a separate checkout of mono anymore.
Also use .pkg passed in from upstream build.
2017-06-13 04:13:54 +02:00
Alexander Köplinger a4d6fccef9 [packaging] Move Windows MSI scripts into repository
They lived in https://github.com/mono/release before, moving them
into the main repo allows us to version them more easily.

Note: I intend to do more cleanup on those scripts in the future,
this is just the first step.
2017-06-13 04:11:39 +02:00
Vlad Brezae c98b69bc05 [man] Add entries for sgen modes and new major/minor types 2017-06-13 02:33:21 +03:00
Vlad Brezae 382a9b3679 [sgen] Add sgen modes
Group gc params configurations into general gc modes. The default mode (SGEN_MODE_NONE) is what we've been using so far, meaning old default features. The other modes can include experimental features.
2017-06-13 02:33:19 +03:00
Rodrigo Kumpera bd9b4e9b24 [profiler] Remove heapshot request polling from all over the place and depend only on the finalizer callback.
We the profiler now emiting a lot less events by default, all the existing polling no longer makes sense as they won't matter in the common path.

Instead we make sure the finalization end callback is always installed and poll from it.

This introduces the risk of a heapdump never happening or experiencing long delays because there are either too many finalizers or one of them hung.
It's an acceptable risk.
2017-06-12 16:09:56 -07:00
Marek Safar eab4b7e67b [build] Bumps mcs bootstrap requirement 2017-06-12 23:31:03 +02:00
monojenkins b9e7bcabe4 [msvc] Update csproj files (#4898) 2017-06-12 22:55:04 +02:00
Rodrigo Kumpera e6e0331cde [profiler] When using heapshot, don't collect roots when not doing a heapshot. 2017-06-12 12:45:21 -07:00
Rodrigo Kumpera 540ef7fb38 [profiler] Don't emit sync points during GC if we don't need to. 2017-06-12 11:33:11 -07:00
Rodrigo Kumpera 76e9739a43 [profiler] Don't emit thread and gc events if they are not enabled. 2017-06-12 11:33:11 -07:00
Rodrigo Kumpera e1b061052d Merge pull request #4967 from kumpera/profiler-arg-cleanup
Rework profiler argument handling.
2017-06-12 10:07:24 -07:00
Marek Safar 5f26cd5416 Bump corefx 2017-06-12 18:41:57 +02:00
Pablo Ruiz García db758b9f85 Fix OpenMappedWebConfiguration throws: System.IndexOutOfRangeException, when using RazorGenerator under mono (#5013) 2017-06-12 01:55:26 +02:00
Alexander Köplinger 1890aa6ec3 Fix System.Numerics xunit tests and add them to CI (#5006)
* Fix System.Numerics xunit tests and add them to CI

Xunit.Extensions.NetCore.dll is available as a net46 version now
so we can just use it instead of building it from our buildtools fork.
This also allows us to remove the fork from our submodules.

We were missing running the System.Numerics xunit tests in CI,
this adds them so we catch breaks like these earlier.

* Skip tests on Windows, they seem to fail there
2017-06-12 01:44:50 +02:00
Marek Safar a497e40075 [mcs] C#7 type pattern matching 2017-06-11 09:52:26 +02:00
Vladimir Kargov d8dab47fd0 [jit] Always cache the latest image set in case of a cache miss. 2017-06-09 22:52:36 -07:00
Zoltan Varga 60d58d9128 [sdb] Fix passing of nullable parameters in invokes. Fixes #57160. (#5012) 2017-06-09 23:53:39 -04:00
Vlad Brezae a5fcc9413d [sgen] Avoid using parallel minors for small nurseries
It is not effective and it can lead to regressions, due to the added synchronizations and work splitting.
2017-06-10 01:50:20 +03:00
Vlad Brezae 1d1069575d [sgen] Disable parallel mode if not enough cores 2017-06-10 01:43:04 +03:00
Vlad Brezae 57d7457da5 [sgen] Use logical cpu count for number of workers
It actually leads to better performance. The downside is the creation of more sgen workers. This is currently capped at 8.
2017-06-10 01:33:09 +03:00
Jonathan Chambers 128e454ad2 Use regular allocator rather than GC memory for SRE related types since the contained GC tracked hash tables are now themselves roots since 863ddf25bf.
Fixes crash due to MonoDynamicAssembly or MonoDynamicImage being collected under Boehm as they were unreferenced GC memory.
2017-06-09 18:21:22 -04:00
Rodrigo Kumpera 61f32e7f14 Remove the mono-profiler- prefix from all source files in the profiler subdir.
Additionally, rename arg-parsing.c to log-args.c so it's clear it's part of the log profiler.
2017-06-09 13:58:15 -07:00
Rodrigo Kumpera 74695b9d03 [profiler]Use g_warning and remove bad usage() line 2017-06-09 13:04:22 -07:00
Rodrigo Kumpera f8a969aae9 Merge pull request #4998 from kumpera/fix_56684
[corlib] Don't pass RuntimeMethodHandle across domains. Fixes #56684
2017-06-09 14:44:43 -04:00
Aleksey Kliger (λgeek) 417389513f Merge pull request #4997 from lambdageek/bug-57222
[sre] FieldBuilder:RuntimeResolve shouldn't lookup by name (Fixes #57222)
2017-06-09 13:40:28 -04:00
Marek Safar e871e6f844 Bump corefx 2017-06-09 18:48:01 +02:00
Bernhard Urban a3e6b2cd8b [marshal] allocate dummy string always in root domain
otherwise it can happen that the dummy string is allocated in a
different domain, and when it's onloaded the GC root points to an
invalid object.
2017-06-09 12:49:59 +02:00
Rodrigo Kumpera 310192e3cb Bunch of minor fixes. 2017-06-08 15:48:06 -07:00
Rodrigo Kumpera 468339deb6 Remove env var. 2017-06-08 15:46:07 -07:00
Rodrigo Kumpera 826558a4af update usage, print warning on output:-FILENAME and add a TODO. 2017-06-08 15:46:07 -07:00
Rodrigo Kumpera 334d05b1e7 Remove spurious header. Change from enum to bucket of defines. 2017-06-08 15:46:06 -07:00
Aleksey Kliger dd0eab4247 [test] Test SRE of a class with two methods with the same name.
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=57222

Although methods aren't affected by this bug, I added a regression test for
this case anyway in case the implementation changes.

Currently MethodBuilder.RuntimeResolve() goes through a different codepath - it
calls RuntimeType.GetMethod (MethodInfo) which calls into an icall which looks
for a method with a matching token rather than a matching name.
2017-06-08 17:47:42 -04:00
Rodrigo Kumpera 8a1db7bb93 [corlib] Don't pass RuntimeMethodHandle across domains. Fixes #56684
We can't pass RuntimeMethodHandle across AppDomains since that can lead to memory corruption.

The way this happens is that when Domain (A) passes a method handle (M) to Domain (B), (B) will get the reflection object for
which will add that MonoMethod to the per-domain reflection hashtable. This won't cause the assembly of (M) to be registered with (B).

When (A) is unloaded, it might be the only domain referencing the assembly of (M), cause it to unload resulting in (B) having a dangling
pointer to (M) on its reflection hashtable.

The fix is to serialize enough lookup data across the wire so we can do type/method lookup using reflection on the target domain.
It might be slower, but this only happens on some remoting slowpaths anyways.

Finally, we can't simply register the assembly of (M) into domain (B) as that list (MonoDomain::domain_assemblies) is used for type loading,
thus breaking the target domain in some scenarios.
2017-06-08 14:10:38 -07:00
Aleksey Kliger 64d523c524 [sre] FieldBuilder:RuntimeResolve shouldn't lookup by name. (Fixes #57222)
RuntimeType:GetField (FieldInfo) looks up the field by name and attributes,
which doesn't work for SRE because it is legal to create multiple fields with
the same name and type and attributes.  So lookup using the
RuntimeFieldHandle (aka MonoClassField*) instead.
2017-06-08 16:13:57 -04:00
Aleksey Kliger 6b1529a15c [test] Test SRE of a class with two fields with same name
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=57222
2017-06-08 16:13:56 -04:00
Aleksey Kliger (λgeek) 8a10c623f3 Merge pull request #4995 from lambdageek/dev-monodis-show-field-tokens
[monodis] Document --show-tokens and show field tokens
2017-06-08 15:54:04 -04:00
Zoltan Varga fc53acc968 [amd64] Fix a check in mono_emit_stack_alloc (). (#4985) 2017-06-08 15:47:27 -04:00
Aleksey Kliger edffe785ba [monodis] Show field tokens in --show-tokens mode 2017-06-08 12:36:32 -04:00
Aleksey Kliger 850f2df48b [monodis] Print table name (when valid) in --show-tokens mode 2017-06-08 12:36:30 -04:00
Aleksey Kliger 5e3ffa5a51 [monodis] Document --show-tokens 2017-06-08 12:36:24 -04:00
Niklas Therning 230a43461c Merge pull request #4994 from lewurm/interp-aot-mode-fix-windows
[win] set HAVE_ONLINE_VES
2017-06-08 14:48:10 +02:00
Bernhard Urban 501e77f912 [win] set HAVE_ONLINE_VES 2017-06-08 11:50:19 +02:00
Bernhard Urban fe06971e14 [interp] disable bug-45841-fpstack-exceptions.exe on CI 2017-06-08 10:23:00 +02:00
Bernhard Urban e686d39489 [interp] provide stub for icall_trampoline for x86 and ppc
keep the linker happy
2017-06-07 23:54:55 +02:00
Bernhard Urban b1000f0b2e [interp] root domain must be used for AOT'd wrappers used by interpreter 2017-06-07 23:27:44 +02:00
Bernhard Urban 1f0ad125dd [interp aot] documentation 2017-06-07 23:27:44 +02:00
Bernhard Urban d87817c174 [marshal] some things are required in the interpreter despite DISABLE_JIT 2017-06-07 23:27:44 +02:00
Bernhard Urban 51125153e5 [configure] introduce HAVE_ONLINE_VES 2017-06-07 23:27:44 +02:00
Bernhard Urban d4f922abce [interp] fix when DISABLE_JIT is set 2017-06-07 23:27:44 +02:00
Bernhard Urban 7ca4c72cc8 [interp] add InterpMethodArguments struct to offset-tool 2017-06-07 23:27:44 +02:00
Bernhard Urban 2e78636ac7 [interp] add MONO_AOT_MODE_INTERP 2017-06-07 23:27:44 +02:00
Bernhard Urban 0ddf58fe64 [interp] add --aot=interp, so we can run mono --full-aot --interpreter 2017-06-07 23:27:44 +02:00
vkargov 6baf669349 [tests] Re-enable bug-45841-fpstack-exceptions.exe (#4927)
* [tests] Re-enable bug-45841-fpstack-exceptions.exe

* [tests] Pass correct parameters in bug-45841.
2017-06-07 17:02:21 -04:00
Marek Safar 522d027663 [mcs] Better detection of null operator inside conditional expression. Fixes #57232 2017-06-07 18:01:00 +02:00
Martin Baulig dc58d950f2 Cosmetic; remove [Category ("Martin")] from the test. 2017-06-07 11:54:25 -04:00
Martin Baulig 83f74c4123 [System]: Fix possible initialization issue in MonoTlsProviderFactory. (#4987)
* [Mono.Security]: Add test for MonoTlsProviderFactory.GetProvider ().

* [System]: Fix possible initialization issue in MonoTlsProviderFactory.
2017-06-07 11:46:21 -04:00
Martin Baulig fff41905e9 [System]: Actually disable the keychain code and SecItemImport() on XI. (#4983) 2017-06-07 11:27:05 -04:00
Marek Safar 44a2d35676 [mcs] C#7 out variable declaration 2017-06-07 14:14:18 +02:00
Alexander Köplinger 1d6a8ed6ea [MacSDK] Bump libgdiplus to latest (#4984)
We were using a very old commit of libgdiplus. This brings in
the latest changes.
2017-06-07 14:08:27 +02:00
Bernhard Urban 4ede66b950 [interp] factor out everything that allocates a MonoLMFExt on the stack in order to reduce stack pressure in the main interpreter loop 2017-06-07 12:22:05 +02:00
Bernhard Urban 2b84f5bc33 [interp] factor out MINT_JIT_CALL instruction from interpreter switch in order to reduce stack pressure 2017-06-07 12:22:05 +02:00
Vlad Brezae 42311595ae [sgen] Make sure workers process jobs only if they are running (#4974)
This simplifies logic and prevents serial context being used by multiple workers at the same time.
2017-06-07 12:58:54 +03:00
Frederik Carlier 0526617e0a System.Drawing: Start consuming sources from corefx
Closes https://github.com/mono/mono/pull/4980
2017-06-06 23:46:01 +02:00
Alexander Köplinger 9b63661c15 [MacSDK] Update version number in msbuild.py 2017-06-06 23:01:50 +02:00
Bernhard Urban a46742dcb6 [mini] set MONO_ARCH_HAVE_INIT_LMF_EXT on architectures that implement mono_arch_init_lmf_ext
it worked before, because we relied on implicit linking
2017-06-06 20:00:58 +02:00
Bernhard Urban a4f960311e [mini] guard mono_arch_init_lmf_ext prototype properly 2017-06-06 19:15:44 +02:00
Bernhard Urban c64f332016 [arm] don't set MONO_ARCH_SOFT_DEBUG_SUPPORTED on android cross compiling
follow up fix for https://github.com/mono/mono/pull/4956

this breaks the cross compiler on windows for android:

```
  [9:07:36]                       /bin/sh ../../libtool  --tag=CC   --mode=compile /Users/builder/android-toolchain/mxe/bin/i686-w64-mingw32.static-gcc -DHAVE_CONFIG_H -I. -I/U  sers/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini -I../..   -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -  DWIN32_THREADS -DFD_SETSIZE=1024 -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno  -cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -Wno-format-zero-length -D__ARM_EABI__ -DARM_FPU_VFP=1 -DNO_UNALIGNED_ACCESS -I/User  s/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono -I/Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/eglib/src -I../../eglib  /src -I/Users/builder/data/lanes/5000/ff452183/source/xamarin-android/build-tools/mono-runtimes/obj/Release//llvm/installed-win32/usr/include -DNDEBUG -D__NO_CTYPE_INLINE -D_  GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DLLVM_API_VERSION=4 -O -I../arch/arm -fvisibility=hidden -DXAMARIN_PRODUCT_VERSION=0 -static   -static-libgcc -std=gnu99 -fno-strict-aliasing -fwrapv -DMONO_DLL_EXPORT -Wno-unused-but-set-variable -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-  prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -Wno-format-ze  ro-length -mno-tls-direct-seg-refs -Werror-implicit-function-declaration -MT libmini_la-mini-arm-gsharedvt.lo -MD -MP -MF .deps/libmini_la-mini-arm-gsharedvt.Tpo -c -o libmin  i_la-mini-arm-gsharedvt.lo `test -f 'mini-arm-gsharedvt.c' || echo '/Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/'`mini-arm-gsharedv  t.c
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c: In function 'mono_arch_is_single_step_event  ':
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7242:2: error: unknown type name 'siginfo_t'
  [9:07:36]                         siginfo_t *sinfo = info;
  [9:07:36]                         ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7248:11: error: request for member 'si_addr'   in something not a structure or union
  [9:07:36]                         if (sinfo->si_addr >= ss_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)ss_trigger_page + 128)
  [9:07:36]                                  ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7248:57: error: request for member 'si_addr'   in something not a structure or union
  [9:07:36]                         if (sinfo->si_addr >= ss_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)ss_trigger_page + 128)
  [9:07:36]                                                                                ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c: In function 'mono_arch_is_breakpoint_event'  :
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7262:2: error: unknown type name 'siginfo_t'
  [9:07:36]                         siginfo_t *sinfo = info;
  [9:07:36]                         ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7267:11: error: request for member 'si_signo  ' in something not a structure or union
  [9:07:36]                         if (sinfo->si_signo == DBG_SIGNAL) {
  [9:07:36]                                  ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7269:12: error: request for member 'si_addr'   in something not a structure or union
  [9:07:36]                          if (sinfo->si_addr >= bp_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)bp_trigger_page + 128)
  [9:07:36]                                   ^
  [9:07:36]                       /Users/builder/data/lanes/5000/ff452183/source/xamarin-android/external/mono/mono/mini/mini-arm.c:7269:58: error: request for member 'si_addr'   in something not a structure or union
  [9:07:36]                          if (sinfo->si_addr >= bp_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)bp_trigger_page + 128)
```
2017-06-06 19:15:44 +02:00
Alexander Köplinger 6320fcb16b Bump API snapshot 2017-06-06 18:36:50 +02:00
Martin Baulig 21d5c9c346 [System]: Correctly implement close and shutdown in SslStream. (#4969)
* [System]: Correctly implement close and shutdown in SslStream.

* Cleanup.

* Cosmetic.

* More ReferenceSources/SR2.cs into common.sources to make it build.
2017-06-06 11:46:29 -04:00
Marek Habersack d0b0e2b880 Use correct path separator for satellite assemblies in cross builds (#4976)
When creating a bundle on Windows to run on Android, macOS/iOS or Linux we need
to use the target system's path separator when storing satellite assemblies in
the bundle instead of the host system's one. Failing to do so will embed (on
Windows) the satellite assemblies with paths like

   fr_FR\myassembly.resources.dll

while at runtime Mono will try to look up the assembly by

   fr_FR/myassembly.resources.dll

and fail to find it, obviously. The `--style` parameter is now consulted to see
what path separator character should be used.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55603
2017-06-06 16:06:00 +02:00
Marek Safar ff0a6e77ff Bump corefx 2017-06-06 16:02:31 +02:00
Alexander Köplinger e2340cd101 [man] Remove mention of MONO_AOT_CACHE from mono.1
The env var was removed a long time ago in b8766a812d
and was replaced by options to --aot. This came up in Gitter today.
2017-06-06 15:43:02 +02:00
ralovich bfa744e645 implement Image.SetPropertyItem() method v4 (#1167)
This is thought to be fixing https://bugzilla.novell.com/show_bug.cgi?id=406307.

v4: state that my changes are licensed under MIT X11 license
2017-06-05 19:43:41 -04:00
Ludovic Henry 9c412c0b91 [w32handle] Fix deadlock on SignalAndWait (#4973)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=57069
2017-06-05 18:07:40 -04:00
Aleksey Kliger (λgeek) 11ec98cacd Merge pull request #4962 from lambdageek/dev-handles-sockets
[w32socket] Use coop handles for many Socket icalls
2017-06-05 17:50:30 -04:00
Aleksey Kliger 23058b943f [w32socket] Use coop handles for System.Net.Sockets.Socket.cancel_blocking_socket_operation 2017-06-05 15:01:47 -04:00
Aleksey Kliger 65b981632c [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.
2017-06-05 15:01:47 -04:00
Aleksey Kliger 6544bcfda8 [runtime] typedef MonoThread MonoThreadObject
MonoThreadHandle is already taken.  So define MonoThreadObject as an alias for
MonoThread and then make MonoThreadObjectHandle the coop handle type.
2017-06-05 15:01:47 -04:00
Aleksey Kliger 2251178eac [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.
2017-06-05 15:01:47 -04:00
Aleksey Kliger 7daf4b739e [coop handles] Define MonoSafeHandleHandle
Used to access System.Net.Sockets.SafeSocketHandle from native code
2017-06-05 15:01:46 -04:00
Aleksey Kliger bd9fa57b81 [coop handles] Macros to access a handle via a MonoClassField 2017-06-05 15:01:46 -04:00
Aleksey Kliger 68bff52cae [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.
2017-06-05 15:01:46 -04:00
Marek Safar 8873c44400 [mcs] Remove unwanted tests 2017-06-05 20:56:09 +02:00
Ludovic Henry b603482343 Bump to 5.5 for master branch 2017-06-05 11:29:28 -04:00
Alexander Köplinger d30c17f44e Revert "[marshal] delay dummy string allocation"
Reverts 5e23a773b4

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.
  =================================================================
```
2017-06-05 16:35:29 +02:00
Marek Safar 2ca4575eeb [mcs] Throw expression cannot be placed after any colon. 2017-06-05 15:27:28 +02:00
Marek Safar 51b93b6c23 [mcs] C#7 throw expression 2017-06-05 12:23:06 +02:00
Alexander Köplinger ed9fb93c62 Bump bockbuild to bring in 64bit fix 2017-06-04 19:27:26 +02:00
Rodrigo Kumpera 5ea6b70ca1 [profiler] Another atempt at fixing linux. 2017-06-04 10:01:52 -07:00
Zoltan Varga 7d1644d234 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 010fce60af.
2017-06-02 13:52:50 -04:00
Zoltan Varga 010fce60af [sdb] Add an API to make the contents of the 'State Machine Hoisted Local Scopes' table in ppdb files available in sdb. (#4961) 2017-06-02 13:43:56 -04:00
Alexander Köplinger c3667fa861 Update API snapshot 2017-06-02 19:12:31 +02:00
Rodrigo Kumpera 8716b46c87 [profiler] Fix linux. 2017-06-02 09:24:39 -07:00
Zoltan Varga cfdbdfc9eb [jit] Avoid running class cctors for remoting wrappers in the source domain. Fixes #56821. (#4950) 2017-06-02 11:54:54 -04:00
Bernhard Urban 077582d3f9 [interp] respect remoting proxies when resolving virtual methods 2017-06-02 17:18:45 +02:00
Bernhard Urban db51810499 [interp] reference domain that owns method in RuntimeMethod and couple other domain related fixes 2017-06-02 17:18:45 +02:00
Bernhard Urban 5e23a773b4 [marshal] delay dummy string allocation 2017-06-02 17:18:45 +02:00
Alexander Köplinger 1ca679877e Update API snapshot 2017-06-02 13:34:28 +02:00
Alexander Köplinger 9cb34c2a76 [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
2017-06-02 13:07:12 +02:00
Marek Safar 03c7f4f63b [corlib] Updates api 2017-06-02 11:53:54 +02:00
Bernhard Urban 869a2b0121 [arm] remove cross compiling guard for MONO_ARCH_SOFT_DEBUG_SUPPORTED 2017-06-02 10:22:04 +02:00
Bernhard Urban 0e409c5558 [interp] guard remoting functions properly 2017-06-02 10:21:12 +02:00
Zoltan Varga 010fcfb9ec [runtime] Remove all NACL support. It was unmaintained for a long time. (#4955)
https://blog.chromium.org/2017/05/goodbye-pnacl-hello-webassembly.html
2017-06-02 03:51:44 -04:00
Marius Ungureanu 045232ef52 [Posix] Optimize string marshal code by using unsafe code (#4964) 2017-06-02 09:03:47 +02:00
Alexander Köplinger a560146b7c [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.
2017-06-02 03:42:01 +02:00
Rodrigo Kumpera b64dd253b6 [profile] Update test suite. 2017-06-01 18:41:27 -07:00
Rodrigo Kumpera 75343422a5 [profiler] Move argument parsing to arg-parsing.c and significantly rework argument parsing.
This removes all [no]foo weirdness and flag dancing in favor a simpler model.

Users can enable/disable both events and profiling modes. We expose pretty much all individual events.

A profiling feature is a group of flags that enable a specific profiling scenario.
	Right now we have code coverage, perf sampling, gc alloc and heap dump as features.

All events can be prefixed with 'no' and cause them to be disabled. We'll later introduce some sanity
checking around misconfiguration.

Finally, this changes the default set of enabled events to threads and gc. Everything else must be added on top.
Experience has shown that the vast majority of those events are just noise when profiling and the current configuration
design made it quite awkward to introduce quieter modes.
2017-06-01 18:41:13 -07:00
Zoltan Varga 02db562b69 [aot] Revert a change from d135465fba which broke the aot compiler on windows. 2017-06-01 16:06:30 -04:00
Zoltan Varga 1b35e551d5 [ikdasm] Bump external/ikdasm to master. 2017-06-01 11:38:07 -04:00
Marek Safar 65b5d9b115 [mcs] Constant folding of enum constant and literal was using wrong operands. Fixes #53202 2017-06-01 16:31:57 +02:00
Marek Safar 76f0a58429 [mcs] Moves using static lookup at the end of simple name lookup rules. Fixes #55348 2017-06-01 15:27:30 +02:00
Alexander Köplinger 572e868f97 Bump api-snapshot
I accidentally pushed the wrong branch yesterday.
2017-06-01 11:21:31 +02:00
Marek Safar 313d06b169 Updates api-snapshot 2017-06-01 09:12:42 +02:00
Marek Safar 74524d8b92 Bump corert 2017-06-01 09:06:46 +02:00
Ludovic Henry 5b88ecbe0b [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.
2017-05-31 18:22:27 -04:00
Aleksey Kliger (λgeek) a17afc056b Merge pull request #4935 from lambdageek/dev-handles-may
[coop handles] w32event, w32handle and DNS icalls
2017-05-31 14:34:20 -04:00
Zoltan Varga d5eb1e5aed [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) 2017-05-31 13:21:10 -04:00
Marek Safar 74c86ff4cc [System] Adds watch specific HttpListenerWebSocketContext 2017-05-31 19:16:38 +02:00
Marius Ungureanu 4ad2d48197 Bump bockbuild to include gtk# bump (#4959) 2017-05-31 16:49:10 +02:00
Alexander Köplinger cbf2e5be18 Bump api-snapshot 2017-05-31 12:45:43 +02:00
Bernhard Urban 135e4ddf27 [unaligned] relax test regarding floating point precision 2017-05-31 11:17:29 +02:00
Bernhard Urban 6d298d47f9 [interp] use memmove for some primitve types, because it takes care of unaligned addresses
relevant on architectures which do not support unaligned load/stores.
2017-05-31 11:17:29 +02:00
Marek Safar a75c5db541 Bump corefx 2017-05-31 09:07:32 +02:00
Marek Safar 34a4ffcc45 [build] Fixes profile path for aot compilation 2017-05-31 08:45:16 +02:00
Marek Safar 798a08c1f1 Bump cecil 2017-05-31 08:20:23 +02:00
Alexander Köplinger cbd180afe6 [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.
2017-05-31 03:52:08 +02:00
Alexander Köplinger c4aa50d2e1 [MacSDK] Bump xamarin-gtk-theme.py to latest revision from private bockbuild 2017-05-31 03:50:09 +02:00
Alexander Köplinger 84fe1a5774 [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.
2017-05-31 03:33:45 +02:00
Alexander Köplinger 819026f391 Bump bockbuild to include gtk+ patch 2017-05-31 03:33:44 +02:00
Cody Russell 45e66c5362 [System] Add useDefaultCredentialsProp to the list of properties. (#4949) 2017-05-31 01:39:26 +02:00
Vlad Brezae cef99c3837 [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).
2017-05-31 01:28:50 +03:00
Rodrigo Kumpera f7e0f70b7d Merge pull request #4938 from kumpera/optimize_ref_queries
Add concurrent read version of MonoGHashTable and use it with MonoDomain::refobject
2017-05-30 15:20:44 -07:00
Rodrigo Kumpera feb90c6d43 [win32] Add new files. 2017-05-30 13:03:35 -07:00
Aleksey Kliger b1b5ab0524 [w32socket] Remove dead code 2017-05-30 15:15:06 -04:00
Aleksey Kliger fd201644a0 [w32socket] Use coop handles for System.Net.Dns.GetHostByAddr_internal 2017-05-30 15:14:18 -04:00
Aleksey Kliger 97e9bbae7e [w32socket] Use coop handles for System.Net.Dns.GetHostByName_internal 2017-05-30 14:57:09 -04:00
Marek Safar d466cb5fa5 [mcs] Don't emit param-array attribute on method overrides, it's ignored by C# compiler. Fixes #53244 2017-05-30 19:36:13 +02:00
Alexis Christoforides 828d2adff9 Bump bockbuild 2017-05-30 13:29:33 -04:00
Alexander Köplinger 37fe83f6ea [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
2017-05-30 18:34:53 +02:00
Marek Safar e06781fb7a [mcs] Reset catch state variable after it has been checked. Fixes #54322 2017-05-30 11:39:46 +02:00
Marek Safar 1782b291f8 [mcs] New property/indexer cannot have accessors implementing an interface in base type. Fixes #56627 2017-05-29 23:57:00 +02:00
Jochen Kühner 7b51e84dc5 Bugfix Ping.cs (#4936) 2017-05-29 23:05:34 +02:00
Bernhard Urban 0f00eb3e59 [interp] implement RELOC_LONG_BRANCH. fixes test/imt_big_iface_test.exe 2017-05-29 22:21:04 +02:00
Rodrigo Kumpera 2769d84822 [runtime] Handle mono_method_body_get_object returning NULL on success. 2017-05-29 10:36:54 -07:00
Alexander Köplinger 966d8f2a57 [Facades] Update to match latest contracts (#4939)
* [Facades] Update to match latest contracts

* Update API snapshot
2017-05-29 19:31:44 +02:00
Bernhard Urban b3901be2f6 [CI] ignore appdomain-unload-asmload.exe on interp and full-aot 2017-05-29 17:50:02 +02:00
Bernhard Urban ee90fc601e [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.
2017-05-29 15:48:29 +02:00
Alexander Köplinger 621faafcaf Bump bockbuild 2017-05-29 12:33:02 +02:00
Rodrigo Kumpera 4e72eaacaa [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.
2017-05-28 20:16:29 -07:00
Rodrigo Kumpera 3a0d3e1169 [runtime] Add concurrent read variant of MonoGHashTable name MonoConcGHashTable.
Use the same design as MonoConcHashTable.

Aaaaand confusing name will confuse.
2017-05-28 17:42:54 -07:00
Marek Safar da76a7b803 [mcs] Improves imported destructor detection. Fixes #54159 2017-05-28 13:48:42 +02:00
Alexander Köplinger a7c31c9805 Bump bockbuild 2017-05-28 02:02:31 +02:00
Alexander Köplinger 73f3ee63cc Bump bockbuild to fix wrench build 2017-05-28 01:18:02 +02:00
Rodrigo Kumpera 5c7f10154f Merge pull request #4904 from kumpera/more_opts
[runtime] Change jit_info_table_num_elements to O(1).
2017-05-27 12:29:01 -07:00
Rodrigo Kumpera 992525a6df Merge pull request #4928 from kumpera/ptr_to_struct_intrinsic
[mini] Intrinsify Marshal.PtrToStructure<T>
2017-05-27 12:27:37 -07:00
Zoltan Varga 76e2c3227f 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.
2017-05-27 12:29:56 -04:00
Zoltan Varga 5b4ccf033f [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) 2017-05-27 09:33:59 -04:00
Rodrigo Kumpera 071c3f5697 [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.
2017-05-27 01:29:03 -07:00
Bill Holmes 9a08e45324 [Mono.Posix] Adding .Net Core 2.0 support. (#4774) 2017-05-27 08:24:10 +02:00
Aleksey Kliger 574f482506 [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
2017-05-26 18:43:24 -04:00
Alexis Christoforides 500eec69c7 Re-bump bockbuild for libtiff URL change 2017-05-26 16:11:08 -04:00
Aleksey Kliger 5d50b36c5f [System] Use coop handles for System.Net.Dns.GetHostName_internal 2017-05-26 16:03:25 -04:00
Alexis Christoforides 89ceb247c4 Revert "Bump bockbuild", as it breaks the build.
This reverts commit 30f9a22f08.
2017-05-26 15:39:22 -04:00
Rodrigo Kumpera 2d57bab36b Merge pull request #4931 from kumpera/com-interop-fix
Fix cominterop bug
2017-05-26 12:28:40 -07:00
Rodrigo Kumpera ed0b9b227b [mini]Add test for PtrToStruct<T> 2017-05-26 12:26:44 -07:00
Rodrigo Kumpera 0cac21043d Merge pull request #4840 from kumpera/unaligned-access
Another round of cleanups plus fix how the JIT emit unaligned access.
2017-05-26 12:17:02 -07:00
Aleksey Kliger 44b7efbee0 [runtime] Use coop handles for ves_icall_System_Threading_Mutex_OpenMutex_internal
- add mono_w32mutex_open for w32mutex-unix.c
2017-05-26 14:44:59 -04:00
Aleksey Kliger 0a0da6cbe1 [runtime] Use coop handles for ves_icall_System_Threading_Mutex_CreateMutex_internal 2017-05-26 14:26:21 -04:00
Aleksey Kliger 310b69ce3d [runtime] Use coop handles for ves_icall_System_Threading_Events_OpenEvent_internal 2017-05-26 14:26:19 -04:00
Aleksey Kliger 0a3a12b9aa [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
2017-05-26 14:26:18 -04:00
Alexis Christoforides 30f9a22f08 Bump bockbuild 2017-05-26 13:41:35 -04:00
Marek Safar 84bac28050 [mcs] Codegen for optimized new with valuetype load and awaited arguments. Fixes #56081 2017-05-26 18:24:35 +02:00
Aleksey Kliger 93e74ce434 [coop handles] Add mono_string_handle_pin_chars 2017-05-26 10:29:20 -04:00
Aleksey Kliger f48e4357c9 [w32handle] Const-ify arg of mono_w32handle_namespace_search_handle 2017-05-26 10:29:18 -04:00
Aleksey Kliger a377fa737c [remoting] Use coop handles for ves_icall_System_Runtime_Activation_ActivationServices_EnableProxyActivation 2017-05-26 10:29:14 -04:00
Aleksey Kliger aa7df40d0c [remoting] Use coop handles for ves_icall_IsTransparentProxy 2017-05-26 10:28:06 -04:00
Bernhard Urban 5467391bbc [arm] use r8 instead of r5 in icall trampoline, because r5 is used as IMT reg 2017-05-26 16:19:38 +02:00
Bernhard Urban 94db1a63f0 [arm] respect iOS specific ABI for frame pointer in icall trampoline 2017-05-26 16:19:38 +02:00
Rodrigo Kumpera 414e98156a [mini] Intrinsify Marshal.PtrToStructure<T> 2017-05-25 22:43:55 -07:00
Rodrigo Kumpera 565d626c05 [runtime] Add support for using COM types from corlib.
This can be reproduced by trying to load a type that implements a COM interface corlib ships.
2017-05-25 17:11:27 -07:00
Rodrigo Kumpera 31ec985a6f [mini] Fix the llvmonlycheck test. 2017-05-25 16:13:27 -07:00
Zoltan Varga 4f1514cc22 [aot] Avoid printing out AOT NOT FOUND messages for icall methods which have no body. 2017-05-25 18:00:01 -04:00
Damien Diederen a661eb8c9d [arm] Do not use the ARM Run-time ABI in cross-compilers (#4914) 2017-05-25 13:16:38 -04:00
Aleksey Kliger b9b72e5947 [remoting] refactor ves_icall_InternalExecute
Pull the FieldGetter and FieldSetter logic into separate functions
2017-05-25 12:05:34 -04:00
Aleksey Kliger b4b33c06e6 [runtime] Use coop handles for System.Runtime.Remoting.RemotingServices.GetVirtualMethod 2017-05-25 11:31:29 -04:00
Vlad Brezae 49a83d0b72 Merge pull request #4926 from BrzVlad/fix-tls-v5
[arm] Don't use fast tls on v5 arm
2017-05-25 14:53:39 +03:00
e-kovalenko c271644e20 Fix mono build with disabled sgen (#4915)
Build of the Mono failed with the Boehm GC only (without SGEN)
if it configured like this: --with-gc=included --withsgen=no
2017-05-25 01:11:40 +02:00
Marcin Cieślak c96819eb25 sysctl takes 3 name components (#4883)
Adapted from:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212259

https://github.com/mono/mono/pull/3480

https://svnweb.freebsd.org/ports?view=revision&revision=423356
2017-05-25 01:09:05 +02:00
Marcin Cieślak 3b9f8e8d77 Move <sys/types.h> higher for integer types (#4884)
Fix build on FreeBSD 8 and maybe others
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198404#c6
2017-05-25 01:06:53 +02:00
Vlad Brezae ef239e765e [arm] Don't use fast tls on v5 arm
The thread coprocessor registers appear only in v7 specification.
2017-05-25 01:14:00 +03:00
Aleksey Kliger (λgeek) 2d403b3a44 Merge pull request #4923 from lambdageek/bug-56694
[appdomain] Don't leak MonoReflectionAssemblyHandles firing events

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=56694
2017-05-24 17:35:22 -04:00
Rodrigo Kumpera 3b3017dbe4 Merge pull request #4872 from kumpera/add_test_for_eloop
[runtime] Fix runtime behavior when dealing with missing symlinks
2017-05-24 16:25:41 -04:00
Aleksey Kliger (λgeek) 2dabc3e221 Merge pull request #4845 from lambdageek/dev-coop-delegates
[marshal] Use coop handles for delegates icalls
2017-05-24 15:56:38 -04:00
Marcin Cieślak 940944dcde Bug #56499: unreadable /etc/localtime should not cause an exception (#4881)
* Bug #56499: unreadable /etc/localtime should not cause an exception

* Fix build
2017-05-24 20:53:23 +02:00
Aleksey Kliger 182f7c33c1 [sgen] Scan the handle stack for dangling ptrs during domain unload
There should be no handles pointing to objects in the domain that is unloading
in any thread's handle stack once mono_gc_clear_domain () is called.
2017-05-24 14:10:42 -04:00
Aleksey Kliger e3ede19ce7 [coop handles] Fix wrong #ifdef 2017-05-24 14:10:41 -04:00
Aleksey Kliger e6fc657342 [appdomain] Don't leak MonoReflectionAssemblyHandles in callbacks to managed 2017-05-24 14:09:51 -04:00
Aleksey Kliger a957ab18a3 [tests] Regression test for #56694
When an AssemblyLoad event fires in a domain, a System.Reflection.Assembly
object is created in that domain for the assembly being loaded.  The bug left
this object alive after the domain was unloaded, which lead to a GC crash.
2017-05-24 14:09:50 -04:00
Zoltan Varga bde8ce85e0 [runtime] Implement interior handles as a special case to simplify and speed up the more common handle code. (#4921) 2017-05-24 13:58:18 -04:00
Marek Safar 76849c1cfb [corlib] Fixes warning 2017-05-24 19:28:44 +02:00
Marek Safar 1d115c6cd1 [mcs] Parsing of nested unbound types. Fixes #55400 2017-05-24 19:28:44 +02:00
Marek Safar d1add5e846 [corlib] Remove unused field 2017-05-24 19:28:44 +02:00
Miguel de Icaza b11e90f2f7 Improve error messages to help users diagnose problems when using custom mode (#4922)
* Improve error messages to help users diagnose problems when using the custom mode

* Update mkbundle.cs
2017-05-24 13:19:58 -04:00
Zoltan Varga fe1c006f59 [runtime] Convert a g_warning to a type load failure. (#4920) 2017-05-24 09:35:18 -04:00
Zoltan Varga 64cb61349f Fix make dist. 2017-05-23 22:51:09 -04:00
Rodrigo Kumpera 091181ba1d Fix the CpBlk and InitBlk intrinsics. 2017-05-23 16:59:07 -07:00
Rodrigo Kumpera 19631350a2 Update test for correct behavior. 2017-05-23 14:59:02 -07:00
Rodrigo Kumpera c2a7bb4598 [runtime] Fix multiple issues around symlink handling.
After fixing my windows setup, I managed to properly test MS's behavior, which is a lot saner and it's the following:

Opening fails with ERROR_CANT_RESOLVE_FILENAME (1921).
Testing and Deleting works.

Fixing File.Delete required removing the lstat we do before deleting, which no longer serves any purpose.

Fixing File.Exists requires handling ELOOP when stat fails and we retry with lstat.
2017-05-23 14:46:53 -07:00
Martin Baulig d62228e521 [System]: Don't call OnCompleted(this) twice in SocketAsyncEventArgs.FinishWrapperConnectSuccess(). (#4894) 2017-05-23 15:42:05 -04:00
Alexander Köplinger 7075c21582 [bcl] Fix compiling xunit-based tests
We moved System.Runtime.InteropServices.RuntimeInformation to a facade.
2017-05-23 19:54:35 +02:00
Zoltan Varga 581e33fcb6 [runtime] Add specialized versions of mono_icall_handle_new () for internal/non-internal pointers. (#4918) 2017-05-23 11:46:59 -04:00
Zoltan Varga f787cfb2ba Fix full aot (#4919)
* [runtime] Fix the generation of invalid IL in the return marshalling of stringbuilders.

* [runtime] Disable some failing fullaot tests.
2017-05-23 11:36:43 -04:00
Aleksey Kliger 0ec79ec49e [runtime] Use coop handles for System.Delegate.AllocDelegateLike_internal 2017-05-23 11:30:48 -04:00
Aleksey Kliger 52acc12919 [marshal] Use coop handles for System.Delegate.GetVirtualMethod_internal 2017-05-23 11:30:48 -04:00
Aleksey Kliger 631d4e0052 [marshal] Use coop handles in mono_delegate_to_ftnptr
* Create mono_delegate_handle_to_ftnptr for the implementation
* Use coop handles for
  System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegateInternal
2017-05-23 11:30:48 -04:00
Aleksey Kliger e1354fd956 [runtime] Remove temporary fcn mono_delegate_ctor_with_method_fixme 2017-05-23 11:30:48 -04:00
Aleksey Kliger 2d7ce926aa [marshal] Change mono_delegate_ctor to use coop handles 2017-05-23 11:30:48 -04:00
Aleksey Kliger 8b9eaf7a72 [marshal] Use handles in mono_ftnptr_to_delegate
* Move most of the logic to mono_ftnptr_to_delegate_handle
* Use handles for
  System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointerInternal
2017-05-23 11:30:48 -04:00
Aleksey Kliger a61c283115 [runtime] Use coop handles in mono_delegate_ctor_with_method
Use coop handles in icall System.Delegate.CreateDelegate_internal

TODO: change callsites fo mono_delegate_ctor_with_method_fixme to use handles
2017-05-23 11:30:48 -04:00
Aleksey Kliger 4a78d5cb13 [marshal] Use coop handles for OffsetOf, SizeOf, Prelink, PrelinkAll
System.Runtime.InteropServices.Marshal methods
* OffsetOf
* Prelink
* PrelinkAll
* SizeOf
2017-05-23 11:30:47 -04:00
Alexander Köplinger beb36c6a31 Remove outdated info and unused files from mcs/ (#4916)
Most of the removed files weren't touched in the last decade
and are unused so it's better to remove them to avoid confusion
about what they do.

I also went over and removed the most outdated info from readme
files, we probably want to do a more thorough overhaul in the future.
2017-05-23 14:27:42 +02:00
Marek Safar a0fc3f4dcf [mcs] When setting struct empty layout consider compiler generated fields. Fixes #55604 2017-05-23 08:41:04 +02:00
Alexander Köplinger 872976e6c6 Bump bockbuild to fix build 2017-05-23 02:32:55 +02:00
Zoltan Varga f285740333 [runtime] Add a fastpath to mono_object_isinst_icall (). (#4917) 2017-05-22 20:24:14 -04:00
Alexander Köplinger 3b2da24533 Use nuget 4.3.0-preview1 to fix build
4.5.0 is not yet available.

Also use lowercase nuget.exe to match the URL on https://dist.nuget.org/
2017-05-23 00:16:22 +02:00
Marek Safar ab98a01bac [mcs] Add expression bodied syntax for accessors. Fixes #54991 2017-05-22 23:31:07 +02:00
Bernhard Urban 1516837c58 [interp] fix unaligned. 2017-05-22 22:13:01 +02:00
Alexis Christoforides 99c93cbe85 [MacSDK] Update Nuget to 4.5, switch to binary release instead of building 2017-05-22 16:04:51 -04:00
Alexander Köplinger 29741a40cb [bcl] Make monolite platform specific (#4910)
mscorlib.dll etc will be platform specific in the future. This also
means that we need to adapt monolite since it'll become platform
specific once we start the divergence.

monolite is essentially a repackaging of the "build" profile which
means we need to turn that profile into multi-platform profile
like net_4_x. We'll still have a symlink from build -> build-darwin
and the monolite which is downloaded or packaged in the tarball
is expanded into mcs/lib/monolite-<platform> depending on the platform
you're building on.

I had to move the get-monolite-latest target from the top-level
Makefile.am into mcs/class/Makefile so it has access to HOST_PLATFORM,
but it arguably should've been there anyway before.
2017-05-22 18:09:44 +02:00
Alexander Köplinger a796ce400d [bcl] Exclude Mono.CSharp.dll from api diff
We don't guarantee a stable API there and it changes often
when mcs internals change.
2017-05-22 18:02:12 +02:00
Alex Rønne Petersen 506e60cf63 [profiler] Fall back to CLOCK_MONOTONIC if CLOCK_PROCESS_CPUTIME_ID results in EINVAL. (#4913)
This is the case on WSL.
2017-05-22 11:02:22 -04:00
Marek Safar 3f527c012d [mcs] Inflate referenced current types for imported type definitions. Fixes #56462 2017-05-22 17:01:12 +02:00
Marek Safar 027da05f20 [mcs] Removes TypeManager calls from MoreSpecific 2017-05-22 17:01:12 +02:00
vkargov eb18b8c0de [ci] Add the collect-coverage tag for use on Jenkins. (#4912)
* [ci] Add the collect-coverage tag for use on Jenkins.

* Move collect-coverage up so we don't set different values for -O
2017-05-22 14:43:28 +02:00
Bernhard Urban 88a90e5c20 [mcs] extend API for loading types and consuming source file from a stream (#4905) 2017-05-22 12:40:19 +02:00
Rodrigo Kumpera 48d1ebf570 [jit] Fix x86 failures and handle unaligned load with offset 2017-05-19 19:47:51 -07:00
Rodrigo Kumpera d0b38e1871 [corlib] Address reviewer comments to new test. 2017-05-19 15:06:19 -07:00
Alexander Köplinger 836194d63b Bump api-snapshot 2017-05-19 22:51:54 +02:00
Marek Safar ea0f582d72 Bump Roslyn to 2.3 preview 2017-05-19 21:45:26 +02:00
Alexis Christoforides aaf9fd3dbd Bump bockbuild 2017-05-19 15:24:13 -04:00
Alexander Köplinger ab514a67ee Bump the btls submodule
Bring in the change that makes building the "tool" subdirectory
in BTLS off by default - we don't need it in Mono and it fails
to build on some platforms with older C++ compiler.
2017-05-19 19:55:41 +02:00
Marek Safar 323fcec547 [mcs] Report more unsafe code errors in iterators. Fixes #56616 2017-05-19 18:46:14 +02:00
Marek Safar 3877878670 [build] Remove platforms from xbuild build 2017-05-19 18:16:28 +02:00
Zoltan Varga afffab3b5c [amd64] Fix the allocation of the caller area in filter clauses. Fixes #56567. (#4903) 2017-05-19 11:37:38 -04:00
Alexander Köplinger 3637f8cddf [bcl] Dispose Cecil AssemblyDefinition after usage (#4900)
Follow-up to https://github.com/mono/mono/pull/4899. I audited
all the places in BCL where we made use of Cecil's AssemblyDefinition
and made sure we're properly disposing them and not keeping files
unnecessarily open.

I used InMemory=true in cases where tracking the lifetime would
be complicated. There are also some tests in mcs/tests which I
didn't bother to fix.
2017-05-19 12:59:00 +02:00
Katelyn Gadd 087316c833 Warn on failure to create default Reflection.Emit SymbolWriter instead of throwing and failing (#4748)
* Bug #53038: Warn on failure to create default Reflection.Emit SymbolWriter (on platforms like Android that don't ship one) instead of throwing and failing
2017-05-19 09:24:49 +02:00
Rodrigo Kumpera 5e5e381907 [jit] Add unaligned tests. 2017-05-18 20:16:30 -07:00
Zoltan Varga 3713c3d810 [amd64] Remove the restriction on the locals stack size. Fixes #56452. (#4901) 2017-05-18 22:47:56 -04:00
Rodrigo Kumpera 11917e41a8 [jit] Properly handle unaligned memory access. 2017-05-18 16:38:05 -07:00
Rodrigo Kumpera b79a891772 [jit] Assorted small changes.
Remove 10000 size check in mini_emit_memory_copy_bytes, this is no longer needed now that the memcpy expansion logic in mini_emit_memcpy_internal was fixes.

Use a define for 10000.

Remove useless debug spew.
2017-05-18 16:19:22 -07:00
Rodrigo Kumpera 8884492839 [mini] Remove assert and document reason it can't be used. 2017-05-18 15:56:54 -07:00
Bernhard Urban 56e3456e5f [interp] respect 64bit alignment on armv7 2017-05-19 00:03:49 +02:00
Alexander Köplinger c989c25405 [pdb2mdb] Dispose Cecil AssemblyDefinition on pdb2mdb (#4899)
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=56275

Recent Cecil 0.10 changed to not reading the assembly in memory but
instead reads directly from the underlying stream [0]. This however
means that the file handle is not freed until the AssemblyDefinition
is disposed.

Xamarin.Android is using the pdb2mdb source as part of
Xamarin.Android.Build.Tasks.dll and hit an issue where the file
would be locked inside of VS.

[0] http://cecil.pe/post/149243207656/mono-cecil-010-beta-1
(cherry picked from commit 5077205a44)
2017-05-18 21:44:04 +02:00
Alexander Köplinger 3bb98453bb [configure] Add stdalign.h checks for BTLS to ARM platforms too
We added it for x86/amd64 in 488b550ac0
but missed adding that check when ARM was added recently.
2017-05-18 20:13:45 +02:00
vkargov 1009c92386 [aot] Fix a memory leak related to constraint allocation/deallocation. (#4880)
* [jit] Make a copy of the constraint in mini_get_shared_gparam().

* [aot] Free the temporary gshared constraint in decode_class_ref().
2017-05-18 14:08:58 -04:00
Katelyn Gadd 20ab5bfe7a Fixes for bug#54388 "InternalsVisibleTo is case sensitive" * Fix the JIT so that access checks are performed on constructors * Use ASCII case insensitivity when performing cross-assembly access checks for internals * Update mcs to use case-insensitive comparisons when evaluating InternalsVisibleTo attributes for access checks (matching the new runtime behavior, and the behavior of roslyn)
This issue is actually a pair of bugs:
1. We don't perform any access checks for constructors (which can give a false impression of our behavior for this issue). This means that you can also invoke private constructors from other assemblies.
2. InternalsVisibleTo checks are done using strcmp instead of a case-insensitive comparison.
2017-05-18 19:00:28 +02:00
Marek Safar 4465db2b46 [corlib] Bump DoubleWait test timeouts 2017-05-18 17:45:01 +02:00
vkargov f55019707b Fix eglibc remapping and revive the test for its completeness. (#4896)
* [eglib] Add the missing eglib remappings.

* [tests] Revive the eglib remapping completeness test.
2017-05-18 11:04:58 -04:00
Marek Safar 8522b3d989 Adds System.Net.Http 4.3.2 to blacklist 2017-05-18 14:45:14 +02:00
Alexander Köplinger 4b2ec296b6 [configure] Remove the --enable-dynamic-btls switch, it is the only option 2017-05-18 12:58:57 +02:00
Marek Safar b21dc44004 [ci] Enable linker tests on PRs 2017-05-18 10:07:38 +02:00
Marek Safar 16aeed9691 Add linker tests 2017-05-18 10:07:38 +02:00
Marek Safar 11e95169e7 Add LinkerDescriptor 2017-05-18 10:07:38 +02:00
Marek Safar fdc0acbb01 Bump linker 2017-05-18 10:07:38 +02:00
Rodrigo Kumpera eec0a66009 [jit] Remove mini_emit_stobj from method-to-ir.c and move mini_emit_wb_aware_memcpy to memory-access.c 2017-05-17 18:51:19 -07:00
Rodrigo Kumpera e05343ddf5 [jit] Replace usage of mini_emit_stobj with mini_emit_memory_copy and simplify usage since the later can handle ref types. 2017-05-17 18:51:19 -07:00
Rodrigo Kumpera 45f1fb7d50 [jit] Fix wording of the function description 2017-05-17 18:51:19 -07:00
Rodrigo Kumpera 414b5fc644 [jit] Fix mono_debug_count breakage introduced by the g_getenv change. 2017-05-17 18:51:19 -07:00
Rodrigo Kumpera 0fd8ecd055 [mini] Add mini_emit_memory_copy to replace mini_emit_stobj 2017-05-17 18:51:19 -07:00
Rodrigo Kumpera 28a16d28a0 [jit] Fix large const memcpy/memset when when the intrins pass is disabled. 2017-05-17 18:51:19 -07:00
Rodrigo Kumpera 32eb3111ee [runtime] Rework how unaligned memcpy/memset are generated.
Problems with the current code:
	It's wrong on 64bits if align == 4
	It's wrong on 64bits if offset is not 0 or 4.
	It generates bad code if align > 1 && align < SIZEOF_VOIDP

This PR implements unaligned based on the following set of assumptions that are true for the current set of platforms we support:

- A load/store of size X works with data aligned on X. IE, a short store can handle addresses aligned to 2
- Unaligned access is either disallowed or plain slower.
- Both source and dest abide to the supplied alignment.

The way we emit unaligned access is by emitting the widest possible access based on alignment and offset.

TBH: use unaligned access on targets like x86 that support it and are profitable.
2017-05-17 18:51:18 -07:00
Zoltan Varga 92bc142c7c [runtime] Make RuntimeHelpers:SufficientExecutionStack () a no-op on android for now. Fixes #56240. (#4889) 2017-05-17 12:33:08 -04:00
Aleksey Kliger 5a5145461d [coop handles] Add mechanism to track handle leaks
When MONO_HANDLE_TRACK_SP is defined, each handle records the native C stack pointer
at the time of its nearest enclosing HANDLE_FUNCTION_ENTER.  If a subsequent
handle is allocated with a lower stack pointer (in memory; ie higher in the
call tree) then a HANDLE_FUNCTION_RETURN is missing and we're leaking handles.
2017-05-17 12:20:37 -04:00
Bernhard Urban 9710e93212 [interp] assume EABI for passing arguments to arm trampoline 2017-05-17 17:36:43 +02:00
Bernhard Urban e13b6b397e [interp] use helper function to check if generic inst is a value type 2017-05-17 17:36:43 +02:00
Bernhard Urban eac4aabb7e [arm] respect thumb mode in mixed mode unwinding 2017-05-17 17:36:43 +02:00
Bernhard Urban 31778d9146 [interp] properly pass 64bit integers to native code on 32bit arches 2017-05-17 17:36:43 +02:00
Bernhard Urban 5f72be6d6d [interp] disable some tests that fail on CI only
can't reproduce the crash on my dev device, will investigate later.
2017-05-17 17:36:43 +02:00
Bernhard Urban 67441500e4 [interp] make mixed mode work on arm 2017-05-17 17:36:43 +02:00
Bernhard Urban 77e670ccb3 [interp] generics/vt fix regarding elem size for ldelem.vt 2017-05-17 17:36:43 +02:00
Bernhard Urban 908e8381f0 [interp] intrinsify System.Array.UnsafeLoad 2017-05-17 17:36:43 +02:00
Bernhard Urban c49249d3b8 [interp] add a conversion that is only required for 32bit 2017-05-17 17:36:43 +02:00
Bernhard Urban de6528383b [interp] icall trampoline for arm 2017-05-17 17:36:43 +02:00
Bernhard Urban 29c82e9a81 [interp] make mixed mode work on arm64 2017-05-17 17:36:43 +02:00
Bernhard Urban 8f886aa5ad [interp] fix gcc warnings 2017-05-17 17:36:43 +02:00
Bernhard Urban 18d4e1c1d7 [interp] fix conv.u4.r8 on arm64 2017-05-17 17:36:43 +02:00
Bernhard Urban 4010476492 [interp/tramp] use MONO_STRUCT_OFFSET infrastructure and extract constants 2017-05-17 17:36:43 +02:00
Bernhard Urban 19bdbfa77c [interp] implement icall_trampoline for arm64 2017-05-17 17:36:43 +02:00
Alexander Köplinger 62e8f04c23 Rename Microsoft.NuGet.Build.Tasks.dll.sources to exclude profile
The earlier name sent gensources.sh into an infinite loop,
not sure why yet. The directory is only built for xbuild_14
anyway so this should be safe.
2017-05-17 14:14:04 +02:00
Alexander Köplinger 40a27d977b Fix tarball build
The itanium backend was removed.
2017-05-17 05:39:08 +02:00
David Naylor 8b27dee31d w32handle: double the available slots (#4856)
Mono crashes if the system has more than ~128G of RAM.  Doubling the
number of slots fixes the SIGSEGV error on FreeBSD.
2017-05-16 20:45:24 -04:00
Alexander Köplinger 0ed7b3647a [MacSDK] Remove some outdated info from ReadMe.rtf
uninstallMono.sh is no longer installed.

The website has instructions for removing Mono:
http://www.mono-project.com/docs/about-mono/supported-platforms/osx/#uninstalling-mono-on-mac-os-x
2017-05-17 00:29:48 +02:00
Jo Shields 66f78c9b43 [btls] Add "desktop" ARM Linux configurations (for IoT, mostly) (#4875)
* [btls] Add "desktop" ARM Linux configurations (for IoT, mostly)

* [btls] Disable optimized asm on soft-float ARM

It depends on a NEON FPU, which we don't target on soft float
2017-05-16 22:24:29 +02:00
Alexander Köplinger f4ce23e0b7 [btls] Add MonoPInvokeCallback attribute on all full aot profiles (#4879)
It was #ifdef'ed to only be available on monotouch before,
but the testing_aot_full profile in CI runs into this test failure:

```
MESSAGE:
System.ExecutionEngineException : Attempting to JIT compile method '(wrapper native-to-managed) Mono.Btls.MonoBtlsSslCtx:NativeVerifyCallback (intptr,int,intptr)' while running in aot-only mode. See https://developer.xamarin.com/guides/ios/advanced_topics/limitations/ for more information.

+++++++++++++++++++
STACK TRACE:
  at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_thread_interruption_checkpoint ()
  at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:GetFunctionPointerForDelegateInternal (System.Delegate)
  at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate[TDelegate] (TDelegate d) [0x00013] in <fa55a8c31ba0490383239e5850d81686>:0
  at Mono.Btls.MonoBtlsSslCtx..ctor (Mono.Btls.MonoBtlsSslCtx+BoringSslCtxHandle handle) [0x00059] in <18810f39bffc41dcb0263eb2043cc10e>:0
  at Mono.Btls.MonoBtlsSslCtx..ctor () [0x0000b] in <18810f39bffc41dcb0263eb2043cc10e>:0
  at Mono.Btls.MonoBtlsContext.InitializeConnection () [0x00000] in <18810f39bffc41dcb0263eb2043cc10e>:0
  at Mono.Btls.MonoBtlsContext.StartHandshake () [0x00000] in <18810f39bffc41dcb0263eb2043cc10e>:0
  at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncProtocolRequest asyncRequest, Mono.Net.Security.AsyncOperationStatus status) [0x00004] in <18810f39bffc41dcb0263eb2043cc10e>:0
  at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation (Mono.Net.Security.AsyncOperationStatus status) [0x0006b] in <18810f39bffc41dcb0263eb2043cc10e>:0
  at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation () [0x0000d] in <18810f39bffc41dcb0263eb2043cc10e>:0
  at Mono.Net.Security.AsyncProtocolRequest.StartOperation () [0x0003c] in <18810f39bffc41dcb0263eb2043cc10e>:0
  at Mono.Net.Security.AsyncProtocolRequest.StartOperation (Mono.Net.Security.AsyncOperation operation) [0x00024] in <18810f39bffc41dcb0263eb2043cc10e>:0
  at Mono.Net.Security.MobileAuthenticatedStream.ProcessAuthentication (System.Net.LazyAsyncResult lazyResult) [0x00057] in <18810f39bffc41dcb0263eb2043cc10e>:0
```

The attribute itself is already conditional on MONOTOUCH and
FULL_AOT_RUNTIME so simply removing the ifdef should fix the issue.
2017-05-16 21:29:49 +02:00
Niklas Therning 7f245c7798 Merge pull request #4877 from ntherning/fix-file-handle-leak-in-mono_mmap_open_file-on-windows
Fixes a file handle leak in mono_mmap_open_file() on Windows
2017-05-16 19:36:18 +02:00
Niklas Therning 566eb0ccdb Fixes a file handle leak in mono_mmap_open_file() on Windows. See
https://bugzilla.xamarin.com/show_bug.cgi?id=56493.
2017-05-16 19:35:11 +02:00
Mikayla Hutchinson 8077ff5da7 [xbuild] Add web targets for 15.0 (#4868) 2017-05-16 12:31:19 +02:00
Alexander Köplinger b41b5928ec [msvc] Remove order.xml (#4867)
It's a build artifact anyway since we check in the generated csproj's
so you don't really need the order.xml.

After the new platform-specific BCL changes went in it also started
containing stuff like `-r:./../../class/lib/net_4_x-linux/mscorlib.dll`
which makes it even less useful to have checked in as it'd get
changed when you build on OSX for example.
2017-05-16 12:10:34 +02:00
Ludovic Henry c74f8a0ea5 [threadpool] Fix alignment of ThreadPoolWorkerCounter (#4871)
It is accessed with a 64bits atomic operation, so it needs to be 64bits aligned, even on a 32bits platform. A CPU exception EXC_ARM_DA_ALIGN triggers on armv7 32bits.

Fix https://bugzilla.xamarin.com/show_bug.cgi?id=56202
2017-05-15 22:19:34 -04:00
Vlad Brezae e120193ed1 Merge pull request #4752 from BrzVlad/feature-dynamic-nrs
[sgen] Dynamic nursery sizing
2017-05-16 03:22:50 +03:00
Rodrigo Kumpera d99cf6b096 [corlib] Reduce the warning spew our testsuite produces. 2017-05-15 16:20:14 -07:00
Rodrigo Kumpera 7283aded35 [corlib] Add tests for the behavior of IO in the face of a symlink loop.
The behavior was empirically found on windows and dotnet.
2017-05-15 16:19:07 -07:00
Rodrigo Kumpera c51f5516ce [corlib] Remove the File.Exists check before opening the file.
It's both racy and not necessary.

Beyond that, it will produce the wrong exception if opening the file fails for a different reason that it's missing.

This is an issue in case of bad permissions or symlink loops.
2017-05-15 16:17:23 -07:00
Zoltan Varga 163cfa71fd Interp fixes (#4864)
* [interp] Add support for mkrefany,refanytype and refanyval.

* [interp] Avoid inlining empty methods marked with NoInlining.

* [interp] Fix the popping of arguments when inlining empty methods.
2017-05-15 18:53:10 -04:00
Frederik Carlier 62a24d06c2 System.Drawing: Various netstandard1.6 compat fixes (#4863)
Minor fixes which make System.Drawing compatible with netstandard1.6:
- Use MemoryStream.ToArray instead of .GetBuffer
- Use RuntimeInformation.IsOSPlatform to determine the operating system
- Use Stream.Dispose instead of Stream.Close
- Disable serialization support for exceptions
- Don't use AppDomain
2017-05-15 21:10:01 +02:00
Jonathan Pryor 384c431d88 [amd64] Make more inline functions in header static (#4869)
Related: commit 00c6a94a

When [Xamarin.Android attempts to build with mono/2017-04][0], the
build breaks when cross-linking Windows code via MXE due to the
presence of an undefined `inline`d function:

	./.libs/libmini.a(libmini_la-tramp-amd64.o):…/xamarin-android/external/mono/mono/mini/tramp-amd64.c:746:
	undefined reference to `mono_arch_unwindinfo_get_size'

Turn `mono_arch_unwindinfo_find_pc_rt_func_in_table()` and
`mono_arch_unwindinfo_get_size()` into `static inline` functions so
that they don't cause "undefined reference" linker errors.

Additionally, audit the rest of `mono` to ensure there aren't any
other `inline` functions that aren't `static`:

	$ git grep '\<inline\>' mono | grep -v static | grep -E '(\.c|\.h):'
	# ~50 matches, all of which are in comments or otherwise not relevant.

[0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/388/
2017-05-15 13:36:48 -04:00
Zoltan Varga e5552e6905 [runtime] Remove ia64 backend, the Itanium architecture is dead. (#4859) 2017-05-15 13:04:32 -04:00
Rodrigo Kumpera 230535d995 Merge pull request #4851 from kumpera/handle_eloop_errno
[metadata] Handle ELOOP in mono_w32error_unix_to_win32.
2017-05-15 07:58:33 -07:00
Martin Baulig 1e259bf34d [System]: Update corefx/SR.cs in preparation of the upcoming HttpListener merge. (#4849) 2017-05-15 10:39:19 -04:00
Aleksey Kliger d321424cab [sre] Don't leak coop handles in mono_dynimage_encode_typedef_or_ref_full
This function calls mono_class_get_ref_info which allocates a coop handle.
However it is called from an icall that wasn't converted to use coop handles
yet, so nothing was saving/restoring the handle stack mark, and consequently
the handles leak.
2017-05-15 10:33:54 -04:00
Jonathan Chambers 7eafb61cf1 Use handle macros to avoid leaking result of mono_type_get_object_handle 2017-05-15 10:33:54 -04:00
Bernhard Urban 125892ae42 [interp] update ignore list for CI 2017-05-15 15:51:57 +02:00
monojenkins 79cc1aeccd [msvc] Update csproj files (#4846) 2017-05-15 14:23:05 +02:00
Bernhard Urban e314d56b21 [image] follow up fix for 62bc1b229e
otherwise we try to access `ignored_assemblies_names` out of bounds
2017-05-15 12:46:33 +02:00
Vlad Brezae 5c09208917 [tests] Remove unreferenced bridge test targets
These were changed and renamed in a previous commit.
2017-05-15 12:52:51 +03:00
Vlad Brezae ca15fa930e [sgen] Track down promoted size also with parallel minors 2017-05-15 12:52:51 +03:00
Vlad Brezae 820988907c [sgen] Use the idle object ops for worker jobs
We had the object ops set in the job when allocating the job (typically by the main gc thread). When enqueueing jobs, we leave their ops NULL, and when the worker actually executes the job, it will use the idle object ops, which can get dynamically optimized over the work cycle.
2017-05-15 12:52:51 +03:00
Vlad Brezae f1542c6e52 [sgen] Don't execute jobs before actually starting the workers
It's counter intuitive and it might lead to races at some point.
2017-05-15 12:52:51 +03:00
Vlad Brezae 5c74ddb92d [sgen] Resize nursery according also to pause times 2017-05-15 12:52:51 +03:00
Vlad Brezae cd658d90cc [sgen] Dynamic nursery sizing
We attempt to have a nursery that is as large as possible, while keeping a relative limit to the heap size.
2017-05-15 12:52:51 +03:00
Vlad Brezae 63d33d7f94 [sgen] Remove unused function 2017-05-15 12:52:51 +03:00
Vlad Brezae 393db66fa0 [sgen] Remove some redundancy with nursery section 2017-05-15 12:52:51 +03:00
Vlad Brezae 882ae6dc81 [sgen] Kill USER_CONFIG
It is useless and confusing. We always support setting the nursery-size through MONO_GC_PARAMS.
2017-05-15 12:52:51 +03:00
Frederik Carlier b6147c325e System.Drawing: netstandard1.6 compatibility: String fixes (#4862)
- ImageFormatConverter uses string.Compare to compare extensions for known file types. It uses CultureInfo.InvariantCulture,
  which is not available on netstandard1.6. Because all the extensions use ASCII-characters, StringCOmparsion.OrdinalIgnoreCase
  can be used, which is equivalent.
- Replace ToLower (CultureInfo.InvariantCulture) with .ToLowerInvariant ()
2017-05-15 02:39:24 +02:00
Frederik Carlier f121eb73d4 [System.Drawing] NS1.6 compatibility: Use GetTypeInfo () where required (#4861)
* netstandard1.6 compatibility: Use GetTypeInfo () where required

A lot of methods have moved from Type to TypeInfo in netstandard1.6, add calls to GetTypeInfo ()
where required to support compiling System.Drawing on netstandard1.6

* Add missing using statement
2017-05-15 02:23:43 +02:00
Alexander Köplinger 291a32febc [csproj] Update generator to handle platform-specific assemblies (#4847)
After https://github.com/mono/mono/pull/4837 was merged the
csproj update bot started sending PRs which hardcoded net_4_x-linux
as the OutputPath.

Updated the csproj generator to detect this and use a variable
in the OutputPath instead. It'll autodetect based on the current OS
and can be overriden by passing /p:HostPlatform=foobar to msbuild.

Ideally we'd have configurations for each platform in the csproj since
in the future the file lists will be different but this is a first step.
2017-05-13 17:26:35 +02:00
Marek Safar 62bc1b229e [runtime] Remove System.ValueTuple from denied assemblies. It's not needed
anymore because we have reference assemblies and it didn't work for mobile tools (e.g. linker)
2017-05-13 16:27:45 +02:00
Alexander Köplinger c31458a5ad [MacSDK] Whitelist mono32 2017-05-13 13:08:07 +02:00
Rodrigo Kumpera 0ccfcec6fe [metadata] Handle ELOOP in mono_w32error_unix_to_win32. 2017-05-12 15:34:52 -07:00
Vlad Brezae c217843334 Merge pull request #4828 from BrzVlad/fix-windows-ci
[runtime] Fix windows ci
2017-05-12 22:43:35 +03:00
Martin Baulig 5c0f506a8d [System]: Replace HttpListenerResponseHelper with HttpStatusDescription from CoreFX (#4833)
* [System]: Replace HttpListenerResponseHelper with HttpStatusDescription from CoreFX.

* Update common.sources
2017-05-12 14:32:50 -04:00
Jan-Joost Spanjers b60cf06374 Include gmodule-win32-internals.h in tarball (#4843) 2017-05-12 16:44:40 +02:00
Martin Baulig 9f0f177b6f [System]: Add HttpListenerBasicIdentity.platformnotsupported.cs for watch. (#4836) 2017-05-12 10:33:07 -04:00
Zoltan Varga 2d19e5e052 Amd64 gsharedvt small sizes (#4841)
* [jit] Fix CPBLK for large sizes.

* [amd64] Fix the byref->byval passing of small arguments from gsharedvt methods, we were loading loading them as pointers, which meant the upper bits might contain garbage. Fixes #56247.
2017-05-12 08:58:56 -04:00
Alexander Köplinger e0b669dc1b Update API snapshot with recent API changes 2017-05-12 14:32:40 +02:00
Marek Safar 52d82cba0a Bump corefx 2017-05-12 07:34:44 +02:00
Zoltan Varga e7839d77b4 [jit] Fix CPBLK for large sizes. 2017-05-11 20:26:49 -04:00
vkargov 6ac36d6c40 Merge pull request #4327 from vkargov/vk-abcremedy
[runtime] Abcrem fixes.
2017-05-11 17:02:57 -07:00
Alexander Köplinger 2324773fbb [Facades] Update with new typeforwarders/APIs (#4838) 2017-05-12 01:36:05 +02:00
Ludovic Henry 5250b855e5 [mcs] Add platform specific files (#4837)
* [mcs] Rework %-recursive target to explicitely list subdirectories

* [mcs] Rename PLATFORM to BUILD_PLATFORM

* [mcs] Add platform specific files

This is to support adding corefx platform specific files. To do that, we now support `mcs/class/corlib/linux_net_4_x_corlib.dll.sources` for example, on top of `mcs/class/corlib/net_4_x_corlib.dll.sources` and `mcs/class/corlib/corlib.dll.sources`.

The 3 platforms that are supported are: `linux`, `darwin` and `win32`.

* [mcs] Build cross-platform bcl in separate folder
2017-05-11 19:19:09 -04:00
Martin Baulig 3f779475e3 [System]: HttpListener.CreateSslStream() should always use passed-in callback. (#4835) 2017-05-11 16:20:38 -04:00
Alexander Köplinger 720b81ff71 Revert "[MacSDK] Include 'opt' as a PATH-available binary"
This reverts commit 47365cd54b.

We didn't do this in the private bockbuild and putting
'opt' from Mono into the PATH could be problematic.

This makes us consistent with the private bockbuild whitelist.
2017-05-11 21:52:34 +02:00
Jonathan Chambers 053868c17b Specify Encoding.UTF8 when marshaling native runtime string. If not, string constructor accesses Encoding.Default which causes infinite recursion on Windows for codepages supported via I18N. While trying to load I18N assemblies, assembly names are marshaled in managed code now hitting this code path. Fixes Xamarin bug 43988. 2017-05-11 19:21:43 +02:00
vkargov f2dc087948 [jit] Keep unwind info in the domain's memory pool. (#4825) 2017-05-11 12:33:41 -04:00
Aleksey Kliger (λgeek) 006de2be02 Merge pull request #4796 from lambdageek/dev-handles-may04
[runtime] Another batch of coop handles icalls
2017-05-11 10:33:02 -04:00
Alexander Köplinger a8f395f763 [MacSDK] Port change to license.rtf from private bockbuild
https://github.com/xamarin/bockbuild/commit/97d660778097b391151776a611494a545becd62c
2017-05-11 01:38:11 +02:00
Vlad Brezae 055b15e042 [runtime] Don't consume exception if not allowed to
The thread_state indicates whether we have a pending exception that needs to be consumed (be it sync or async). Normally we check the state before calling mono_thread_execute_interruption, but make sure we don't consume an exception if the thread_state doesn't allow us to (we can have an abort requested but mono_thread_clear_interruption_requested can return FALSE if we are inside an abort protected block and shouldn't process it)
2017-05-11 02:14:11 +03:00
Vlad Brezae 07c6296f1c Merge pull request #4816 from BrzVlad/fix-remoting-exception
[remoting] Serialize exceptions between domains inside try/catch
2017-05-11 01:38:33 +03:00
Vlad Brezae c7e4ef422e [tests] Don't starve the main thread by doing GCs
Thread.Yield doesn't guarantee that the thread doing GCs won't do it excessively, leading to significant variances in test run time.

Decrease number of iterations since these tests can take around 1 min.
2017-05-11 00:15:55 +03:00
Rodrigo Kumpera 2ed4cddf00 Merge pull request #4818 from kumpera/unaligned-cleanup-2
Last bucket of cleanups before I land the actual code for unaligned.
2017-05-10 13:23:08 -07:00
Martin Baulig 859eac6db7 [System]: Add new 'common-networking.sources' and move stuff from 'common.sources'. (#4815)
* [System]: Add new 'common-networking.sources' and move stuff from 'common.sources'.

This moves all the networking-related sources which aren't supported on monotouch_watch
into a separate file, so we don't have to maintain a huge "Thing That Should Not Exist".

* Put back System.Net/NtlmClient.cs - we actually do need it.

* Add HttpListenerTimeoutManager.platformnotsupported.cs.

* Make it build.
2017-05-10 15:43:57 -04:00
Ludovic Henry b0289fe19c [process] Disable tests that do not work on mobile (#4598) 2017-05-10 14:53:03 -04:00
monojenkins 35a4c994c8 [msvc] Update csproj files (#4822) 2017-05-10 18:31:46 +02:00
Aleksey Kliger c2cd663d62 [security] Use coop handles for ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken 2017-05-10 11:14:01 -04:00
Aleksey Kliger 1a86a68e46 [security] Use coop handles for ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName 2017-05-10 11:14:00 -04:00
Aleksey Kliger 7f81c06a0c [security] Use coop handles for ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken
Refactor it into mono_security_principal_windows_identity_get_current_token ()
and then call that from ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken ()
2017-05-10 11:14:00 -04:00
Aleksey Kliger 427e0f335c [runtime] Use coop handles for System.RuntimeMethodHandle.GetFunctionPointer 2017-05-10 11:14:00 -04:00
Aleksey Kliger 21ae2786da [sre] Use coop handles for ModuleBuilder.set_wrappers_type 2017-05-10 11:14:00 -04:00
Aleksey Kliger 83daf8e0e8 [sre] Use coop handles for ModuleBuilder.GetRegisteredToken
- Fix typo in REFLECTION_EMIT_INIT/REFLECTION_EMIT_SAVE in
  mono_dynamic_image_register_token
- Add mono_dynamic_image_get_registered_token ()
- N.B. locking change - ves_icall_ModuleBuilder_GetRegisteredToken used to take
  the loader lock.  Now it calls mono_dynamic_image_get_registered_token which
  just takes the image lock.
2017-05-10 11:14:00 -04:00
Aleksey Kliger b834b10a3b [runtime] Use coop handles for System.Environment.internalBroadcastSettingChange 2017-05-10 11:14:00 -04:00
Aleksey Kliger b8670a4dbe [locales] Use coop handles for System.Text.Normalization.load_normalization_resource 2017-05-10 11:13:59 -04:00
Aleksey Kliger f110c73056 [sre] Use coop handles for System.Reflection.Emit.EnumBuilder.setup_enum_type 2017-05-10 11:13:59 -04:00
Aleksey Kliger 4f65bd0778 [sre] Use coop handles for System.Reflection.Emit.SignatureHelper.get_signature_local 2017-05-10 11:13:59 -04:00
Aleksey Kliger 7c50f6318c [sre] Use coop handles for System.Reflection.Emit.SignatureHelper.get_signature_field 2017-05-10 11:13:59 -04:00
Aleksey Kliger 0f952a7adf [loader] resolve symlinks when looking for an image in the loaded_images cache
Consider the old code (which just used mono_path_canonicalize)

Suppose foo.dll is a symlink to bar.dll

Suppose we've try to load foo.dll the first time:
do_mono_image_open is passed "foo.dll" it then sets image->name to "bar.dll"
which is then used by register_image to do a lookup and then inserts the
mapping from "bar.dll" to the new image (call it Image1).

Suppose we try to load foo.dll a second time:
we check for "foo.dll" in the loaded_images cache and get NULL.
So we call do_mono_image_open ("foo.dll", ...) again, and again image->name is
set to "bar.dll".  (Call this Image2)
We call register_image again which looks up bar.dll and gets Image1.  So it
increments the refcount for Image1 and unloads Image2 and so
mono_image_open_a_lot returns Image1.

With the new code:

The first time we try to load foo.dll everything is the same.  The second time
we try to load foo.dll, we resolve the symlink from "foo.dll" to "bar.dll" in
mono_image_open_a_lot and return Image1 directly from loaded_images.
2017-05-10 10:57:18 -04:00
Rolf Bjarne Kvinge 3af24f31f3 [System] Use 'ObjCRuntimeInternal' as the namespace instead of 'ObjCRuntime'. (#4820)
Use 'ObjCRuntimeInternal' as the namespace instead of 'ObjCRuntime' to avoid
these compiler-warnings when building xamarin-macios assemblies (which defines
the same types in the ObjCRuntime namespace, and to whom System.dll has an
InternalsVisibleTo attribute):

> xamarin-macios/src/build/watch/watch/Foundation/NSExtensionRequestHandling.g.cs(28,49): warning CS0436: The type `ObjCRuntime.INativeObject' conflicts with the imported type of same name'. Ignoring the imported type definition
> xamarin-macios/src/ObjCRuntime/INativeObject.cs(6,19): (Location of the symbol related to previous warning)
> xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/lib/mono/Xamarin.WatchOS/repl/System.dll (Location of the symbol related to previous warning)
2017-05-10 16:52:01 +02:00
Rodrigo Kumpera 02783048e9 [mini] Cleanup usage of mini_emit_memcpy and bad values for alignment - align to 4 on 64bits is *bad*. 2017-05-09 16:47:38 -07:00
Rodrigo Kumpera 348527989d [jit] CPBLK and INITBLK now use the funtions in memory-access.c 2017-05-09 16:04:36 -07:00
Rodrigo Kumpera 59dd7ccff2 [jit] Add mini_emit_memory_copy_bytes and mini_emit_memory_init_bytes to be used by cpblk and iniblk. 2017-05-09 16:04:31 -07:00
Rodrigo Kumpera 2517184252 Merge pull request #4781 from kumpera/unaligned-cleanup-1
First pass of cleanups to introduce a clear layer that deals with emiting load/stores.
2017-05-09 19:01:57 -04:00
Vlad Brezae df047ec2db [remoting] Serialize exceptions between domains inside try/catch
If a remote invoke in another domain throws an exception, the xdomain-dispatch wrapper will serialize the exception and pass it over to the calling domain so that it can be rethrown there. Serializing the exception object can itself throw an exception which we didn't properly catch, leading to unwinding to the caller domain without changing the domain state back and wreaking havoc.

If the serialization of the original exception throws a new exception, this new exception takes its place, being passed instead to the caller domain.
2017-05-10 00:54:47 +03:00
Marek Safar ce55518eb9 Bump corefx 2017-05-09 22:55:46 +02:00
Rodrigo Kumpera e026ad7e55 [runtime] Update msvc build scripts. 2017-05-09 13:51:11 -07:00
Zoltan Varga 3edf9da975 [jit] Allow inlining of methods with the AggressiveInlining flag even if they make calls. (#4811) 2017-05-09 15:36:22 -04:00
Zoltan Varga b6caf7d37a [jit] Mark bblocks making calls to the corlib ThrowHelper class as out of line. (#4812) 2017-05-09 14:33:26 -04:00
Marek Safar 9b06c6a000 [System.Data] Update cas test category 2017-05-09 19:14:51 +02:00
Marek Safar 68e177a966 [mcs] Conditional check on attribute type needs to check its base types too 2017-05-09 19:08:51 +02:00
monojenkins 5d33eca131 [msvc] Update csproj files (#4813) 2017-05-09 18:58:10 +02:00
Martin Baulig 280f222afa [System]: Remove 'SECURITY_DEP' conditional from HttpListener and related classes. (#4810) 2017-05-09 11:22:19 -04:00
Alexander Köplinger 94a0d73732 [tools] Add resx2sr to "build" profile (#4807)
Similar to 9635b9cea0 we
can now break the dependency on WinForms from resx2sr.

This allows us to add it to the "build" profile
and clean up the Makefile.
2017-05-09 14:28:10 +02:00
Rodrigo Kumpera 15df083d06 [jit] Add mini_emit_memory_store and use it for STOBJ. 2017-05-08 16:33:40 -07:00
Rodrigo Kumpera 4dee9cb05f [jit] Fix identation. 2017-05-08 16:11:58 -07:00
Rodrigo Kumpera cbcd4e8914 [jit] Use mini_emit_memory_load for ldind, ldobj and ldfld 2017-05-08 16:11:45 -07:00
Rodrigo Kumpera 2b5495896e [jit] Add mini_emit_memory_load that is to be used to lower CIL memory loads. 2017-05-08 16:09:28 -07:00
Martin Baulig e6e4422fb4 [System]: Add private '_internalLock' field to HttpListener. (#4809)
After switching to the CoreFx version, HttpListener.Mono.cs will remain,
so it needs to use the proper locking object.
2017-05-08 18:33:08 -04:00
Alexander Köplinger 6587eb73ae [bcl] Add API diff for monotouch/monodroid profiles (#4805)
This runs the API diff against the monotouch and monodroid
profiles in addition to net_4_x to help us catch mistakes that
only affect the mobile profiles.

To make updating the API snapshot in case of an intentional change
easier without needing to build those profiles locally I added
a way to download the diff as a .patch file. You can just download
the file from the API diff Jenkins generates and apply it locally.
2017-05-09 00:08:05 +02:00
Alexander Köplinger f95b3f433c [bcl] Cleanup outdated csproj/sln files (#4806)
They were either replaced by the autogenerated csproj files
or just completely broken for years.
2017-05-09 00:07:45 +02:00
Zoltan Varga 9247bb5ce6 [sdb] Avoid printing out the ThreadAbortException used to abort the protocol receiver thread. (#4804) 2017-05-08 17:34:06 -04:00
Martin Baulig 69689c95e5 [System]: Make HttpListener partial and move Mono-specific bits into HttpListener.Mono.cs. (#4808)
* [System]: Make HttpListener partial and move Mono-specific bits into HttpListener.Mono.cs.

* Remove ancient EMBEDDED_IN_1_0 conditional.

* Remove unused using statements.

* HttpListener.CreateSslStream() now uses RemoteCertificateValidationCallback.
2017-05-08 16:27:04 -04:00
Martin Baulig e5cdc000d7 [System]: Rename the internal class 'ChunkStream' into 'MonoChunkStream'. (#4803)
* [System]: Fully stub-out SslStream on platforms where it's not supported.

* Remove 'SECURITY_DEP' conditional from LocalCertificateSelectionCallback.

* Add the internal delegates and remove 'SECURITY_DEP' from SslStream.platformnotsupported.cs.

* In SslStream.cs, we now provide the full API when '!SECURITY_DEP' using the
PlatformNotSupportedException()-based implementation from SslStream.platformnotsupported.cs

* [System]: Rename the internal class 'ChunkStream' into 'MonoChunkStream'.

Our 'ChunkStream' is used by 'WebConnection', so it will stay after using
HttpListener from corefx.
2017-05-08 12:13:50 -04:00
Martin Baulig 141970828e [System]: Fully stub-out SslStream on platforms where it's not supported (#4802)
* [System]: Fully stub-out SslStream on platforms where it's not supported.

* Remove 'SECURITY_DEP' conditional from LocalCertificateSelectionCallback.

* Add the internal delegates and remove 'SECURITY_DEP' from SslStream.platformnotsupported.cs.

* In SslStream.cs, we now provide the full API when '!SECURITY_DEP' using the
PlatformNotSupportedException()-based implementation from SslStream.platformnotsupported.cs

* Fix typo.
2017-05-08 12:12:08 -04:00
Rodrigo Kumpera 5e1d20ac48 Merge pull request #4799 from xmcclure/mingw-has-secure-api
Fix mingw/mxe build
2017-05-08 12:07:46 -04:00
Aleksey Kliger f5696e5888 [mono-error] Always call TLE(string,string) constructor
if assembly name is NULL, mono_exception_from_name_two_strings_checked looks
for a TLE(string) constructor - which takes a message - which we immediately
overwrite.

So pass the empty string instead, which goes to the (Mono-specific)
TLE(string,string) constructor which intializes ClassName and AssemblyName
members of a TLE.
2017-05-08 10:49:12 -04:00
Aleksey Kliger c21ffa3695 [runtime] Fail classes that have a field with a bad underlying type
If a class T has a field e of enum type E, and E is either
incomplete (EnumBuilder that hasn't had CreateType called) or a broken class,
then mark T as failed.
2017-05-08 10:49:12 -04:00
Aleksey Kliger 4bb7e0805e [test] Don't crash if incomplete enum type is a static field in a class 2017-05-08 10:49:12 -04:00
Andi McClure 48a1825bff Fix mingw/mxe build
wcscat_s is not available on mingw unless a special symbol is defined. Add this symbol to exceptions-amd64.c
2017-05-05 13:29:18 -04:00
Zoltan Varga 608fbb28a0 [jit] Fix 4c0df6de33, use __GNUC__ instead of GNUC. 2017-05-05 08:28:36 -04:00
Bernhard Urban 2c9595fe9b [interp] do widening for more arith ops 2017-05-05 13:06:36 +02:00
Alexander Köplinger 12d5afd75f [configure.ac] Fix inadvertently invoking X server (#4792)
I noticed this when I cleaned my Mono repo and reran autogen.sh.
I suddenly got a popup from XQuartz about "Unrecognized option: =".

Turns out this was introduced in 9e967f00b3,
the second half of the if is missing `test`, so it actually runs
`x = xyes` which starts XQuartz :D

Also cleaned up the USE_NLS checking since that ran immediately
before this and just printed "no" before which confused me.
2017-05-05 00:04:43 +02:00
Aleksey Kliger (λgeek) 23ae27b70d Merge pull request #4782 from lambdageek/dev-mono_string_new-excise
[runtime] Mark mono_string_new external only
2017-05-04 17:31:01 -04:00
Andi McClure 047414c02c Merge pull request #4788 from xmcclure/if-winrt
Fix hybrid AOT build
2017-05-04 16:56:12 -04:00
Martin Baulig 45bcf3e665 [System]: Fix TLS Provider registration and use BTLS instead of Legacy. (#4793) 2017-05-04 16:51:16 -04:00
Andi McClure fde1280c21 Require #if WIN_PLATFORM more strictly around some WinRT timezone functions
This was breaking the hybrid AOT build.
2017-05-04 12:46:35 -04:00
Aleksey Kliger eeac70e579 [runtime] Mark mono_string_new external only
Runtime should use mono_string_new_checked
2017-05-04 12:01:16 -04:00
Aleksey Kliger cc8d3f09dd [interp] Use mono_string_new_checked instead of mono_string_new 2017-05-04 12:01:15 -04:00
Aleksey Kliger e05a638937 [mini] Use mono_string_new_checked instead of mono_string_new
(mono-security-windows.c) (aot-compiler.c) (debugger-agent.c) (driver.c) (mini-exceptions.c)
2017-05-04 12:01:13 -04:00
Aleksey Kliger 419331f455 [runtime] Use coop handles for some simple icalls
- System.Text.EncodingHelper.InternalCodePage
- System.Runtime.InteropServices.Marshal.PtrToStringAnsi(intptr)
- Use coop handles for ves_icall_System_Configuration_DefaultConfig_get_machine_config_path
- Use coop handles for ves_icall_System_Configuration_InternalConfigurationHost_get_bundled_app_config
- Use coop handles for System.Web.Util.ICalls.GetMachineInstallDirectory
2017-05-04 12:00:39 -04:00
Aleksey Kliger 72787358ad [locales] Use coop handles for System.Globalization.CultureInfo.get_current_locale_name 2017-05-04 12:00:33 -04:00
Aleksey Kliger a77fff8e4c [runtime] Use coop handles for System.Environment icalls
- get_UserName
- get_NewLine
- get_MachineName
- GetWindowsFolderPath
- GetOSVersionString

MonoError-ize mono_icall_get_environment_variable_names
2017-05-04 12:00:31 -04:00
Aleksey Kliger 087178ba2c [appdomain] Make mono_domain_set_config external only
Runtime should use mono_domain_config_checked ()
2017-05-04 12:00:30 -04:00
Aleksey Kliger 5f96b9c6e7 [locales] Use mono_string_new_checked instead of mono_string_new 2017-05-04 12:00:28 -04:00
Aleksey Kliger b28dfdd4ee [runtime] Use mono_string_new_checked instead of mono_string_new
(w32file.c) (filewatcher.c) (appdomain.c) (attach.c) (appdomain.c)
(gc.c) (marshal.c) (mono-perfcounters.c) (mono-security.c) (object.c)
(sre.c) (threadpool.c) (threads.c) (w32process.c) (w32socket.c)
2017-05-04 12:00:20 -04:00
Zoltan Varga 4c0df6de33 [jit] Compile unwinder_unwind_frame without optimization on arm64 as old gcc versions seems to miscompile it. 2017-05-04 11:59:09 -04:00
Aleksey Kliger b24fbe31cb [mono-route] Use _checked functions
And include config.h
2017-05-04 11:30:59 -04:00
Aleksey Kliger 9bb07c7986 [mono-error] Use mono_string_new_checked instead of mono_string_new 2017-05-04 11:26:59 -04:00
Aleksey Kliger 8d349deb2a [runtime] Use mono_string_new_checked in exception.c 2017-05-04 11:26:58 -04:00
Aleksey Kliger 20bdb3ec83 [pedump] Fix running with cooperative GC
This is the pedump analog of 9f5115a343
which fixed monodis under coop.
2017-05-04 10:01:54 -04:00
Alexander Köplinger 9667b4ef59 [bcl] Add .NET 4.7 reference assemblies (#4791) 2017-05-04 12:56:27 +02:00
Alexander Köplinger 49bb738eb2 [System.Net.Http] Fix XI build 2017-05-04 06:11:24 +02:00
vkargov d24633b39c [jit] Fix memory leak in trampoline info registration. (#4775) 2017-05-03 16:28:58 -04:00
Alexis Christoforides e523f243d6 [MacSDK] Build msbuild for Release config 2017-05-03 15:56:47 -04:00
Vlad Brezae 1afda33e4f Merge pull request #4787 from BrzVlad/fix-degraded-mode
[sgen] Fix accidental triggering of degraded mode
2017-05-03 22:47:01 +03:00
Alexis Christoforides e266dbe695 Bump bockbuild 2017-05-03 14:50:40 -04:00
Andi McClure 00dff71419 Merge pull request #4780 from xmcclure/assembly-loader-default
Document --assembly-loader and change default to 'legacy'
2017-05-03 13:45:44 -04:00
Andi McClure ca6365b316 Document --assembly-loader, change default to 'legacy' and fix comment
Also set testing_gac tests to use --assembly-loader=strict, since it is no longer the default
2017-05-03 10:48:48 -04:00
Vlad Brezae 94fe3dfb62 [sgen] Fix accidental triggering of degraded mode
We trigger degraded mode when we are unable to properly build the nursery fragments due to excessive nursery pinning. This is done by initializing degraded_mode at the end of a minor. alloc_degraded is used to do allocation to major heap either as part of mature allocation or as part of degraded mode (when we bump the degraded_mode so we can detect when the next minor should be triggered).

When failing to allocate from the nursery after doing a minor (because the other threads might have already consumed the nursery) we need to do a mature allocation (as a fallback) instead of a degraded mode allocation so we don't uselessly enable the mode.
2017-05-03 17:11:00 +03:00
Zoltan Varga 5e7137b6fe Mixed mode exception handling (#4777)
* [mixed] Add beginnings of unwinding support for interp->jit transitions by pushing an LMF frame on the stack when exiting interpreted code.

* [runtime] Add a mono_debug_lookup_source_location_by_il () helper function to lookup a source location using an IL offset.

* [mixed] Add support for mixed mode managed stack walks.

* [interp] Generate line number info for interpreted code, using the same MonoDebugMethodJitInfo structure used by the JIT.

* [interp] Pass the clause index to the MINT_ENDFINALLY opcode. Not yet used.

* [interp] Create a MonoJitInfo structure for each interpreted method. Not yet used.

* [interp] Add a mono_interp_set_resume_state () function which can be used to set the frame/ip the interpreter will resume execution from when execution returns to it.

* [mixed] Add support for mixed mode exception handling by extending the normal JIT exception handling code in mini-exceptions.c to handle interpreted frames as well.

* [jit] Add an Unwinder type to reduce the amount of code duplication when unwinding though interpreter frames.

* [interp] Fix the !ENABLE_INTERPRETER build.

* [interp] Disable an assert which is hit even when running without --interpreter.

* Fix a comment.

* [interp] Fix an assertion. Fix/add comments.
2017-05-03 00:45:59 -04:00
Aleksey Kliger (λgeek) b89cb75d02 [loader] Add a few Framework Facades assemblies (#4784)
that were previously missing, or mislabeled as ordinary framework assemblies.
2017-05-03 01:01:28 +02:00
Alexis Christoforides 1207564519 [MacSDK] Add 'csc' (Roslyn compiler) to whitelist 2017-05-02 13:10:19 -04:00
Rodrigo Kumpera 897fb5025a [jit] Move memcpy and memset emmiters to new file called memory-access.c 2017-05-01 13:50:22 -07:00
Rodrigo Kumpera 509763cebe [mini] Rename & expose a few functions to mini.h.
This adds to mini.h & fixes naming of the following functions:
	emit_get_gsharedvt_info_klass
	mono_emit_calli
	get_memcpy_method
	get_memset_method
	emit_memory_barrier
	emit_runtime_constant
	mini_class_check_context_used
	mono_emit_wb_aware_memcpy
	emit_write_barrier

Those functions will be used later by the memory access functions to be extracted out of method-to-ir.c
2017-05-01 13:14:37 -07:00
Alexander Köplinger 137e1e75d1 [ci] Output nunit xml if "verify" test step fails
Allows us to better catch this on Jenkins.
2017-04-29 23:43:53 +02:00
Alexander Köplinger c38becfba1 [ci] Don't fail when setting GitHub status doesn't work 2017-04-29 23:17:27 +02:00
monojenkins 3e46fb402b [msvc] Update csproj files (#4776) 2017-04-29 18:35:42 +02:00
Aleksey Kliger (λgeek) 00efe86cd3 Merge pull request #4767 from lambdageek/bug-55681
[sre-save] Handle ConstructorBuilder custom attribute constructors
2017-04-28 17:44:27 -04:00
Aleksey Kliger (λgeek) fe79b8de83 Merge pull request #4759 from lambdageek/flags-strict-strong-names
Put strict strong name checking behind a configure flag and runtime option
2017-04-28 17:43:50 -04:00
Bernhard Urban 4312802ba7 [interp] implement MONO_JIT_{AT,DE}TACH, so native2managed wrappers can be handled by the interpreter 2017-04-28 20:52:06 +02:00
Bernhard Urban b9043ed64c [interp] implement CEE_MONO_{TLS,ATOMIC_STORE_I4}
so we can execute the alloc wrapper
2017-04-28 20:52:06 +02:00
Bernhard Urban 1982951c60 [interp] remove ves_exec_method_with_context_with_ip, othwerwise we end up having to native frames for each managed frame in the debugger
and that's annoying.
2017-04-28 20:52:06 +02:00
Bernhard Urban c2e47804fa [tests] print seed
I've seen this test failing on CI with --interpreter, can't reproduce it
though.  Next time it would be nice to see the used seed.
2017-04-28 20:52:06 +02:00
Bernhard Urban 341c0782e9 [interp] enable a couple delegate tests on CI 2017-04-28 20:52:06 +02:00
Bernhard Urban c26a8bbb74 [interp] testcase for static field stuff 2017-04-28 20:52:06 +02:00
Bernhard Urban 722ddbf451 [interp] resolve MonoClass and MonoClassField from image like we do in mini 2017-04-28 20:52:06 +02:00
Bernhard Urban 1f7386bd86 [interp] resolve right class for valuetype 2017-04-28 20:52:06 +02:00
Bernhard Urban 3ac455390e [interp] check for pending exceptions after icall 2017-04-28 20:52:06 +02:00
Bernhard Urban a402abe0c6 [interp] let JIT handle native2managed wrappers, but hack around dynamic methods 2017-04-28 20:52:06 +02:00
Bernhard Urban dd945c7ca5 [interp] add stelem.u2 2017-04-28 20:52:06 +02:00
Bernhard Urban fe9b9619fc [interp] move interp_init call so embedders don't have to call it explicitly 2017-04-28 20:52:06 +02:00
Alexander Köplinger 0ea0f84a0d [bcl] Add API diff targets (#4406)
With these targets we can generate a snapshot of the current
Mono API in C# source code form.

Whenever we make changes, we can rerun this to ensure we didn't
inadvertently change the public API.

It also outputs a diff in html form that we can show on CI.
2017-04-28 20:28:32 +02:00
monojenkins 41739fb3e5 [msvc] Update csproj files (#4772) 2017-04-28 19:59:53 +02:00
Rodrigo Kumpera 594719dbf2 Merge pull request #4771 from mono/revert-4765-master
Revert "[jit] Fix memory leak in trampoline info registration."
2017-04-28 09:25:54 -07:00
Rodrigo Kumpera 13db722d6f Revert "[jit] Fix memory leak in trampoline info registration." 2017-04-28 09:25:36 -07:00
Rodrigo Kumpera a4eb5c2f91 Merge pull request #4765 from vkargov/master
[jit] Fix memory leak in trampoline info registration.
2017-04-28 09:24:56 -07:00
Alexander Köplinger a5c47a0894 [System.Data] Add InvalidUdtException back
It was accidentally removed in 2729605554.
2017-04-28 17:00:31 +02:00
Aleksey Kliger 76689aab4a [sre-save] Handle ConstructorBuilder custom attribute constructors.
The code expected that a custom attribute was specified as a MonoCMethod and
was calling mono_image_create_token().  However that function expects to be
called from the managed S.R.E.ModuleBuilder:GetToken (MemberInfo) which handles
all the builders in managed code.  Consequently mono_image_create_token () was
asserting.

So now we encode the token for a ConstructorBuilder in place.
2017-04-28 10:11:21 -04:00
Aleksey Kliger 5857790608 [sre] Make mono_image_get_methodref_token non-static in sre-internals.h 2017-04-28 10:11:20 -04:00
Dean Ellis 59737b2a47 [mkbundle] Add support for generating monodroid compatible mkbundle code at runtime (#4728)
monodroid used to build its own version of mkbundle since it
requires slightly different code than the desktop. This
logic was protected in a #if block. Now that monodroid is
trying to make use of the shipped mkbundle rather than use
its own we need to turn this logic on at runtime.

A new parameter has been added

	--bundled-header

When this option is passed, the code which skips including

	mono/metadata/mono-config.h

will be skipped in favour of defining the required structures
and entry points directly.
2017-04-28 13:18:29 +02:00
Marek Safar 2d964d860c [System.Reflection.DispatchProxy] Move to facades to support _._ nugets 2017-04-28 10:54:22 +02:00
Marek Safar f69b00568f [Facades] Update version numbers 2017-04-28 10:54:22 +02:00
Marek Safar 41a4bda979 [corlib] Add new types 2017-04-28 10:53:15 +02:00
Marek Safar 5730b425b3 Bump corert 2017-04-28 10:53:15 +02:00
Aleksey Kliger e45b8b2f4f [test] Regression tests for ConstructorBuilder custom attributes
Regression tests for https://bugzilla.xamarin.com/show_bug.cgi?id=55681
2017-04-27 17:58:07 -04:00
Marek Safar 414e74bb4c Bump corefx 2017-04-27 23:38:57 +02:00
Vladimir Kargov 7b3f134caa [jit] Fix memory leak in trampoline info registration. 2017-04-27 13:14:13 -07:00
Martin Baulig 618f75ffe7 [System]: Cleanup internal TLS Provider registration. (#4758)
* [System]: Cleanup internal TLS Provider registration.

Merge MonoTlsProviderFactory.Apple.cs and MonoTlsProviderFactory.Droid.cs
into MonoTlsProviderFactory.cs.

Disable the dynamic reflection-load on mobile while still keeping the
registration, so we can use IsSupported() and friends.

* Make it build.
2017-04-27 14:36:41 -04:00
Alexis Christoforides 37e4a78fb7 Bump bockbuild 2017-04-27 13:06:29 -04:00
monojenkins 915441ac03 [msvc] Update csproj files (#4763) 2017-04-27 18:25:53 +02:00
Alexis Christoforides 06657dc387 [MacSDK] Update F# -> 4.1.8 2017-04-27 11:32:24 -04:00
Alexis Christoforides f61b6ce5ab [MacSDK] Use msbuild's install script instead of duplicating it here 2017-04-27 11:17:59 -04:00
Alexis Christoforides 7a1a832f65 [MacSDK] Minor corrections on package's postinstall script 2017-04-27 11:13:50 -04:00
Johan Lorensson f75e5b4bc3 Merge pull request #4716 from Unity-Technologies/eglib-msvc-targets
Separate the eglib source and build instructions
2017-04-27 14:50:30 +02:00
Zoltan Varga 0b9bbcc7b2 [simd] Add support for Vector.IsHardwareAccelerated in the System.Numerics.Vectors assembly as well. Fixes #55577. (#4762) 2017-04-27 14:19:46 +02:00
Zoltan Varga 10d334b8c6 [runtime] Add a variant of mono_string_new_wrapper () and use it from marshalling code to avoid asserting when encountering invalid strings. (#4753) 2017-04-27 04:46:48 -04:00
Marek Safar 8e22402bfa Fixes build 2017-04-27 10:23:16 +02:00
Marek Safar c0929c34e0 [Facades] Move more asseblies to Facades to support implicit reference for _._ like nugets and ignore version mismatch 2017-04-27 09:23:30 +02:00
Aleksey Kliger 9e967f00b3 [loader] Rename enable-minimal=assembly_remapping to desktop_loader
Use a single DISABLE_DESKTOP_LOADER define instead of
DISABLE_ASSEMBLY_REMAPPING and DISABLE_STRICT_STRONG_NAMES
2017-04-26 19:38:34 -04:00
Aleksey Kliger 8532b7d59b Revert "[assembly] Add Facades dir to default_path on all runtimes"
This reverts commit d7e3698dbc.
2017-04-26 19:09:47 -04:00
Aleksey Kliger 5dd2290ef2 [runtime] Add --assembly-loader=[strict,legacy] runtime argument
If mono is compiled without DISABLE_STRICT_STRONG_NAMES, but someone passes
--assembly-loader=legacy at runtime, give them the lax strong name
checking behavior (a candidate assembly is good as long as the name is right, but ignoring
the public key token and version).
2017-04-26 19:09:45 -04:00
Aleksey Kliger 0d920026b5 [loader] --enable-minimal=assembly_remapping implies no strict strong name checking
When strict strong name checking is enabled, Mono will check public key tokens
and versions match between a requested assembly reference and a candidate found
via its usual loading directories.

amend
2017-04-26 19:09:05 -04:00
Martin Baulig 5e08742b5c [System]: Fix bug #52508 in HttpListener when doing multiple Https request.
Move the call to SslStream.AuthenticateAsServer() into the constructor because
we don't want to call it again when Init() is called from Close().
2017-04-26 18:54:27 -04:00
Martin Baulig 427cc60438 Revert changes that I accidentally pushed on top of PR #4756. 2017-04-26 17:21:21 -04:00
Martin Baulig cb885fe3e0 [Mono.Security.Interface]: Improve synergy between SslStream and IMonoSslStream (#4756)
* [Mono.Security.Interface]: Improve synergy between `MonoTlsProvider`, `SslStream` and `IMonoSslStream`.

* Add `IMonoSslStream.SslStream` property; the `IMonoSslStream` is now only created my the `SslStream`
  constructor, so `SslStream` "owns" the `IMonoSslStream`.

* Add internal `MonoTlsProvider.CreateSslStreamInternal()`.

* `SslStream` does not need to implement any additional interfaces; we can do without after
   getting rid of the wrapper classes.

* Add internal `SslStream.CreateMonoSslStream(Stream,bool,MonoTlsProvider,MonoTlsSettings)`.

* `MonoTlsProvider.CreateSslStream()` implementations should use this new method.

* Remove ancient obsolete MonoTlsProviderFactory APIs.

* `HttpListener` and `HttpConnection` now use `SslStream` instead of `IMonoSslStream`.

* [System]: Cleanup internal TLS Provider registration.

* Make it build.
2017-04-26 17:15:37 -04:00
Joshua Peterson 22b6b95814 Define HAVE_STRUCT_SOCKADDR_IN6 on Windows (#4755)
This enables IPv6 support on Windows.
2017-04-26 20:25:53 +02:00
Martin Baulig 00ef68347f [Mono.Security.Interface]: Add MonoTlsProviderFactory.GetMonoSslStream(HttpListenerContext). (#4749)
* [System]: Cleanup 'SECURITY_DEP' conditionals in the internal TLS code.

* [System]: Remove 'Mono.Net.Security.IMonoSslStream'; use 'Mono.Security.Interface.IMonoSslStream' instead.

* [System]: Remove 'Mono.Net.Security.IMonoTlsProvider'; use 'Mono.Security.Interface.MonoTlsProvider' instead.

* [System]: Cleanup internal TLS code.

* [Mono.Security]: Add MonoTlsProviderFactory.GetSslStream(HttpListenerContext).

* [System]: `SslStream' should not implement any additional interfaces.
2017-04-26 10:29:36 -04:00
Manuel de la Pena 8b35ee7237 Make changes as per review to make the code more thread safe. 2017-04-26 14:46:37 +02:00
Manuel de la Pena 390e75170b Ensure that when an async read is performed on a response content the
errors are correctly dealt with.

Some network errors in iOS are exposed as Stream errors, specially those
related with the lost of the connection. This patch ensures that if such
an issue happens an exception is raised in the async read task.

Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=53792
2017-04-26 14:46:37 +02:00
Aleksey Kliger (λgeek) 25bcd22d15 Merge pull request #4730 from lambdageek/facades-and-bug-580
* Check strong names on a couple more codepaths during assembly loading.  Fixes [bugzilla #580](https://bugzilla.xamarin.com/show_bug.cgi?id=580) and [bugzilla #55436](https://bugzilla.xamarin.com/show_bug.cgi?id=55436)
* Add `--apply-bindings=FILE` option.  Allows us to specify a configuration file for assembly binding redirections when AOTing.
* Use the above flag when AOTing `System.ReflectionMetadata.dll` to pick up `csc.exe.config`
* Add all the Facades to the `framework_assemblies` list in the runtime.  Facade and non-Facade framework assemblies behave differently:
  * for Facades, don't do any version remapping, and any version is okay.
  * for non-Facades, consult the version map to remap depdending on the --runtime used.
2017-04-25 18:15:50 -04:00
Andi McClure 8cad881e13 Merge pull request #4745 from xmcclure/ipv6-cleanup
Fix some style issues introduced by PR#4720
2017-04-25 16:52:46 -04:00
Aleksey Kliger c629125a1d [man] Document --apply-bindings=FILE option 2017-04-25 15:25:53 -04:00
Aleksey Kliger d7e3698dbc [assembly] Add Facades dir to default_path on all runtimes
Previous it was just the desktop runtime, but now that we have special handling
for framework facade assemblies in the loader, we should do it on other
runtimes, too.
2017-04-25 15:25:52 -04:00
Aleksey Kliger 96afbd04c4 [roslyn] Pass --apply-bindings=$(csc_exe).config when AOT-ing System.Reflection.Metadata
To pick up assembly binding redirections from csc.exe.config
2017-04-25 15:25:44 -04:00
Aleksey Kliger 24acd0ff82 [assembly] Add Facades to framework_assemblies list 2017-04-25 15:25:43 -04:00
Aleksey Kliger 1c63fceb42 [assembly] When loading framework facade assemblies, any version is ok in mono_assembly_candidate_predicate_sn_same_name
As long as the name and public key token matches.

This is different from the non-facade framework assemblies for which the
name and version must match but the public key token is ignored.
2017-04-25 15:25:41 -04:00
Aleksey Kliger 2a1bce7fef [assembly] add ANAME_EQ_IGNORE_VERSION flag to assembly_names_equal_flags() 2017-04-25 15:25:40 -04:00
Aleksey Kliger cf31c4eed1 [aot] Add --apply-bindings=FILE option
Apply bindings from configuration file FILE when running the AOT compiler.

This is useful if you need to AOT a module bar.dll that is loaded when the main
assembly foo.exe has a configuration file foo.exe.config that specifies
assembly bindings that bar.dll should respect.
2017-04-25 15:25:29 -04:00
Aleksey Kliger 397de9a6b0 [domain] Factor out mono_domain_parse_assembly_bindings
Move to a separate function the code that parses assembly bindings from a configuration file.
2017-04-25 14:40:37 -04:00
monojenkins 0a9422abed [msvc] Update csproj files 2017-04-25 18:33:23 +02:00
Marek Safar 08c7d3c120 Remove unused facade 2017-04-25 18:00:41 +02:00
Josh Peterson 9454206b34 Make the filters file match the targets files
* Create one filters file for each targets file
* Import each filters file into the project-level filters file
* Add folders for Common, Win32, and Posix targets files
2017-04-25 11:58:23 -04:00
Aleksey Kliger 2e95286e4d [loader] Pass sn_same_name predicate when loading from basedir and from default_path, too.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=580
2017-04-25 11:22:57 -04:00
Marek Safar a2c9df5617 [System.Diagnostics.Tracing] Don't generate empty debyg symbols 2017-04-25 17:00:26 +02:00
Marek Safar 29340d4df3 [System.Data.Common] Add IDbColumnSchemaGenerator 2017-04-25 17:00:26 +02:00
Marek Safar 07b8eaa68f [Facades] Don't build debug symbols for System.Net.Sockets 2017-04-25 17:00:26 +02:00
Andi McClure 7bc0e0cdd7 Fix some style issues introduced by PR#4720
Existing code in this file mixing ifdefs with if {} else {} places the ifdef after the } but before the else.
2017-04-25 10:31:55 -04:00
Andi McClure ec380c722e Merge pull request #4720 from Unity-Technologies/config-checks-ipv6
Add autoconf checks for platforms without IPv6
2017-04-25 10:20:18 -04:00
Joshua Peterson 3e6c4f5264 Merge branch 'master' into config-checks-ipv6 2017-04-25 09:28:15 -04:00
Zoltan Varga 6a91ef1ac3 [jit] Remove some debug spew. 2017-04-25 05:10:14 -04:00
Marek Safar 2729605554 Bump corefx 2017-04-25 09:09:50 +02:00
Zoltan Varga 8e5124c890 [runtime] Add explicit (float) casts to test_0_float_precision () to make the test work when compiled with csc /O. 2017-04-24 19:14:41 -04:00
Andi McClure 45d90b20b7 Merge pull request #4710 from Unity-Technologies/additional-config-checks
Add #ifdef checks for code that might not exist
2017-04-24 16:23:52 -04:00
Marek Safar 0bc9c95a14 [build] Fixes setup for libraries without sources 2017-04-24 19:42:51 +02:00
monojenkins 562e261f3a [msvc] Update csproj files (#4740) 2017-04-24 18:31:11 +02:00
Zoltan Varga f15b1a5233 [cil-stripper] Mark stripped methods as noinline to prevent the JIT from trying to inline them. Fixes #55041. (#4732) 2017-04-24 12:21:27 -04:00
Vlad Brezae fafdb46e13 Merge pull request #4727 from BrzVlad/fix-xamarin-studio
[metadata] Fix special static field access
2017-04-24 18:37:00 +03:00
Alexander Köplinger 27fd8e5ad8 [Facades] Use Open.snk for netstandard.dll
We were using the wrong key since dotnet/standard switched to using the new Open key.
2017-04-24 16:24:49 +02:00
Josh Peterson 0c20ba842f Separate the eglib source and build instructions
This change extracts the eglib source files from the build instuctions
for builds via MSVC on Windows. It also separates the source files into
platform-specific and common .targets files. This provides more
flexibility for builds from MSVC in a few important ways:

1. We can do MSVC-based builds for platforms that will not be pushed to
public repos by checking out the Mono code externally and importing the
.targets files into a custom .vcxproj for the platform.
2. We can replace the platform specific .targets files with a custom set
of source files to implement a different platform abstraction layer
that will not be public without the need to merge changes to the
.vcxproj from the public repo.

This allows for ease of synchronizing changes to the public Mono
repo with private forks, while _not_ changing the behavior of the code
in the public repo.
2017-04-24 10:08:33 -04:00
Marek Safar bf6b05b0a3 [System] UriBuilder from corefx 2017-04-24 13:21:52 +02:00
Marek Safar 6784c6120f Bump Roslyn to 2.1 2017-04-24 12:38:52 +02:00
Rodrigo Kumpera cfeac85100 [corlib] Use AppContextSwitches implementation from RS. Fixes #54448 (#4682) 2017-04-24 10:20:20 +02:00
Zoltan Varga 1debf39341 Make the loading of llvm EH info async safe. (#4725)
* [aot] Emit class references in EH info in such as way that they can be skipped when reading them in async context.

* [aot] Rewrite the LLVM EH info loading code by moving allocations to callers so the lower level code is async safe.

* [aot] Make the memory allocation in the loading of llvm EH info async safe. Remove fields from MonoLLVMFDEInfo which are passed as parameters.

* [runtime] Add the ability to store the unwind info address/length in the MonoJitInfo structure instead of referencing it using the 'unwind_info' field.

* [aot] Make the loading of llvm EH information async safe.
2017-04-23 19:16:49 -04:00
Marek Safar 2cb98cb8ed [mdoc] Integrate api-doc-tools version 2017-04-23 13:50:48 +02:00
Zoltan Varga b21c70ff49 [runtime] Disable some tests in full-aot mode which cannot be AOTed because of type loading errors. 2017-04-22 19:06:36 -04:00
Vlad Brezae b1360afe0a [metadata] Lock around special static fields hash access
If a type is loaded in another thread, the fields hash can get resized, leading to failure.
2017-04-22 02:30:23 +03:00
Vlad Brezae 00c6a94a9c [amd64] Make inline function in header static
This was actually failing the osx build for me, probably due to symbol conflicts.
2017-04-22 02:30:23 +03:00
Vlad Brezae 3d1b921a19 [metadata] Don't use static_data_array
Memory allocated with mono_gc_alloc_fixed is uncollectable both on sgen and boehm. This array serves no other purpose. It should probably be killed entirely, but it's part of the API.
2017-04-22 02:30:20 +03:00
Rodrigo Kumpera e9518198e5 Merge pull request #4701 from kumpera/jit_improvements
[JIT] Last two optimizations to Roslyn.
2017-04-21 17:03:35 -04:00
Aleksey Kliger (λgeek) a1cabeee67 Merge pull request #4723 from lambdageek/bug-54485
[metadata] expand uninstantiated generic type definitions used as generic type args
2017-04-21 16:26:39 -04:00
Aleksey Kliger ee13c84852 [metadata] If a GTD appears uninstantiated in a generic instantiation argument,
replace it by its canonical open instantiation.

If we have
```
  class Foo<A,B,C> { ... }
  class Bar<T,U> { ... }
```

Then if someone tries to construct `Bar<Foo, int>` (or more precisely, the
MonoGenericInst corresponding to `<Foo, int>` instead return `Bar< Foo<A,B,C>, int >`.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=54485
2017-04-20 18:58:31 -04:00
Aleksey Kliger 7111c840b9 [metadata] Add a canonical_inst MonoType to MonoClassGtd
The canonical instantiation of a generic type definition is the open
instantiation where the GTD is applied to its own generic parameters in order.

Suppose we have `class T<A,B> { ... }` then the canonical instantiation is just "T<A,B>".
2017-04-20 18:58:29 -04:00
Matthew Leibowitz 7e2571ed33 [Mono.Options] CommandSet and PCL/NetStandard Support (#4719)
When `PCL` is defined, the intent is that the resulting
`Mono.Options.dll` assembly will be usable on all PCL profiles.
This includes "silly" profiles such as Profile259, which lacks the
`System.Console` type, meaning e.g. `Console.Out` doesn't exist.

Unfortunately, the
`CommandSet(string, Converter<string, string, TextWriter, TextWriter)`
constructor would use `Console.Out` and `Console.Error` when the
`TextWriter` parameters were `null`, meaning this constructor can't
be provided for all PCL profiles.

Altering the constructor to instead use `TextWriter.Null` would allow
the constructor to be provided, but would be a *worse* experience,
IMHO: anybody (everybody!) expecting the default values to
"do something useful" will be sorely disappointed, as output and
error messages would instead be dropped. :-(

Instead, remove this constructor:

	public CommandSet (string suite, MessageLocalizerConverter localizer = null, TextWriter output = null, TextWriter error = null);

and replace it with these *two* constructors:

	public CommandSet (string suite, MessageLocalizerConverter localizer = null)
	public CommandSet (string suite, TextWriter output, TextWriter error, MessageLocalizerConverter localizer = null)

The first constructor, which accepts no `TextWriter` parameters, is
only provided in non-PCL builds, allowing it to use `Console.Out`.

The second constructor is available in PCL profiles, and *requires*
that `output` and `error` be non-`null`.

Documentation has been updated accordingly.
2017-04-20 16:28:05 -04:00
Aleksey Kliger 247e158bf4 [tests] System.Type.MakeGenericType with a GTD as argument
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=54485
2017-04-19 16:21:51 -04:00
Alexander Kyte ca2292b6c2 Merge pull request #4722 from alexanderkyte/checked_after
[scripts] Don't build in checked mode
2017-04-19 15:47:14 -04:00
Alexander Köplinger fd41560563 Fix README.md to show correct values for --with-libgc
External boehm is no longer supported.
2017-04-19 21:18:43 +02:00
Alexander Köplinger ceabda8a54 [corlib/System.Data] Test fixes for xammac 4.5 and watchos
The TrimSpecial() method and Windows-specific code was removed from
xammac 4.5 so reflection can't find it anymore, handle this case.

Also add a workaround for SqlParameterCollectionTest.CopyToTest()
which fails on watchos since the SqlCommand would throw a PNSE.
It's a workaround because it just makes the test ignored since we don't
set the env var that ConnectionManager.Instance.Sql reads in XI tests,
but it makes the test consistent with the other tests in the suite.
We should fix this properly later on.
2017-04-19 21:08:52 +02:00
Josh Peterson b83d6e717d Add #ifdef checks for code that might not exist
* Some platforms don't support these features, so guard them.
* For platforms that do support them, no changes should occur.
2017-04-19 14:25:12 -04:00
monojenkins 4472be61f0 [msvc] Update csproj files 2017-04-19 19:03:39 +02:00
Alexander Kyte 1138466b13 [scripts] Don't build in checked mode 2017-04-19 12:57:51 -04:00
Josh Peterson 32451337b0 Add autoconf checks for platforms without IPv6
* There is an existing check for the `sockaddr_in6` struct.
* Use it to wrap code that implements IPv6.
* This makes porting to platforms that don't support IPv6 easier.
* It should have no impact on platforms that do support IPv6.
2017-04-19 11:24:39 -04:00
Alexander Köplinger f11c25c426 [System.Data] Call SqlConnection.ClearAllPools() only when we had a connection
When ConnectionManager.Instance.Sql.ConnectionString throws in
SetUp() we'd still call SqlConnection.ClearAllPools() in the TearDown()
which happens for example when the connection string environment
variable is not set.

This is a problem on WatchOS since SqlConnection.ClearAllPools()
throws PlatformNotSupportedException there, making the tests fail.
Instead we now check whether the connectionString is set and only
call the method in that case.
2017-04-19 14:40:10 +02:00
Marek Safar 1a77e8727c Bump cecil 2017-04-19 11:59:07 +02:00
Mikayla Hutchinson 0db4d85147 Fix RemoteEndpoint with async+DualMode (#4717) 2017-04-19 11:48:41 +02:00
Marek Safar 92fa05e67f [Mono.CSharp] Fixes parallel build 2017-04-19 08:33:44 +02:00
Zoltan Varga faa5384be5 [runtime] Shadow copy the .pdb files as well. Fixes #55095. (#4715) 2017-04-18 22:31:14 -04:00
Alexander Köplinger 5c75d264a8 [System] Don't include AlsaDevice on xammac_net_4_5
(cherry picked from commit 79ad720d5d)
2017-04-18 23:11:23 +02:00
Rodrigo Kumpera a8d9e343c6 [runtime] Forgot to update strelemref_wrapper_name with the new wrapper type. 2017-04-18 13:05:22 -07:00
Marek Safar 87b7b97e0d [Mono.CSharp] Fixes parallel build 2017-04-18 20:06:24 +02:00
Andi McClure eb602f66dc Merge pull request #4708 from xmcclure/orbis-system-net
Minor orbis fix in System.Net
2017-04-18 14:05:16 -04:00
Zoltan Varga 8d7c83a277 [jit] Disable handler block trampolines+aot support on ios, it does an async stack walk, and the eh info for llvm compiled methods cannot be loaded in async context currently. Works around #54658. (#4713) 2017-04-18 14:03:55 -04:00
Alexander Köplinger 856377a61d [configure] Fix docs for --with-libgc option (#4707)
It was renamed from --with-gc to --with-libgc in 66ca91f10b,
but a few places were missed.
2017-04-18 19:41:13 +02:00
monojenkins 000e598f31 [msvc] Update csproj files (#4711) 2017-04-18 19:20:51 +02:00
Alexander Kyte b4df5611cb Merge pull request #4712 from alexanderkyte/master-circular-fix
[runtime] Fix circular types in SRE
2017-04-18 13:01:27 -04:00
Alexander Kyte a8dfce5466 [runtime] Handle circular references in SRE types
We previously recursed through the entire directed cyclic graph
of the type passed to SRE. When given a (legal) circular type reference,
we encountered stack overflows. This was particularly easy to trigger
with fsharpi and with FAKE.

By creating everything about the type before searching for the parent,
and by defering all type hierarchy establishment until the type must be
surfaced to manage code, we tease out the data dependencies caught up in
the cycle.

Note the bounded lifetime of the unmanaged object hidden in the SRE
module, which acts as a global reference for all types reachable from
the TypeBuilder passed to the runtime through the icall.
2017-04-18 11:33:16 -04:00
Alexander Kyte db95a04065 [runtime] Test circular references in SRE 2017-04-18 11:30:05 -04:00
Andi McClure 60ffbfb725 Minor orbis fix in System.Net 2017-04-18 11:09:28 -04:00
Alexander Köplinger 20e00bd15b Bump nuget-buildtasks 2017-04-18 13:52:23 +02:00
Marek Safar 5f94a10a06 [runtime] Blacklist System.Threading.Overlapped nugets 2017-04-18 13:49:05 +02:00
Ankit Jain e54ce145ea Update nuget-buildtasks from upstream's dev15.1 branch (#4703)
* Update nuget-buildtasks from upstream's `dev15.1` branch

dev15.1 branch + fixup import paths

This was prompted by needing to support nuget restore for projects with
`PackageReference`.

* [nuget] Bump reference to NuGet.BuildTasks to pick up a build fix
2017-04-18 13:17:07 +02:00
Bill Holmes fdfa4b94bb Remove the use of ExpectedException in Mono.Posix Tests (#4698)
* Remove the use of ExpectedException in Mono.Posix Tests

ExpectedException is not available in later versions of
NUnit.  To test the NetCore 2.0 version of Mono.Posix I
need a newer version of NUnit that does not contain ExpectedException.

Using Assert.Throws should be equivalent.

* Mono.Posix Tests move CanUseRealTimeSignals checks

Moving the CanUseRealTimeSignals check outside of the
Assert.Throws callback function.

This is a change in test behavior requested by @akoeplinger
in the PR review.

* Fixing Mono.Posix.UnixSignalTest.TestSignumPropertyThrows

This test throws InvalidOperationException and we need to check
for that in the Assert.Throws type.
2017-04-18 12:59:56 +02:00
Mikayla Hutchinson 8d12608cca Add System.Net.Http 4.3.1 to blacklist 2017-04-18 10:54:53 +02:00
Marek Safar 66d32a0271 [corlib] Fixes static builds (#4687)
* [corlib] Fixes static builds
2017-04-18 10:03:29 +02:00
Julius Vitkauskas 372f28339f Place break inside if block 2017-04-18 09:53:34 +02:00
David Karlaš 00efc0305a Bug 55148 - Debugger checks type which is possibly never used (#4690) 2017-04-18 01:35:23 -04:00
Rodrigo Kumpera 53914b88bb [JIT/GC] Optimize mono_gc_wbarrier_value_copy_bitmap.
mono_gc_wbarrier_value_copy_bitmap shown up when profiling Roslyn and this PR applies the following set of optimizations to it:

- Drop the bitmap, the extra branch in the loop costs more than the extra cardtable store itself
- Rename it to mono_gc_wbarrier_range_copy to reflect its new meaning
- Remove the JIT wrapper, this function doesn't need it
- Use mono_gc_get_range_copy_func as a way to punch through all layers and get the actual implementation
- Move the implementation to sgen-cardtable.c where everything can be inlined
- Exploit the fact we only need to mark the first card of a given range and thus we can hoist the address calculation outside of the loop

All of this speeds up a microbenchmark by 2x and Roslyn wallclock by around 2%.
2017-04-17 15:51:33 -07:00
Rodrigo Kumpera 3ee037c830 [runtime] Optimize virtual_stelemref for classes even further.
This optimization exploits the fact that if the element type idepth is <= MONO_DEFAULT_SUPERTABLE_SIZE we can skip the idepth check.

This improves an array store only benchmark by 11%.

On Roslyn, all arrays falls into this case.
2017-04-17 13:48:43 -07:00
Aleksey Kliger bb293a828f [w32error] Fix g_error args in mono_w32error_unix_to_win32 2017-04-17 13:56:00 -04:00
Ankit Jain e83be97cb3 Empty commit to force a wrench build 2017-04-14 21:48:02 -04:00
Aleksey Kliger (λgeek) 9a21932f43 Merge pull request #4569 from lambdageek/dev-coop-handles-march
Misc coop handles work
2017-04-14 15:30:53 -04:00
Martin Baulig 93c02cfd32 [appletls]: Disable the new keychain code on XI. (#4695)
(cherry picked from commit b6255d35cd)
2017-04-14 14:51:55 -04:00
Ludovic Henry 52b00f2922 [WebConnection] Fix race condition between Close and BeginWrite (#4693)
* [WebConnection] Make ReadDone and InitRead instance methods to avoid passing cnc around

* [WebConnection] Inline only call to InitConnection

* [WebConnection] Fix race condition between Close and BeginWrite
2017-04-14 14:51:42 -04:00
monojenkins 462834e6ea [msvc] Update csproj files (#4696) 2017-04-14 19:12:35 +02:00
Aleksey Kliger a7141c23ff [custom-attrs] Use coop handles for mono_reflection_get_custom_attrs_info_checked
* use handles in icalls
  - ves_icall_MonoCustomAttrs_GetCustomAttributesDataInternal
  - ves_icall_MonoCustomAttrs_GetCustomAttributesInternal
2017-04-14 10:59:26 -04:00
Aleksey Kliger 2eebae392b [reflection] Move mono_reflection_type_get_handle to sre-internals.h
It's basically deprecated and only use in reflection until reflection is
converted to use handles.
2017-04-14 10:59:26 -04:00
Aleksey Kliger 46e7189c12 [custom-attrs] Rename custom_attrs_defined_internal to ves_icall_MonoCustomAttrs_IsDefinedInternal
and use coop handles.
2017-04-14 10:59:26 -04:00
Aleksey Kliger 2087bd22c5 [remoting] Use coop handles for S.R.Remoting.Contexts.Context.{Register,Release}Context
* ves_icall_System_Runtime_Remoting_Contexts_Context_RegisterContext
* ves_icall_System_Runtime_Remoting_Contexts_Context_ReleaseContext

Added new mono_threads_{register,release}_app_context to be used internally in
the runtime.
2017-04-14 10:59:25 -04:00
Aleksey Kliger 0256888233 [runtime] Use coop handles for ves_icall_System_AppDomain_DoUnhandledException 2017-04-14 10:59:25 -04:00
Aleksey Kliger 2ed750a887 [domain] Mark mono_context_set external only
runtime should use mono_context_set_handle
2017-04-14 10:59:25 -04:00
Aleksey Kliger 6b11f950e5 [remoting] Move mono_context_{get,set} icall registration to remoting
It was previously in marshal
2017-04-14 10:59:25 -04:00
Aleksey Kliger a5cea12cb3 [domain] Use handles for MonoAppContext icalls
* ves_icall_System_AppDomain_InternalGetContext
* ves_icall_System_AppDomain_InternalGetDefaultContext
* ves_icall_System_AppDomain_InternalSetContext
2017-04-14 10:59:25 -04:00
Aleksey Kliger e1626a41ea [reflection] Use coop handles for MonoEventInfo.get_event_info 2017-04-14 10:59:24 -04:00
Marek Safar e146a9e9ca Bump CoreRT 2017-04-14 09:18:16 +02:00
Zoltan Varga bc93e7fbe4 [runtime] Avoid freeing a string passed to mono_mb_emit_exception_full (), it doesn't assume ownership of it. Fixes random wrench failures after 91ae166406. 2017-04-13 17:11:34 -04:00
Alexander Köplinger 2f34c3325d Revert "[acceptance-tests] Disable a regressed coreclr test"
This reverts commit 5e8012a678.

The bug was fixed.
2017-04-13 22:46:05 +02:00
Zoltan Varga e9f54cb051 [jit] Make newarr [void] unverified. Fixes #55083. 2017-04-13 16:40:48 -04:00
Aleksey Kliger (λgeek) 5d72ee7c92 Merge pull request #4680 from lambdageek/bug-49721-take2
[loader] Ignore public key token in strong name match, if requested framework assembly was remapped
2017-04-13 14:27:02 -04:00
Martin Baulig d8ce8b81c3 [btls]: Cleanup certificate store initialization (#4683)
* [BTLS]: Cleanup certificate store initialization.

* Kill unused MonoBtlsX509Store.AddTrustedRoots().

* In server-mode, MonoBtlsProvider.SetupCertificateStore() now only adds
  certificates explicitly trused via MonoTlsSettings.TrustAnchors.

* MonoTlsProvider.ValidateCertificate() - which is called from
  X509Certificate2.Verify() via X509CertificateImplBtls.Verify() - now
  uses MonoTlsSettings.DefaultSettings and assumes client-mode.

* [appletls]: Actually use the new code that was added in PR #4671.

* [btls]: Add new MonoTlsSettings.CertificateValidationTime property.

This allows you to set a custom time for certificate expiration checks.

* [appletls]: Bind SecTrustSetVerifyDate() and check MonoTlsSettings.CertificateValidationTime.
2017-04-13 13:46:54 -04:00
Alexander Köplinger 84b7714ba6 Fix check for file in gensources.sh
It didn't correctly check whether the file exists so we got
"tail: no such file or directory" messages during the build.
2017-04-13 19:15:37 +02:00
Zoltan Varga 4cf2b5feee [runtime] Fix some small domain related memory leaks. (#4685) 2017-04-13 12:16:24 -04:00
Marek Safar c2169c0121 [System.Core][System.ComponentModel.DataAnnotations] Update strings 2017-04-13 17:04:40 +02:00
Rodrigo Kumpera c7dfe96397 Merge pull request #4675 from kumpera/runtime-scalability-take1
[runtime] Reduce contention on some top locks when running Roslyn.
2017-04-12 16:01:36 -07:00
Martin Baulig 169ab664c7 [appletls]: Actually use the new code that was added in PR #4671. 2017-04-12 17:13:06 -04:00
Alexander Kyte 91ae166406 Merge pull request #4615 from alexanderkyte/string_error_handling
[runtime] Don't discard string conversion errors
2017-04-12 15:47:39 -04:00
Zoltan Varga 3aaacc57b0 [ppdb] Fix a crash if mono_ppdb_get_seq_points () is only passed a 'source_file' argument. 2017-04-12 15:16:13 -04:00
monojenkins b09b3689f2 [msvc] Update csproj files 2017-04-12 18:53:10 +02:00
Aleksey Kliger 177b2e1913 [loader] Ignore public key token in strong name match, if requested framework assembly was remapped
When framework assemblies are compiled for the mobile runtime, they are
generally signed with a different key than the normal desktop one.
Unfortunately each assembly has different logic for which key is
used (typically silverlight.pub or corefx.pub in place of ecma.pub), and short
of hardcoding a table in the runtime, there's no good way to know.
2017-04-12 12:43:27 -04:00
Aleksey Kliger b7fff94589 [assembly] Add option to ignore public key tokens when comparing MonoAssemblyNames 2017-04-12 12:43:26 -04:00
Aleksey Kliger 68720076b1 Revert "[loader] Remap public key tokens of framework assemblies when running with --runtime=mobile"
This reverts commit af7195e349.
2017-04-12 12:43:26 -04:00
Alexander Köplinger 5e8012a678 [acceptance-tests] Disable a regressed coreclr test
I filed a tracking bug.
2017-04-12 15:00:11 +02:00
Vlad Brezae ea56fb0847 Merge pull request #4670 from BrzVlad/fix-sgen-testing
[tests] sgen testing tweaks
2017-04-12 03:54:08 +03:00
Vlad Brezae dac191e4e3 [tests] Improve configurations of sgen tests
Main pointers :
 - explicit minor and bridge configuration (add some for missing major)
 - reduce duplicated testing or of low relevance (like split nursery)
 - intensive testing of latest new configurations combined (parallel minor + major + future experiments)
 - include testing with a small and a large nursery for additional variance
2017-04-12 03:51:52 +03:00
Vlad Brezae 6fa9160954 [tests] Add timeout limits to some longer sgen tests 2017-04-12 03:51:50 +03:00
Rodrigo Kumpera 30de1a50a6 [loader] Make MonoImageSet::gclass_cache concurrent. 2017-04-11 16:03:24 -07:00
Rodrigo Kumpera 834460c91d [loader] Move typespec_cache to a lock-free-reads hashtable. 2017-04-11 16:03:18 -07:00
Rodrigo Kumpera a701179293 [loader] Add a lock-free cache in front of get_image_set. Doesn't override on fetch, maybe needs tweaking? 2017-04-11 16:02:00 -07:00
Rodrigo Kumpera 66454b1a50 Merge pull request #4673 from kumpera/fix_stdelem_ref_perf
[runtime] Fix get_virtual_stelemref_wrapper STELEMREF_CLASS case to actually do the base class check.
2017-04-11 18:07:56 -04:00
Martin Baulig 1eb27c1df8 [appletls]: Use SecIdentityCreate() to avoid using the Mac keychain. (#4671)
* [appletls]: Use SecIdentityCreate() to avoid using the Mac keychain when we have a private key.

Reading Certificates from the Mac Keychain
==========================================

Reading the private key from the keychain is a new feature introduced with
AppleTls on XamMac and iOS. On Desktop Mono, this new feature has several
known issues and it also did not received any testing yet. We go back to the old
way of doing things, which is to explicitly provide an X509Certificate2 with a
private key.

Keychain Dialog Popups
======================

When using Xamarin.Mac or Xamarin.iOS, we try to search the keychain
for the certificate and private key.

On Xamarin.iOS, this is easy because each app has its own keychain.

On Xamarin.Mac, the .app package needs to be trusted via code-sign
to get permission to access the user's keychain. [FIXME: I still have to
research how to actually do that.] Without this, you will get a popup
message each time, asking you whether you want to allow the app to access
the keychain, but you can make these go away by selecting "Trust always".

On Desktop Mono, this is problematic because selecting "Trust always"
give the 'mono' binary (and thus everything you'll ever run with Mono)
permission to retrieve the private key from the keychain.

This code would also trigger constant keychain popup messages,
which could only be suppressed by granting full trust. It also makes it
impossible to run Mono in headless mode.

SecIdentityCreate
=================

To avoid these problems, we are currently using an undocumented API
called SecIdentityRef() to avoid using the Mac keychain whenever a
X509Certificate2 with a private key is used.

On iOS and XamMac, you can still provide the X509Certificate without
a private key - in this case, a keychain search will be performed (and you
may get a popup message on XamMac).
2017-04-11 17:43:51 -04:00
Rodrigo Kumpera 65f260675e [runtime] Fix get_virtual_stelemref_wrapper STELEMREF_CLASS case to actually do the base class check.
The code was bailing straight to native which is significantly slower. This is the result of roslyn compiling corlib on my machine:

Before:
real	0m5.757s
user	0m22.059s
sys	0m1.736s

After:
real	0m5.816s
user	0m23.623s
sys	0m1.693s
2017-04-11 11:36:49 -07:00
Alexander Köplinger 1c987f5bd0 [netstandard] Remove System.ArgIterator from facade
It was removed today: https://github.com/dotnet/standard/commit/52651e78ac329c56fb59cebf5b24174f25acb070
2017-04-11 20:23:26 +02:00
Alexander Köplinger a0d6c26a04 [Facades] Build netstandard.dll by default (#4501)
Added a new EXTERNAL_FACADE_DRAWING_REFERENCE variable which
specifies the path to an assembly that contains drawing types,
e.g. in the monotouch/monodroid case System.Drawing is built
inside the XI/XA repos.

Also update netstandard typeforwards to the latest version
from the dotnet/standard repo.
2017-04-11 20:18:55 +02:00
monojenkins 07bf83dd61 [msvc] Update csproj files 2017-04-11 19:15:50 +02:00
Rodrigo Kumpera 5548745ffa Merge pull request #4116 from kumpera/jit-job-control
[mini] Introduce job control to the JIT. Limits by active and duplicate jobs.
2017-04-11 10:13:38 -07:00
Zoltan Varga 9556be1f23 [arm] Fix a gsharedvt assertion which happens with gsharedvt methods with a lot of arguments. Fixes #54976. 2017-04-11 11:51:53 -04:00
Marek Safar afb392a079 Update README.Mono.md 2017-04-11 16:36:11 +02:00
Marek Safar 6efe816846 Readme rename 2017-04-11 14:00:15 +02:00
Marek Safar 07adebd8bf Updates referencesource to .NET 4.7 2017-04-11 12:25:37 +02:00
Alexander Köplinger 9635b9cea0 [resgen] Remove dependency on WinForms and use it in mobile profiles (#4667)
resgen.exe used to load WinForms via reflection which is a pretty
large dependency. Instead we can just embed the few types that
are used for reading/writing resx files directly into the app.

Add System.Drawing.dll to the "build" profile so we can put
resgen there as well and allow us to no longer rely on system
resgen for mobile profiles like monotouch/monodroid.
2017-04-10 20:15:34 +02:00
monojenkins e0c31c054c [msvc] Update csproj files (#4669) 2017-04-10 18:48:21 +02:00
Marek Safar a9dc556d0a [corlib] Deconstruct api from corert 2017-04-10 14:46:52 +02:00
Marek Safar 2e2698a6e3 Bump corert 2017-04-10 14:46:52 +02:00
Marek Safar 7b3c907796 [corlib] Add few checks for array boxing conversion of pointer types 2017-04-10 14:46:52 +02:00
Marek Safar 8b7a2ebc53 [corlib] Share corert Array code 2017-04-10 14:46:52 +02:00
Vlad Brezae 31c446a1ac [tests] Bump timeouts on sgen tests
Tests that have been known to regularly fail in the past.
2017-04-10 15:22:49 +03:00
Zoltan Varga 0ed43bba73 [arm64] Add a test file for codegen macros. Not used. 2017-04-09 19:00:04 -04:00
Ludovic Henry 4b9235f567 [tests] Make stress testing more verbose (#4664) 2017-04-07 20:56:59 -04:00
Rodrigo Kumpera f57f188d5e [mini] Fix spurious wakeups within JIT job control.
The first iteration of this code suffered from spurious wakeups due to using a single cond-var for all compilation.

This introduce a per-job cond var and make threads wait on that. Spurious wakeups are quite problematic in heavily threaded
code such as Roslyn. On average, every wait would get 2 extra wakeups for no good reason.

With this change, on my laptop compilation times are the following:

With spurious wakeups:
real	0m6.134s
user	0m23.588s
sys	0m2.331s

Without spurious wakeups:
real	0m5.658s
user	0m22.851s
sys	0m1.694s

This represents a 8% wallclock speedup and 3% user time speedup.

As part of this change, the active threads accounting is gone as the number of waits due to cpu overload was close to zero.
2017-04-07 15:55:43 -07:00
Andi McClure f64c3798c8 Merge pull request #4660 from xmcclure/llvm-orbis
LLVM Orbis support
2017-04-07 16:16:23 -04:00
Andi McClure f922e1e565 LLVM: Orbis support, fix typo in configure.ac 2017-04-07 16:12:58 -04:00
jmserrano 393c357c53 Fix bug in SessionStateModule when session data is deleted 2017-04-07 22:07:01 +02:00
Alexander Köplinger 13f5db4888 [Facades] Add facades to winaot/orbis profiles (#4656)
Also remove Mono.Simd as we don't it on new platforms.

Cleanup monotouch_dirs to not depend on testing_aot_full_dirs since
it should be separate (even though it contains the same right now).
2017-04-07 20:05:34 +02:00
Andi McClure 8ed730958d Merge pull request #4663 from xmcclure/bump-linker
Bump linker external to its master
2017-04-07 13:47:16 -04:00
Alexander Köplinger f9e4ca356a [bcl] Add check for newline to gensources.sh (#4662)
This has bitten us a bunch of times now so let's make sure
it doesn't happen again.
2017-04-07 18:07:52 +02:00
Andi McClure edf9f452e5 Bump linker external to its master 2017-04-07 11:42:00 -04:00
Alexander Köplinger 47ca0c0ae8 Make sure .sources files end with newline
It confuses the build on Linux otherwise.
2017-04-07 14:50:16 +02:00
Marek Safar 082daa04df Bump corert 2017-04-07 08:52:28 +02:00
Zoltan Varga 8c7e025342 [arm] Commit the generated arm_dpimacros.h/arm_vfpmacros.h files, they change very infrequently, and having to generate them complicates the cross compiler/offsets tool build. (#4655) 2017-04-07 00:44:23 -04:00
Rodrigo Kumpera 5289e52104 Remove debug fflush and fix active_jit_methods accounting in case of recursion. 2017-04-06 18:43:04 -07:00
Zoltan Varga 891b90b9d8 [runtime] Update the offsets tool to a new version of CppSharp and use 64 bit binaries on osx. (#4659) 2017-04-06 21:09:17 -04:00
Rodrigo Kumpera 43d66ff4d8 Fix compilation issues. 2017-04-06 16:09:00 -07:00
Rodrigo Kumpera 9b97962a04 [mini] Introduce job control to the JIT. Limits by active and duplicate jobs.
This shown up as a problem under parallel roslyn.

We hit frequently the case of multiple threads compiling the same method in parallel
and wasting all but one.

Another issue that happens, but infrequently, is having more threads JITing than there
are cores in the machine. Such thrashing doesn't help.

Test setup. 4/8 macbook pro compiling corlib.

Baseline:
real	0m7.665s
user	0m20.078s
sys	0m2.653s
Methods JITted using mono JIT       : 22422
Total time spent JITting (sec)      : 18.5365

With this patch:
real	0m6.149s
user	0m18.504s
sys	0m1.487s
Methods JITted using mono JIT       : 16619
Total time spent JITting (sec)      : 4.9420

New counters
JIT compile waited others           : 7681
JIT compile 1+ jobs                 : 1
JIT compile overload wait           : 67
JIT compile spurious wakeups        : 14469

This results in a 20% wall clock reduction but only a 8% reduction on user.

We JIT 26% less methods, with very few duplications. Showing this drastically improves the situation.

JIT compilation time metrics are bogus due to .cctors and other sources of interference. So take it with a grain of salt.

Future work:

Based on the new counters, it's clear that the current wakeup design is suboptimal and we could further improve it by cutting on spurious wakeups.
2017-04-06 16:09:00 -07:00
Vincent Povirk c66af2563e [tests] Fix out of tree build. (#4657) 2017-04-07 00:08:18 +02:00
Ludovic Henry e0fe955483 [tests] Add stress testing and reduce sgen normal testing time (#4653)
* [tests] Keep testing even if a test has failed

* [tests] Add stress testing and reduce sgen normal testing time
2017-04-06 14:49:04 -04:00
Zoltan Varga a762f83e13 [jit] Only free the unwind info inside a MonoTrampInfo if its owned by the structure. 2017-04-06 13:21:38 -04:00
Alexander Köplinger c0c41be207 [tools] Remove old msbuild experiment
This is just confusing now that we have the real thing.
2017-04-06 09:16:08 +02:00
Rolf Bjarne Kvinge e3f6365d8b [runtime] Free leaked variable. (#4643) 2017-04-05 23:06:58 -04:00
Zoltan Varga 9302c31f81 [aot] Print JIT failures without having to pass an additional option. (#4648) 2017-04-05 23:06:47 -04:00
Rodrigo Kumpera 8df83179b6 Merge pull request #4612 from kumpera/android-changes-part2
Fix Android compilation and some tests
2017-04-05 16:59:08 -07:00
Ludovic Henry ef42d89ffc [tests] Rework how we AOT compile tests + General cleanup of make targets (#4639) 2017-04-05 19:54:49 -04:00
Rodrigo Kumpera ce4063f14f [runtime] Don't return the modules for the current process when pid != getpid (). 2017-04-05 14:18:26 -07:00
Rodrigo Kumpera 3a49748b76 [System] Disable test that is too unreliable. 2017-04-05 14:18:26 -07:00
Rodrigo Kumpera 9092eac2ea Improve test assert. 2017-04-05 14:18:26 -07:00
Rodrigo Kumpera 1fb2ab2244 [System] Disable a few tests that don't work on Android. 2017-04-05 14:18:26 -07:00
Rodrigo Kumpera ddcd1adb73 [System] Disable test that doesn't work on Android. 2017-04-05 14:18:26 -07:00
Rodrigo Kumpera 65ea950e30 [io-layer] Don't RC std handles or the current process on every lookup.
Caller don't expect those lookups to be RC'd so they don't compensate. This leads to unbound growth of their ref count, which eventually overflows.
2017-04-05 14:18:26 -07:00
Rodrigo Kumpera cbe527afce [runtime] When looking up the process name, don't bail out if you can't load its modules.
Loading modules for other processes can fail under some linux sandboxing rules but that doesn't mean
we should not be able to compute the process name. So when module == NULL, we make module loading non-fatal.
2017-04-05 14:18:25 -07:00
Rodrigo Kumpera 276b0a9940 [runtime] Improve tracing of process name lookup functions. 2017-04-05 14:18:25 -07:00
Rodrigo Kumpera 2cca55ee73 [runtime] Fix compilation under Android 2017-04-05 14:18:25 -07:00
Zoltan Varga dddf0d8ea0 [jit] Fix a leak in the trampoline info registration code. (#4646) 2017-04-05 16:23:15 -04:00
Bernhard Urban e3d9aad2a3 [interp] testcase for stack overflow on tail recursion opt
inspired by

./mcs/mcs/assign.cs:
SimpleAssign:CheckEqualAssign ()
2017-04-05 20:41:05 +02:00
Bernhard Urban 406c1d25ad [interp] fix stack overflow on tail recursion 2017-04-05 20:41:05 +02:00
Bernhard Urban 8b58ce4ce3 [interp] fix stack alloc size 2017-04-05 20:41:05 +02:00
monojenkins 5624d0d2ca [msvc] Update csproj files (#4645) 2017-04-05 18:42:25 +02:00
Egor Bogatov 11789c98ce [System.Data] Fix Azure SQL specific issues (ProviderTests) (#4622)
* [System.Data] Fix Azure SQL specific issues (ProviderTests)

* [System.Data] ChangeDatabase - Azure specific test

* [System.Data] SqlConnectionTest: use Assert.Throws instead
2017-04-05 15:12:21 +02:00
Marek Safar 59bbb688a5 [Facades] Add forwarder for DbDataReaderExtensions 2017-04-05 10:03:02 +02:00
monojenkins 6ed5db6dc8 [msvc] Update csproj files 2017-04-05 09:10:15 +02:00
Alexander Köplinger 3bfff911dd [tests] Fix the mcs-compileall target in runtime/ (#4637)
It is used as the "verify" step on Jenkins/Wrench and I noticed
it didn't run recently.

Looks like it was broken a while ago by 695e8f53ae.
Moving the verifiable_files variable at the top is wrong since
the $$profile variable is only defined inside the for loop and
so we'd get an empty list.

When that was fixed it still didn't work as piping to `echo`
doesn't work. Replaced it with a Makefile solution instead.
2017-04-05 03:34:23 +02:00
Vlad Brezae a9b5b501fd Merge pull request #4630 from BrzVlad/feature-valloc-limit
[sgen] OOM testing
2017-04-05 02:52:03 +03:00
Vlad Brezae e2b4f546cf [runtime] Add arch size InterlockedAdd 2017-04-05 01:16:47 +03:00
Vlad Brezae decbfc3e73 [sgen] Add old forgotten oom tests to sgen oom suite 2017-04-05 01:16:47 +03:00
Vlad Brezae c67775554f [sgen] Add oom testing suite 2017-04-05 01:16:46 +03:00
Vlad Brezae 2842685613 [sgen] Don't pass gc options to the test-runner
Also remove some plain configurations (in the tests we should explicitly select the major)
2017-04-05 01:16:42 +03:00
Vlad Brezae 1b6292607c Merge pull request #4618 from BrzVlad/feature-par-nrs
[sgen] Parallel nursery collections
2017-04-05 01:13:00 +03:00
Martin Baulig 989aefce37 [appletls]: Make CFObject.dlsym() private and fix CFBoolean. (#4640)
This fixes a native crash when attempting to use appletls.
2017-04-04 14:28:17 -04:00
Vlad Brezae b388646ad0 [sgen] Split up concurrent sweep from worker logic
While this was ok because workers and sweep could not run at the same time, this is no longer the case with parallel nursery collections. In the future, if many threads will be required for different types of jobs, we can consider running them on same native thread, but the jobs will still need to have appropriate contexts (the SgenThreadPool they belong to).
2017-04-04 16:00:06 +03:00
Vlad Brezae 5d80d08b8c [sgen] Increase gray stack section size
Stealing a gray section is relatively expensive since it requires locking. We want to avoid repeated stealing, since only one gray queue section is stolen at a time (in the case of the parallel collector).
2017-04-04 16:00:06 +03:00
Vlad Brezae 6c62196f5c [sgen] Increase parallelization of minors 2017-04-04 16:00:05 +03:00
Vlad Brezae 8bc93c4b39 [sgen] Parallel nursery collections
Scans the card table and the roots on the workers, including draining the stack.
2017-04-04 16:00:04 +03:00
Michael DeRoy 47ca2c886d Fix mono_marshal_alloc to accept gsize instead of gulong(unsigned long) (#4623)
* Fix mono_marshal_alloc to accept gsize instead of platform dependent unsigned long

* fix header
2017-04-04 08:20:13 -04:00
Marek Safar 6706cae9a2 [System.Core] Linker friendly test update 2017-04-04 10:50:56 +02:00
Marek Safar 305b77c1fe [Facades] Fixes System.Threading.Overlapped 2017-04-04 10:04:48 +02:00
Marek Safar 19c8fad57b [System.Core] Remove duplicate files 2017-04-04 09:40:16 +02:00
Marek Safar 2742838b12 Bump cecil 2017-04-04 09:12:51 +02:00
Marek Safar 74770d3768 [corlib] Port more of corert array 2017-04-04 08:40:42 +02:00
Zoltan Varga 3a37fbaa0b [llvm] Add sign extensions for the index register used during bounds checks and array address calculations. (#4636) 2017-04-03 17:23:26 -04:00
Andi McClure bc7bb8ef59 Merge pull request #4635 from xmcclure/5.3-bump
Bump master to 5.3 due to creation of 2017-04 branch
2017-04-03 15:21:51 -04:00
Zoltan Varga 786f289e00 [jit] Fix a regression caused by 399f6e2425. Avoid a crash if MONO_VERBOS_METHOD is used. 2017-04-03 15:01:28 -04:00
Andi McClure c5aa6d1494 Bump to 5.3 due to creation of 2017-04 branch 2017-04-03 13:18:02 -04:00
Zoltan Varga 1a5dbe063a [jit] Fix the casting between arrays with bounds and vectors even for special cased types like object[]. Fixes #54212. (#4633) 2017-04-03 12:22:58 -04:00
Francois Botha 41fe812a81 Correctly detect relative Uri in package parts (#3630) 2017-04-03 16:48:34 +02:00
Zoltan Varga ce2a8fcad1 [runtime] Default Interface Method support (#4625)
* [runtime] Add support for the simplest case of default interfaces, where the default method is used.

* [runtime] Implement overriding of default interface methods in interfaces.

* [jit] Fix gshared support for default interface methods, they require an mrgctx since the this argument doesn't point to the implementing class, not the interface.
2017-04-03 10:42:07 -04:00
Andi McClure 0568203e32 Merge pull request #4628 from xmcclure/orbis-profile
Platform support fixes
2017-03-31 16:14:47 -04:00
Zoltan Varga 17f001214e [jit] Fix the ppc build. 2017-03-31 15:56:21 -04:00
Alexander Köplinger 500765a5d3 Make monolite profile directory versioned (#4631)
If you're building with monolite currently the build system
checks for the existence of mcs/class/lib/monolite and just
uses it in that case.

It becomes a problem when bumping corlib version since if you
pull the update and try to build it'll use the old monolite
and you'll hit the "corlib version not in sync" error.

By making the monolite directory include the version this can
be avoided and everything works out of the box.

Also removed the confusing "You need Mono version 4.8 or better"
message since we actually require a newer version in
basic-profile-check.cs now and keeping them in sync is error prone.
2017-03-31 19:51:10 +02:00
monojenkins 8dba6fc778 [msvc] Update csproj files (#4632) 2017-03-31 19:50:48 +02:00
Andi McClure bebbf5134d Style fixes for PR feedback 2017-03-31 11:53:53 -04:00
Michael DeRoy d95cc551df change icall to use gsize as well 2017-03-31 09:47:57 -04:00
Vlad Brezae fd5089b471 [sgen] Add debug option for valloc limit
This allows us to stress test OOM inside sgen (and potentially other areas).
2017-03-31 15:17:53 +03:00
Marek Safar b34ad6d930 [System] Fixes build 2017-03-31 13:31:34 +02:00
Alexander Köplinger 6f1d247060 Fix Windows build 2017-03-31 02:35:19 +02:00
monojenkins 8e59eaa046 [msvc] Update csproj files (#4624) 2017-03-31 02:03:41 +02:00
Alexander Kyte f704d56c37 Merge pull request #4621 from alexanderkyte/strdup_env
[runtime] Switch getenv to use heap memory
2017-03-30 18:17:29 -04:00
Andi McClure 41a4e6b63a Add System.Security.dll to orbis profile 2017-03-30 17:57:07 -04:00
Andi McClure 40ded2b552 More platform support fixes
- Support platforms without mkdtemp
- Fix compile for console-null.c
2017-03-30 17:57:06 -04:00
Andi McClure 2ffb9a35a7 Combined cherrypick of changes between mono-4.8.0-branch and orbis-branch-30
ORBIS #ifdefs in BCL, exclude several files and assembly directories
from the orbis build, HAVE_LOCALTIME_R define in C.
2017-03-30 17:57:00 -04:00
Vlad Brezae 7a04c99af1 [sgen] Emit fast inline wbarrier instead of the wrapper one
Which seems to be about 4 times slower than the inline one.
2017-03-30 17:37:52 -04:00
Bernhard Urban 222df67b5f [interp] basic filter clause support 2017-03-30 15:16:17 -04:00
Alexander Kyte 399f6e2425 [runtime] Switch getenv to use heap memory
Getenv doesn't use heap memory, it uses static memory.
Mono's usage is consistent with a view of getenv memory contents
that are durable and can be stored and manipulated.

In a multithreaded context, getenv calls can race and corrupt
string buffers as they are read. In a single threaded context,
subsequent calls to getenv will lead to overwriting the memory
that pointers to previous calls point to.

In order to bring memory safety back, we duplicate memory and
manage it at each call-site.

Note: this changes the API semantics of g_getenv. This is necessary
because the locking around the getenv buffer is safest when confined to
the function in eglib.
2017-03-30 13:58:10 -04:00
Mikayla Hutchinson 1688f5d0c6 [System.Web] Implement HostingEnvironment.QueueBackgroundWorkItem
From reference source.

This is required for the Azure Functions Host to run unmodified.
2017-03-30 19:05:04 +02:00
Alexander Köplinger feff7ee306 Bring in the new reference assemblies (#4619)
This bumps the reference assemblies submodule so we can install
the new assemblies which are built from source.
2017-03-30 17:02:10 +02:00
Alexander Kyte 53811fb124 [runtime] Fix typo in icall name (#4616) 2017-03-30 08:39:05 -04:00
Zoltan Varga 45837e1a5a Add beginnings of mixed code execution support (#4613)
* [interp] Fix a few problems exposed by the iltests.exe test suite.

The ENDFINALLY opcode should empty the stack. The INITBLK opcode is two bytes.

* [interp] Store the MonoMethod->RuntimeMethod mapping in a separate hash in MonoJitDomainInfo instead of using MonoDomain.jit_code_hash, the latter contains MonoMethod->MonoJitInfo mappings. Also avoid holding the domain lock while creating the RuntimeMethod structure.

* [interp] Add a mono_jit_compile_method_jit_only () function which always compiles its argument using the JIT/AOT.

* [interp] Print a warning when --interpreter is used with a runtime compiled without ENABLE_INTERPRETER.

* [interp] Fix the size of the icall enter trampoline on amd64. Fix some formatting issues.

* [interp] Add support for calling JITted code from the interpreter. This uses the gsharedvt_out wrappers used by bitcode to reduce the number of possible calling conventions since all arguments and the return value are passed/returned by value. Not enabled yet.

* [interp] Add a --interp= argument which allows passing of options to the interpreter. Add a 'jit=' option which is used to control the set of types whose methods will be called by exiting the interpreter.

* [interp] Add tests for mixed mode execution.

* [interp] Add support for calling interpreter code from JITted code.

* [interp] add mixedmode target to CI

* Revert a debug change.

* [runtime] Fix the locking in the gsharedvt/interp wrapper creation functions.

* [interp] Implement support for interp->jit calls with more than 8 arguments.
2017-03-30 07:32:44 -04:00
Marek Safar dba0a9c566 [System] WebSockets from corefx 2017-03-30 13:24:56 +02:00
Vlad Brezae 31434d52b3 [sgen] Remove CARDTABLE_STATS
For dirty card counts we already have heavy counters. For card table scan time we already have the binary protocol which has more flexibility.
2017-03-30 14:13:24 +03:00
Vlad Brezae 335828b3e3 [sgen] Make sure workers don't have evacuating blocks on the free-lists
Double copying of an object during a collection is not allowed. If we allocate from an evacuating block this can happen.
2017-03-30 14:13:24 +03:00
Vlad Brezae 358039d9eb [sgen] Blocks on the freelist don't need to have been swept 2017-03-30 14:13:24 +03:00
Vlad Brezae e0067a1201 [sgen] Shutdown thread pool worker even if it's not active 2017-03-30 14:13:24 +03:00
Vlad Brezae 772573f370 [sgen] Don't use workers during finishing pause if we're not parallel
Worker can be used though to drain the gray stack of workers after a forced finish (at the start of the finishing pause).
2017-03-30 14:13:24 +03:00
Vlad Brezae eee846a77f [sgen] Add scan/copy context for the simple parallel nursery 2017-03-30 14:13:24 +03:00
Vlad Brezae ba6c07c49c [sgen] Add option for parallel nursery collector 2017-03-30 14:13:24 +03:00
Zoltan Varga dd08fd4160 [bcl] Avoid waiting for events inside a finalizer in Process.WaitForExit () because it can hang if the thread which sets the event is aborted during shutdown. Fixes #53843. (#4609) (#4617) 2017-03-29 21:42:01 -04:00
Alexander Kyte dcdfb3c500 [runtime] Don't discard string conversion errors 2017-03-29 15:45:55 -04:00
monojenkins bcefc71078 [msvc] Update csproj files 2017-03-29 18:29:22 +02:00
Rodrigo Kumpera 2099acf5f4 Merge pull request #4540 from kumpera/android-changes-part1
[bcl+runtime] Multiple small cleanups to Android.
2017-03-29 11:46:29 -04:00
Marek Safar 2c542fdc1b [tools] Remove unused sources 2017-03-29 12:12:09 +02:00
Zoltan Varga b17b5f38d6 [jit] Cleanup the signature of the mono_arch_get_static_rgctx_trampoline () function. (#4605)
Remove the unused MonoMethod argument, and rename the 'mrgctx' argument to 'arg', since it can be any value, not just
an mrgctx.
2017-03-29 05:38:30 -04:00
Marek Safar 25765e8d97 Bump cecil 2017-03-29 10:25:11 +02:00
Marek Safar e7a5ef4aeb Bump corefx 2017-03-29 09:28:14 +02:00
Zoltan Varga d189c74fa7 [jit] Add ref types to mini_get_underlying_type (), use it to simplify the switch loops in the jit. (#4606) 2017-03-28 20:17:31 -04:00
Ludovic Henry a9e73e7370 [threadpool] Pass callback at initialization (#4546)
This remove the possibility to execute different callbacks on the threadpool, but this allows us to remove the work_items_lock, which is called on the hot path of the ThreadPool.
2017-03-28 17:03:31 -04:00
monojenkins ea954f481b [msvc] Update csproj files 2017-03-28 22:17:12 +02:00
Andi McClure 897ecfd59c Merge pull request #4168 from xmcclure/aot-man
Correctly document --aot options in man page
2017-03-28 14:14:08 -04:00
Andi McClure d417b6d7dc Remove 'experimental' label from full/hybrid AOT in manpage 2017-03-28 14:08:04 -04:00
Andi McClure 2d4106dd06 Correctly document --aot options in man page
- Ensure all AOT options are both documented and listed in
  alphabetical order in both the manpage and --help line
- Ensure all exceptoins are commented in the aot-compiler.c source
  with "intentionally udnocumented"
2017-03-28 14:08:00 -04:00
Marek Safar 200dff9cd1 [mono] Remove unused icall 2017-03-28 18:28:41 +02:00
Miguel de Icaza cefa02738c Update copyright years 2017-03-28 11:18:43 -04:00
Rolf Bjarne Kvinge 7e24a650a8 [corlib] Add back X509 support for watchOS.
Otherwise we'd be regressing existing (and working) behavior.
2017-03-28 11:19:20 +02:00
Chris Hamons a2083326f5 Disable a few x509 tests that fail on older macOS
- Handles https://bugzilla.xamarin.com/show_bug.cgi?id=53958
- https://bugzilla.xamarin.com/show_bug.cgi?id=53689 is filed to turn them
  back on later with a better version check
- SecCertificateCreateWithData handles invalid arguments differently based on
  macOS version
2017-03-27 23:59:32 +02:00
Marek Safar a2ec6eb28e [corlib] Add more Array tests 2017-03-27 23:36:35 +02:00
Marek Safar 778388f9ee [System.Windows.Forms] Fixes DataGridViewColumnCollection comparer not to return 1 on match 2017-03-27 23:36:35 +02:00
Marek Safar 62385ee390 [System.Windows.Forms] Imrove DataGridViewColumnCollectionTest 2017-03-27 23:36:35 +02:00
Marek Safar 75eacd49ae [corlib] Use array managed parts from corert to fix bugs in sorting and arguments checking. Fixes #53196 and similar 2017-03-27 23:36:35 +02:00
Marek Safar 42aafd4c01 Bump corert 2017-03-27 23:36:35 +02:00
Marek Safar bf52e31dc2 [corlib] Fix RegistryKeyTest cleanup 2017-03-27 23:36:35 +02:00
Andi McClure 68c053315e Merge pull request #4594 from lambdageek/bug-53890
[remoting] Pass correct object to invoke of IRemotingTypeInfo.CanCastTo
2017-03-27 15:15:26 -04:00
Johan Lorensson a3304910e9 Merge pull request #4570 from lateralusX/jlorenss/visual_studio_msbuild_fix
Windows msbuild triggers too much to rebuild.
2017-03-27 09:04:53 +02:00
Jb Evain 91c849e442 Add FieldInfoMirror.FullName (#4588) 2017-03-26 09:33:34 -04:00
Bernhard Urban 5a36c9f1fd [interp] call mono_unhandled_exception, so exit() is called with proper return code 2017-03-26 06:12:31 -04:00
Bernhard Urban c3194fdd4a [interp] enable more tests for CI 2017-03-26 06:12:31 -04:00
Bernhard Urban 232236bed7 [interp] support floating point in runtime_invoke 2017-03-26 06:12:31 -04:00
Bernhard Urban 87d566aa5a [interp] allow more gregs, enable pinvoke17.exe 2017-03-26 06:12:31 -04:00
Bernhard Urban 30d0db2e53 [interp] throw NRE in mint_strlen 2017-03-26 06:12:31 -04:00
Bernhard Urban d7b0d18bf0 [interp] add write barriers
issues found with
`MONO_GC_DEBUG=3,collect-before-allocs,check-remset-consistency ../mini/mono-sgen --interpreter /Users/bernhardu/work/mono/b/lib/mono/4.5/mcs.exe hello.cs`
2017-03-25 11:04:26 +01:00
Bernhard Urban 13f3aab33e [interp] respect reference type in stobj insn
stackval_from_data does everything for us.
2017-03-25 11:04:26 +01:00
Aleksey Kliger eeb5d4c670 [remoting] Pass correct object to invoke of IRemotingTypeInfo.CanCastTo
Pass the payload of the coop handle as the 'this' object, not the handle
itself.

Add asserts in ves_icall_Remoting_RealProxy_InternalGetProxyType that
remote_class and the proxy_class are non-NULL.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53890
2017-03-24 19:10:14 -04:00
Jon Purdy 17aa73d0ae [docs] Update formatting in mono-api-utils. 2017-03-24 13:43:07 -07:00
Jon Purdy 327ef5d7a5 [docs] Update formatting in mono-api-unsorted. 2017-03-24 13:43:07 -07:00
Jon Purdy a616c819ef [docs] Update formatting in mono-api-type. 2017-03-24 13:43:07 -07:00
Jon Purdy 8f0f3c934a [docs] Update formatting in mono-api-threads. 2017-03-24 13:43:07 -07:00
Jon Purdy 41bbde6add [docs] Update formatting in mono-api-string. 2017-03-24 13:43:07 -07:00
Jon Purdy 1c1a8550f3 [docs] Update formatting in mono-api-security. 2017-03-24 13:43:07 -07:00
Jon Purdy 171e74beab [docs] Update formatting in mono-api-reflection. 2017-03-24 13:43:07 -07:00
Jon Purdy 0cbf3e4a3c [docs] Update formatting in mono-api-profiler. 2017-03-24 13:43:07 -07:00
Jon Purdy dd398d3481 [docs] Update formatting in mono-api-object. 2017-03-24 13:43:07 -07:00
Jon Purdy 1a5a4384d2 [docs] Update formatting in mono-api-methods. 2017-03-24 13:43:07 -07:00
Jon Purdy e8ee7f1f1d [docs] Update formatting in mono-api-metadata. 2017-03-24 13:43:07 -07:00
Jon Purdy 2ab495d049 [docs] Update formatting in mono-api-jitinternal. 2017-03-24 13:43:07 -07:00
Jon Purdy 60c26e4dd9 [docs] Update formatting in mono-api-jit. 2017-03-24 13:43:07 -07:00
Jon Purdy 136f149c28 [docs] Update formatting in mono-api-internal. 2017-03-24 13:43:07 -07:00
Jon Purdy f76ffd46ce [docs] Update formatting in mono-api-image. 2017-03-24 13:43:07 -07:00
Jon Purdy 82a606c516 [docs] Update formatting in mono-api-gchandle. 2017-03-24 13:43:07 -07:00
Jon Purdy 61ccc132bc [docs] Update formatting in mono-api-gc. 2017-03-24 13:43:07 -07:00
Jon Purdy 8476f66ff2 [docs] Update formatting in mono-api-exc. 2017-03-24 13:43:07 -07:00
Jon Purdy 41f760c673 [docs] Update formatting in mono-api-embedding. 2017-03-24 13:43:07 -07:00
Jon Purdy cc0eb1b4cc [docs] Update formatting in mono-api-dynamic-codegen. 2017-03-24 13:43:07 -07:00
Jon Purdy 781e549c48 [docs] Update formatting in mono-api-domains. 2017-03-24 13:43:07 -07:00
Jon Purdy 4735975f0c [docs] Update formatting in mono-api-debug. 2017-03-24 13:43:07 -07:00
Jon Purdy c4597c7b8d [docs] Update formatting in mono-api-counters. 2017-03-24 13:43:07 -07:00
Jon Purdy 507c619003 [docs] Update formatting in mono-api-class. 2017-03-24 13:43:07 -07:00
Jon Purdy 1a2e6167f4 [docs] Update formatting in mono-api-class. 2017-03-24 13:43:07 -07:00
Jon Purdy 17fb976edf [docs] Update formatting in mono-api-assembly. 2017-03-24 13:43:07 -07:00
Jon Purdy fc5ed9af92 [exdoc] Enable formatting in deprecated annotations. 2017-03-24 13:43:07 -07:00
Jon Purdy 3478b0aa86 [exdoc] Handle punctuation better in code formatting. 2017-03-24 13:43:07 -07:00
Jon Purdy dce4401036 [docs] Use Doxygen syntax for Monodoc. 2017-03-24 13:43:07 -07:00
Jon Purdy b058816edd [exdoc] Update warnings. 2017-03-24 13:43:07 -07:00
Jon Purdy b8688a447f [exdoc] Support Doxygen syntax. 2017-03-24 13:43:07 -07:00
Jon Purdy c39797389a [docs] Fix exdoc warnings. 2017-03-24 13:43:07 -07:00
Jon Purdy 9cad7ff740 [exdoc] Refactor.
Avoid globals, use proper data structures instead of strings, and
produce some warnings for documentation errors.
2017-03-24 13:43:07 -07:00
Jon Purdy 747c9fdc79 [exdoc] Add missing dependency. 2017-03-24 13:43:07 -07:00
Jon Purdy 3830a53dc4 [exdoc] Enable 'warnings' and 'strict'. 2017-03-24 13:43:07 -07:00
Jon Purdy 85bd889b9f [exdoc] Fix whitespace. 2017-03-24 13:43:07 -07:00
Jon Purdy ffaa990747 [docs] Remove redundant filename. 2017-03-24 13:43:07 -07:00
Jon Purdy 4c5545630d [docs] Fix Doxygen errors.
Doxygen treats '@code' as the start of a '@code'...'@endcode' block, so
it raised spurious "reached end of file while inside code block" errors
when '@code' was used to denote a parameter. Change these instances to
'\param code' (declaration) and '\p code' (mention).
2017-03-24 13:43:07 -07:00
Jon Purdy a86062cef0 [docs] Enable documentation for utils. 2017-03-24 13:43:07 -07:00
Jon Purdy 580ccb1ffb [docs] Enable documentation for mini. 2017-03-24 13:43:07 -07:00
Jon Purdy 8cc92b3c9a [docs] Enable documentation for sgen. 2017-03-24 13:43:07 -07:00
Jon Purdy 648916b028 [docs] Enable documentation for metadata. 2017-03-24 13:43:07 -07:00
Jon Purdy c90f2f651f [docs] Improve Doxygen config. 2017-03-24 13:43:07 -07:00
Marek Safar 6fafd08b50 Revert "Update corefx"
This reverts commit 2a2c317d07.
2017-03-24 20:04:55 +01:00
Marek Safar cbc30eb58e [tests] Remove duplicate property 2017-03-24 20:04:51 +01:00
Andi McClure 752ae75341 Merge pull request #4590 from xmcclure/master
Improve "Could not resolve type with token" exception message
2017-03-24 14:42:43 -04:00
Andi McClure 3922cd7d77 Improve "Could not resolve type with token" exception message 2017-03-24 14:37:26 -04:00
Marek Safar 2a2c317d07 Update corefx 2017-03-24 19:36:23 +01:00
Marek Safar 8c9259e7e9 [mcs] Reset also all partial parts current-type 2017-03-24 15:37:20 +01:00
Vlad Brezae 3e7abade0e Merge pull request #4503 from BrzVlad/fix-appdomain-unload
[runtime] Fix abort issues
2017-03-24 16:21:30 +02:00
Miguel de Icaza 7a5658f388 A few fixes to the man page 2017-03-24 10:14:28 -04:00
Zoltan Varga ba36f4d622 [bcl] Add a finalizer to MemoryMappedFile. 2017-03-24 14:35:18 +01:00
Marek Safar 9e79e88494 [System.Data] Update tests for mobile profiles 2017-03-24 14:15:41 +01:00
Vlad Brezae 3bfd0fd2f8 [runtime] Don't reset abort exception in invoke wrapper
It leads to missing self aborts on full-aot.
2017-03-24 00:17:30 +02:00
Vlad Brezae d570afec5f [runtime] Improve debugging of thread interruptions 2017-03-23 23:46:27 +02:00
Vlad Brezae c4512332ed [runtime] Defer async requests during abort protected blocks
We avoid unnecessary checks for each interruption checkpoint.
2017-03-23 23:46:26 +02:00
Vlad Brezae 4d1c90a812 [runtime] Fix detecting abort at end of abort protected block
If we have a pending abort then we know we will have the thread_state set and the thread_interruption_requested bumped. We used to consume this request and set the MonoError with the exception. The problems with this is that not all callsites handle the passed MonoError and handling it means converting it back to a pending exception anyway. We just leave the interruption request untouched now.

If the cctor self aborts it means that we consumed the abort exception so we do need to call mono_thread_resume_interruption to reactivate it. We need to make sure that we still don't throw a TypeInitializationException if we had a self abort.
2017-03-23 23:46:23 +02:00
Martin Baulig 4638c98ba0 [AppleTls]: Use correct definition of SecTrustResult. (#4586)
* [AppleTls]: Use correct definition of `SecTrustResult`.

We need all the values in this enum because `SecTrustResult.Unspecified`
means success - which currently has an integer value of 4, not 0.

* Oops, make it build.

* Don't make it public.

* Revert whitespace change.
2017-03-23 16:29:47 -04:00
Andi McClure ce44460fc7 Bump version to 5.1.0 2017-03-23 16:29:06 -04:00
Filip Navara b9448d5320 Add test for AutomaticDecompression behaviour
Test that HttpWebRequest.AutomaticDecompression actually performs the
decompression and that it removes the Content-Encoding header. Also fix
the value of Content-Encoding for other tests to follow the HTTP
specification.
2017-03-23 19:30:57 +01:00
Filip Navara e6f020d390 Remove Content-Encoding header after doing automatic decompression
Match the .NET Framework behaviour by removing the Content-Encoding
header after doing automatic decompression.
2017-03-23 19:30:57 +01:00
monojenkins 5217f963e7 [msvc] Update csproj files 2017-03-23 17:27:08 +01:00
Aleksey Kliger 8435306c98 [reflection] Set correct reflected type in MonoMethod.get_base_method
It can be the case that we have two different System.MonoMethod objects that both
point to the same native MonoMethod* but have two different reflected types.
(For example if we call derivedType.GetMethod("f") where f is virtual and
derivedType corresponds to a class that did not override a base definition.  In
that case, the MonoMethod* corresponds to the parent type's f method, but the
reflected type is derivedType)

In this case, GetBaseDefinition will return the same MonoMethod* but the
reflected type of the result should be the base type, not the derived type.
2017-03-23 10:31:53 -04:00
Aleksey Kliger e461e9c6d2 [tests] Additional tests of System.Reflection.MethodInfo.GetBaseDefinition 2017-03-23 10:31:53 -04:00
Ludovic Henry 41d647d252 [threadpool-io] Ensure selector thread is running before waiting on it (#4572)
This could result in a unecessary wait on shutdown where the selector thread would have exited, and the finalizer thread would try to dispose a Socket, which would try to remove the socket from the IOSelector. This removal operation would wait on the selector thread to acknowledge the removal, but because the selector thread would have alreday exited, we would wait on an event that would never happen.
2017-03-23 10:09:33 -04:00
Andoni Morales Alastruey 25a5bedec1 [mkbundle] Use correctly link paths when loading assembly deps 2017-03-23 11:28:36 +01:00
Brian Raderman 70828363f1 invoke_array_extract_argument() will create objects and set them in the parameters array when it detects a null parameter, but when we return a by-value parameter may no longer be null, which is an error. This fix detects the change and sets the parameter back to null for by-value parameters before we return. 2017-03-23 11:19:56 +01:00
Adrian Cheng 45db742590 One brace missed 2017-03-23 11:18:56 +01:00
Adrian Cheng b6d57b4107 Clean unrelated changes left 2017-03-23 11:18:56 +01:00
Adrian Cheng bbdba7d191 Try hardly to fix the revert the style changes I made... 2017-03-23 11:18:56 +01:00
Adrian Cheng 90efacbec9 Put the spaces back before calling function and indexing to follow coding guidelins 2017-03-23 11:18:56 +01:00
Adrian Cheng 66f47e25e9 Change brace style to follow coding guidelines 2017-03-23 11:18:56 +01:00
Adrian Cheng 3e906acfe2 Replace whitespaces to 8-spaces tabs 2017-03-23 11:18:56 +01:00
Adrian Cheng 0014f68478 Fix Bug #40969 2017-03-23 11:18:56 +01:00
Marek Safar 123daf5e46 Bump cecil 2017-03-23 11:15:38 +01:00
Aaron Bockover 87bb2f5814 csharp: support command line arguments for scripts
This adds a command line argument preprocessor that splits command line
arguments into two groups, delimited by the "standard" `--` "stop
processing" argument, or by the `-s` argument which can be used with
Unix shebang syntax (where the path of the file being executed will
be appended to the command line specified on the shebang line).

- anything before `--` or `-s` will be passed to mcs/csharp as usual
- anything after `--` or `-s` will _not_ be processed by mcs/csharp,
  and will be made available in an `Args` builtin, like `csi`

This _finally_ (after almost 10 years) allows `csharp` to be used for
proper script authoring!

Document the new arguments in the man page. Also remove references to
'gsharp' from the man page.
2017-03-23 10:18:10 +01:00
Marek Safar 4ab98d81cd [System.Data] Fixes tests build with mobile profiles 2017-03-23 10:15:57 +01:00
Marek Safar 6393dc1926 [System.Configuration] Refactor InitForConfiguration to be readable 2017-03-23 07:54:01 +01:00
Vlad Brezae dba2b07309 [runtime] Fix missing abort during abort protected regions
When aborting a thread we set the thread's interruption request and we also increment the global interruption request. If we were trying to abort a thread when it is in an abort protected region, it will just set an interruption deferred and not do anything else (in async_abort_critical). When the thread exited the abort protected region, it was missing the abort request since we didn't increment the global interruption request.

Refactor thread_interruption_requested modifications, making sure we always bump it when requesting an interruption and decrease it when we clear an interruption.
2017-03-23 01:40:13 +02:00
Vlad Brezae 786cbe76a8 [runtime] Rework abort deferring
The problem with previous implementation was that we were not able to account for two pending exceptions at the same time, since when we execute an interruption request we clear all the state and there is no clear way to account for two exceptions at the same time. This means that, if we have a pending abort in a cctor, all exception handling inside the cctor will be broken (for the provided test case we were only throwing the cctor internal exception outside of it).

In order to fix this, we split into two types of interruptions SYNC and ASYNC (in order to separate mainly between abort and pending exceptions). Sync interruptions are interruptions requested by the thread itself (pending exceptions and self aborts) and they are processed as soon as possible. Async interruptions are requested by other threads (abort, interrupt, suspend) and we defer them as we were doing before (we have a deferred interruption if we have an async exception and abort block count is non zero).
2017-03-23 01:40:02 +02:00
Marek Safar 6443cd04c1 [xbuild] Copy csc/mcs GC settings to xbuild script 2017-03-22 23:13:28 +01:00
Chris Hamons 4d1e45d76a AppleTls Support (#4470) 2017-03-22 19:15:02 +01:00
monojenkins 90b11833ff [msvc] Update csproj files 2017-03-22 17:34:31 +01:00
Egor Bogatov 2115cd7394 [System.Data] Integration tests (#4538) 2017-03-22 13:51:57 +01:00
lateralusX 15277e6bd6 Windows msbuild triggers too much to rebuild.
When building mono solution from Visual Studio it correctly handles incremental
builds just rebuilding what's needed. When doing the same from msbuild it rebuilds
to much. This happens due to two different issues.

First, a change in winconfig.h setting up a define for corlib version was not
included in our compare config file script, so diff was detected as a change in
config file causing a replace of config.h triggering a complete rebuild.

Second, once above was fixed there was still a rebuild of mini-amd64.c when not needed.
This was due to a difference in how post build events are handled in Visual Studio
and msbuild. Visual Studio will detect that the complete project won't need to be
rebuild and then it doesn't trigger any of the events. msbuild on the other hand
will trigger events even if nothing needs to be rebuild and that triggered creation of cpu-amd64.h
that in turn will trigger rebuild of mini-amd64.c. Switching from post build event
to a custom build step with proper input/output files will work as expected in both
Visual Studio and msbuild.

Commit also disables the build of test projects that are part of solution
but won't provide any build output. These projects are mainly there to make launching of test
configurations easier and doesn't need to be included in solution build.
2017-03-22 11:52:42 +01:00
EgorBo f53004b171 [System.Data] Fix bug-53217: use AddressFamily.InterNetworkV6 when needed 2017-03-22 10:46:47 +01:00
Zoltan Varga 59083b6912 [runtime] Fix another typo in get_errno_from_g_file_error (). 2017-03-22 04:20:28 -04:00
Zoltan Varga 665ef73634 [runtime] Fix a typo causing an assert in get_errno_from_g_file_error (). Fixes #53684. 2017-03-22 04:17:30 -04:00
Marek Safar fe3454a2de [msvc] Fixes Cecil project update 2017-03-21 23:25:25 +01:00
Zoltan Varga 80e57d368b [runtime] Add some documentation for the offsets stuff. 2017-03-21 16:46:53 -04:00
monojenkins 4771dc97ce [msvc] Update csproj files 2017-03-21 17:29:44 +01:00
Zoltan Varga a0fa08a524 [ppdb] Avoid asserting on ppdb images without a guid heap. 2017-03-21 11:43:28 -04:00
Alexander Köplinger a9c402ffda [System.Web] Fix standalone-runner to return non-zero exit code on failure (#4562)
* [System.Web] Fix standalone-runner to return non-zero exit code on failure

We didn't notice that test runs with standalone-runner.exe failed
because it still exited with 0 in those cases.

Fixed that and the standalone tests that showed up as failed in
System.Web.Extensions (some differences likely from referencesource
code import).

* Fix replacement logic for Consts.cs.in to use Windows paths
2017-03-21 13:04:19 +01:00
Marek Safar c1c09bc78d Bump linker 2017-03-21 12:30:10 +01:00
Marek Safar 4d5f823b0f [System] Fix Process tests on watch 2017-03-20 23:57:31 +01:00
Marek Safar 6c600321a7 [System.Core] Update mobile test 2017-03-20 23:03:57 +01:00
Vlad Brezae 1592e1e3da [runtime] Fix interruption deferring
We were accidentally clearing the interruption deferred flag when exiting from nested abort protected regions.
2017-03-20 23:01:01 +02:00
Alexander Kyte 2811e6d984 Merge pull request #4555 from alexanderkyte/finished_mangler
[runtime] Finish the AOT mangler
2017-03-20 14:52:42 -04:00
monojenkins 496c5871ca [msvc] Update csproj files 2017-03-20 17:54:13 +01:00
Rodrigo Kumpera 6217218134 Merge pull request #4554 from kumpera/cleanup-random-stuff
Remove debug spew plus fix the code from PR #4536
2017-03-20 08:33:43 -07:00
Zoltan Varga 31e3260a36 [arm64] Fix the DISABLE_JIT build. 2017-03-20 07:46:45 -04:00
Vladimir Kazakov 7edc2b4a5f System.Security.Cryptography.X509Certificates enums from .NET Core.
TrustStatus and X509SelectionFlag are missing from .NET Core (https://github.com/dotnet/corefx/issues/17194), hence TrustStatus was taken from .NET Framework and X509SelectionFlag was left untouched.
2017-03-20 12:25:17 +01:00
Zoltan Varga 3ff66ac985 [simd] Add some missing Vector<T> intrinsics. Add some code to print out missing intrinsics when running with -v -v. (#4560) 2017-03-20 06:45:54 -04:00
monojenkins 9bec7d1d33 [msvc] Update csproj files 2017-03-20 11:27:33 +01:00
Zoltan Varga a4806314e1 [x86] Implement OP_EXPAND_I1 by lowering instead of directly to avoid register allocation problems. Increase stack size when simd types are used. (#4557) 2017-03-20 00:16:20 -04:00
Bernhard Urban 11987ed3a8 [interp] allocate storage for value types in runtime_invoke 2017-03-18 19:31:49 +01:00
Bernhard Urban 5d4a9aa7f9 [interp] treat GENERICINST properly on runtime_invoke return 2017-03-18 19:31:49 +01:00
Bernhard Urban a146700e40 [interp] box IntPtr on return of runtime_invoke 2017-03-18 19:31:49 +01:00
Bernhard Urban a9e3ef2e13 [interp] add UnsafeMov intrinsic support 2017-03-18 19:31:49 +01:00
Bernhard Urban a5076ac021 [interp] fix offset for starg_vt insn
fixes an issue in TestDriver, thus enabling some more tests.
2017-03-18 19:31:49 +01:00
Bernhard Urban b715527f92 [interp] remove register keyword hack.
we have 2017.
2017-03-18 19:31:49 +01:00
Bernhard Urban 66a6782051 [interp] call mono_thread_abort after an exception couldn't be handled 2017-03-18 19:31:49 +01:00
Bernhard Urban 11e5c801a2 [interp] don't assert on stack walking if we don't find a frame
e.g. `is_running_protected_wrapper` doesn't necessarily find a matching frame.
2017-03-18 19:31:49 +01:00
Bernhard Urban 7b114d1942 [lldb] update monobt so it understands interpreter frames.
```
(lldb) monobt
* thread #1
  * frame #0: 0x00000001001b236e mono-sgen`interp_transform_call(td=0x00007fff5fbfd080, method=0x0000000100915a90, target_method=0x0000000000000000, domain=0x000000010090b741
    frame #1: 0x00000001001a1c2e mono-sgen`generate(method=0x0000000100915a90, rtm=0x000000010382ac70, is_bb_start="\x01", generic_context=0x0000000100915ad0) + 9454 at tran8
    transforming TestMonoAsyncGenerics::AsyncWithAwait || frame #2: 0x000000010019f553 mono-sgen`mono_interp_transform_method(runtime_method=0x000000010382ac70, context=0x004
    TestMonoAsyncGenerics::AsyncWithAwait @ 0  || frame #3: 0x000000010018a178 mono-sgen`ves_exec_method_with_context(frame=0x00007fff5fbfe290, context=0x00007fff5fbfe3a8) +9
    TestMonoAsyncGenerics::Main @ 12 "pop" || frame #4: 0x000000010018b4b1 mono-sgen`ves_exec_method_with_context(frame=0x00007fff5fbfe420, context=0x00007fff5fbfe3a8) + 5081
    frame #5: 0x0000000100189e43 mono-sgen`mono_interp_runtime_invoke(method=0x000000010090ce38, obj=0x0000000000000000, params=0x00007fff5fbfea40, exc=0x0000000000000000, e0
    frame #6: 0x00000001000164a2 mono-sgen`mono_jit_runtime_invoke(method=0x000000010090ce38, obj=0x0000000000000000, params=0x00007fff5fbfea40, exc=0x0000000000000000, erro1
    frame #7: 0x000000010038b2b5 mono-sgen`do_runtime_invoke(method=0x000000010090ce38, obj=0x0000000000000000, params=0x00007fff5fbfea40, exc=0x0000000000000000, error=0x002
    frame #8: 0x0000000100384e97 mono-sgen`mono_runtime_invoke_checked(method=0x000000010090ce38, obj=0x0000000000000000, params=0x00007fff5fbfea40, error=0x00007fff5fbfeb000
    frame #9: 0x000000010038f335 mono-sgen`do_exec_main_checked(method=0x000000010090ce38, args=0x00000001020003c8, error=0x00007fff5fbfeb00) + 197 at object.c:4672
    frame #10: 0x000000010038dd5c mono-sgen`mono_runtime_exec_main_checked(method=0x000000010090ce38, args=0x00000001020003c8, error=0x00007fff5fbfeb00) + 76 at object.c:4773
    frame #11: 0x000000010038ddbf mono-sgen`mono_runtime_run_main_checked(method=0x000000010090ce38, argc=1, argv=0x00007fff5fbfef68, error=0x00007fff5fbfeb00) + 79 at objec2
    frame #12: 0x00000001000d9a33 mono-sgen`mono_jit_exec(domain=0x000000010090b740, assembly=0x0000000100913610, argc=1, argv=0x00007fff5fbfef68) + 403 at driver.c:1029
    frame #13: 0x00000001000dd9da mono-sgen`main_thread_handler(user_data=0x00007fff5fbfeea0) + 538 at driver.c:1098
    frame #14: 0x00000001000dc21c mono-sgen`mono_main(argc=3, argv=0x00007fff5fbfef58) + 8636 at driver.c:2163
    frame #15: 0x0000000100001b9e mono-sgen`mono_main_with_options(argc=3, argv=0x00007fff5fbfef58) + 46 at main.c:45
    frame #16: 0x00000001000012dd mono-sgen`main(argc=3, argv=0x00007fff5fbfef58) + 77 at main.c:338
    frame #17: 0x00007fffc2e66255 libdyld.dylib`start + 1
    frame #18: 0x00007fffc2e66255 libdyld.dylib`start + 1
```
2017-03-18 08:45:42 +01:00
Zoltan Varga 96fc5f6350 [arm] Fix the DISABLE_JIT build. 2017-03-17 19:05:43 -04:00
Frederik Carlier 1540749175 Make System.Drawing code compatible with .NET Core (#4548) 2017-03-17 23:30:35 +01:00
Alexander Kyte a483c550d7 [runtime] Finish AOT method name mangler 2017-03-17 17:15:55 -04:00
Rodrigo Kumpera 4018527279 [runtime] Remove debug spew. 2017-03-17 13:30:09 -07:00
Rodrigo Kumpera 54a98ba74e [runtime] Remove debug leftover and have mono_assembly_is_problematic_version actually work. 2017-03-17 13:29:57 -07:00
su21 463cf3b5c1 less allocation in Socket (#4516)
* less allocation in Socket

avoid allocate `System.Threading.QueueUserWorkItemCallback` in `SocketAsyncResult.Complete`
avoid allocate `Task` and anonymous function in `Socket.QueueIOSelectorJob`

* update: fix race and use replace static field with in line lambda

* cleanup code

* QueueIOSelectorJob keep async, and provie a fastpath

* SocketAsyncResult: simplify callback code

* add missing line `IOSelect.Add(handle, job)`  :(

* fix typo

* fix compile error
2017-03-17 15:35:41 -04:00
Andi McClure d86c6dce1c Bump version number to 4.9.4 to support automated builders 2017-03-17 11:58:05 -04:00
Marek Safar a333f0685b Add support for xunit tests 2017-03-17 16:01:44 +01:00
Marek Safar 1312784075 [System] Add back empty MonoTouch namespace 2017-03-17 14:08:53 +01:00
Johan Lorensson 1006d04ff6 Merge pull request #4542 from lateralusX/jlorenss/win-fix-unwind-tramp-reg-aot
mono_arch_unwindinfo_install_tramp_unwind_info can only be called for JIT:ed code.
2017-03-17 10:03:22 +01:00
Zoltan Varga 74c2ce1ff8 [jit] Remove support for the separate mono_lmf variable in the JIT, use the mono_lmf_addr () variable instead. The former could be used to generate slighly faster code in managed-to-native wrappers, but its not worth all the complexity it caused. (#4549) 2017-03-17 03:32:52 -04:00
Frederik Carlier 6447228e30 Remove CAS attributes from System.Drawing (#4544) 2017-03-17 00:10:44 +01:00
Aleksey Kliger (λgeek) b8285f3c99 Merge pull request #4453 from lambdageek/bug-49721
[loader] Check strong name when loading from application base. (Fixes #49721)
2017-03-16 19:09:00 -04:00
Zoltan Varga 395814d25f [x86] Disable the usage of mono_lmf on android as a workaround. 2017-03-16 19:06:36 -04:00
Zoltan Varga ec0624edc6 [x86] Remove some incorrect code from method prologs which clobbers the return value. 2017-03-16 18:56:54 -04:00
Alexander Köplinger a715c0daee [corcompare] Fix support for BindableAtribute ctor that takes BindableSupport 2017-03-16 23:46:30 +01:00
Alexander Köplinger 622840da56 Move target for creating monolite package to Mono 2017-03-16 21:38:31 +01:00
Alexander Köplinger c0dd559ee4 Include Mono version in corlib version
This makes it possible to version the runtime<->corlib interface
for each version branch independently and fixes the problem
of monolite getting overwritten by changes in different branches
when corlib version is still the same.

We're moving definition of the corlib version into configure.ac
so we can more easily bake the Mono version into it.
2017-03-16 21:38:31 +01:00
Rodrigo Kumpera ddae67da8a Merge pull request #4536 from kumpera/block-rebind-of-banned-assemblies
Reject rebinds that target one of the banned assemblies.
2017-03-16 15:23:10 -04:00
Aleksey Kliger 99a0b46327 [tests] Separate MONO_PATH directories by PLATFORM_PATH_SEPARATOR 2017-03-16 14:58:06 -04:00
Aleksey Kliger 5a06ca6c04 [mono/tests] Add strong named assembly loading tests
These tests place strong named assemblies on the MONO_PATH and into
MONO_GAC_PREFIX in various configurations and check that when a strong assembly
name  is specified: mono will ignore non-strong named assemblies that come
earlier in the search paths; mono will ignore strong named assemblies that have
the right filename and come earlier in the search path but have an incorrect
strong name.
2017-03-16 13:39:07 -04:00
Rodrigo Kumpera 59e8fa77d7 [tools] Dep check the downloads to avoid the mistake fixed by the previous commit. 2017-03-16 10:26:22 -07:00
Rodrigo Kumpera 09c7afbc75 [runtime] Update the banned version list to include SRDP and SVT. 2017-03-16 10:25:32 -07:00
Alexander Köplinger 15145d0554 [xbuild] Fix make dist broken by a350f8f0f4
Wildcards aren't supported in EXTRA_DISTFILES and it wouldn't work
anyway since we need to enclose the paths with spaces in quotes.
2017-03-16 17:16:58 +01:00
Alexander Köplinger 0af1ea70c2 [WindowsBase] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 5e8abc1c40 [System.Xaml] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger ebbdb78a35 [System.Windows.Forms.DataVisualization] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 00dac826ca [System.Web.Extensions] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger f4a7a5242a [System.Web.ApplicationServices] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger a22bb15e6b [System.Web] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger a82fcb2c9c [System.Transactions] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 1b5338dc5f [System.ServiceModel.Web] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 2e31504f02 [System.ServiceModel.Discovery] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger cd57ffcd04 [System.ServiceModel] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 03c249026e [System.Security] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger f376e49d95 [System.Management] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger cdd571a071 [System.IdentityModel.Selectors] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 882d805b9d [System.IdentityModel] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 8632f59dd2 [System.EnterpriseServices] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 1ba011835d [System.Drawing] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 96db2c2751 [System.DirectoryServices] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 9f1983da90 [System.Design] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 2a927126d3 [System.Data.OracleClient] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger a2b79b241d [System.Data.Linq] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger a6155cbc4a [System.Data] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 85b2056a36 [System.Core] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 44f06623bd [System.Configuration] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger e0e93f396d [System] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 780743d055 [Microsoft.Build] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 881dc69fef [Microsoft.Build.Engine] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 7ad842c95c [bcl] Rename variables to avoid conflict with later renames 2017-03-16 13:02:09 +01:00
Marek Safar 4a1c47f4bd [corlib] Update culture data. Fixes #53334 2017-03-16 10:18:12 +01:00
Marek Safar b94bebc69b [corlib] Fixes custom formatter with ";" section separator and zero values 2017-03-16 10:02:04 +01:00
Frederik Carlier b182c70602 Use MD5.Create () instead of new MD5CryptoServiceProvider() 2017-03-16 09:09:50 +01:00
Frederik Carlier 588b905349 Add [In, Out] annotation to points in GdipTransformMatrixPoints 2017-03-16 08:55:56 +01:00
Vincent Povirk 53ac1b026b [amd64] Fix mingw-w64 build. (#4519)
It lacks _In_reads_ and _Inout_.
2017-03-16 00:47:35 +01:00
Rodrigo Kumpera a4bbf29c15 [bcl] Enable tests for the monodroid profile. 2017-03-15 16:32:31 -07:00
Rodrigo Kumpera 0fc77091f3 [bcl] Add Mono.Posix to the monodroid profile. 2017-03-15 16:31:38 -07:00
Rodrigo Kumpera fc662e3ffe [Mono.Posix] Add file that was on the xamarin-android repo so it can be built from mono. 2017-03-15 16:30:34 -07:00
Rodrigo Kumpera c37ef087cf [System] Don't remove test helper needed by the test suite. 2017-03-15 16:28:42 -07:00
Rodrigo Kumpera b1d1a9d662 [corlib] I got a target that can't do satelite assemblies for now. Filed as #53136. 2017-03-15 16:27:17 -07:00
Rodrigo Kumpera b0876880fd [corlib] Disable GetObject_UrlNull on mobile as it depends on remoting. 2017-03-15 16:26:56 -07:00
Rodrigo Kumpera 401e28d28f [corlib] Reenable SafeHandleTest as they now work on Android. 2017-03-15 16:26:34 -07:00
Rodrigo Kumpera 5f5a66ee96 [corlib] Multiple small fixes to tests run on mobile.
DefineDefaultConstructor_Parent_DefaultCtorInaccessible:
	On Mobile, due to the Silverlight CoreCLR sandboxing, MethodInvoke doesn't wrap MethodAccessException in TargetInvocationException.
	Instead of fixing the mobile difference, we adjust the test.

LoadWithPartialName:
	Stop hardcoding the test assembly name otherwise this test will break on every new profile we add.

ReflectionOnlyLoadFrom:
	Don't assume that the test suite was loaded from $CWD.

GetRuntimeDirectory:
	Not all monodroid targets embed assemblies in the same way. So make a reasonable assumption instead.
2017-03-15 16:21:38 -07:00
Rodrigo Kumpera 35405bee31 [corlib] Cleanup tests that depend on SymbolWriter being available for no good reason. 2017-03-15 16:18:20 -07:00
Rodrigo Kumpera 1a17c39b23 [corlib] Cluster all tests that require large file support under the LargeFileSupport category. 2017-03-15 16:15:23 -07:00
Rodrigo Kumpera 067f012082 [bcl] Add build-test-lib target that builds the test lib for the current profile and assembly. 2017-03-15 16:13:21 -07:00
Rodrigo Kumpera d3a4abc745 [configure] Configure properly detects HAVE_LARGE_FILE_SUPPORT on Android. 2017-03-15 16:03:22 -07:00
Vlad Brezae 94c2a5434f [sgen] Fix xmm scanning on mac x86 (#4521)
The MonoContext (which sgen scans) did not have its fpregs populated, even though we were fetching the fpstate.
2017-03-16 00:59:23 +02:00
Zoltan Varga c078f357c6 [aot] Print out more info when a method cannot be AOTed. 2017-03-15 18:33:32 -04:00
Zoltan Varga e98342bf74 [runtime] Fix mono_method_get_name_full () so it works with methods whose signature cannot be loaded. 2017-03-15 18:33:32 -04:00
Rodrigo Kumpera 8a83c3eb2c [tools] Update nuget-hash-extractor to spew the new ban table. 2017-03-15 13:48:08 -07:00
Rodrigo Kumpera 3e220c5b7b [runtime] Reject rebinds that target one of the banned assemblies.
The matching is done by name and version. We don't check pubkey or MVID.
2017-03-15 13:46:56 -07:00
Zoltan Varga 49b2bdeafb Bump ikdasm. 2017-03-15 16:25:20 -04:00
lateralusX c27b70cc43 mono_arch_unwindinfo_install_tramp_unwind_info can only be called for JIT:ed code.
Currently mono_arch_unwindinfo_install_tramp_unwind_info can only be called on
JIT:ed code since it assumes place for unwind info has been allocated behind
code block. When called by AOT:ed code the complete this is have not done and
the unwind info should not be registered with OS for AOT:ed code
(should be part of the image).
2017-03-15 10:18:17 +01:00
Zoltan Varga 847ed21be0 [simd] Fix some problems exposed by the corefx test suite. (#4531) 2017-03-15 05:08:57 -04:00
Zoltan Varga 88a6ae00a2 [simd] Mark Mono.Simd classes as obsolete. 2017-03-15 09:17:11 +01:00
Zoltan Varga 2bf7d1b525 Bump ikdasm. 2017-03-14 16:37:52 -04:00
Aleksey Kliger 01262e9104 [loader] Cleanup add_assemblies_to_domain
1. Don't re-add the domain assemblies to the hashtable on every recursive
   call - they are already in there (we're holding the assemblies_lock, noone
   else can add anything to domain->domain_assemblies); just add them once when
   the hash table is created.
2. When iterating over the referenced assemblies, don't stop at the first NULL.
   a NULL means that referenced assembly hasn't been demanded by anyone yet,
   but there's no reason to assume some other referenced assembly that happens
   to come later in the table hadn't been resolved.  Iterate upto assembly->nreferences.
2017-03-14 15:49:35 -04:00
Alexander Köplinger 294148d27d [tools] Don't install mdb2ppdb by default (#4526) 2017-03-14 19:41:16 +01:00
Aleksey Kliger 0b442e8430 [test-runner] Add --mono-gac-prefix command line option.
Also don't unset the MONO_PATH if a --mono-path isn't passed to the test runner.
2017-03-14 11:40:18 -04:00
Aleksey Kliger e02828877e [mono/tests] Make w32message.cs a normal test-runner test
Use exit codes to communicate success/failure like other test-runner tests.
Get rid of custom build rules.
2017-03-14 11:39:04 -04:00
Aleksey Kliger af7195e349 [loader] Remap public key tokens of framework assemblies when running with --runtime=mobile 2017-03-14 11:39:04 -04:00
Aleksey Kliger 5bc0917df2 [mono/tests] Fix tests when using full or hybrid AOT
* bug-30085 test
  mscrorlib pubKeyToken depends on what we're testing
* bug-17537 test
  AOT the helper assembly so it can be loaded by fullaot runtime
* bug-3903 test
  explicit paths to corlib and System.Core reference assemblies
2017-03-14 11:39:03 -04:00
Aleksey Kliger 1e227ddee1 [loader] In debug output, print the domain search path when loading assemblies. 2017-03-14 11:39:03 -04:00
Aleksey Kliger f58bc6e295 [loader] Requesting an assembly with a strong name should match exactly
If an assembly references another with a strong name, the loader will require
that the strongly named assembly match exactly the requested name (name, version, culture, public
key token).

For assemblies without a strong name, continue Mono's existing behavior.
2017-03-14 11:39:03 -04:00
Aleksey Kliger ae1822075d [loader] Pass predicate callback to mono_assembly_load_from_full
Actually create a new mono_assembly_load_from_predicate () and call that from
the old mono_assembly_load_from_full ().

This function is responsible for creating brand new MonoAssembly* values and
then committing them by calling mono_assembly_invoke_load_hook().  So if we
would like to have a chance to reject a candidate assembly from loading for
some reason, this is the only place we can do it:

* anywhere before the call to mono_assembly_load_from_predicate there is no
  MonoAssembly* yet.
* anywhere after mono_assembly_load_from_predicate returns, the load hook was
  already called (in a plain vanilla Mono, there's an installed load hook
  called mono_domain_fire_assembly_load () which caches the MonoAssembly* in
  the domain that requested the load - after that point we cannot possibly
  consider another MonoImage* for the same MonoAssemblyName - the appdomain
  will always return the cached one).

The next commit will use this predicate to reject some strongly named
assemblies when the candidate assembly doesn't exactly match the wanted
MonoAssemblyName.  (Note that load_from doesn't have the MonoAssemblyName that
was requested, so we'd have to thread /something/ down here - might as well be
a predicate function.)
2017-03-14 11:39:03 -04:00
Aleksey Kliger a21fae83b7 [runtime] Mark mono_assembly_open and mono_assembly_open_full external only
Runtime should use mono_assembly_open_predicate
2017-03-14 11:39:03 -04:00
Aleksey Kliger 092f4c6ac0 [assembly] Add mono_assembly_open_predicate function
This is an extension of mono_assembly_open_full with a user-supplied predicate
that gets a chance to interrogate the candidate MonoAssembly before it is
consider successfully loaded.
2017-03-14 11:39:02 -04:00
Marek Safar a350f8f0f4 [xbuild] Relocate Portable frameworks 2017-03-14 14:56:10 +01:00
Marek Safar da3bd8368b Revert "Bump buildtools to branch that includes portable targets"
This reverts commit 5bb4b3d154.
2017-03-14 14:56:10 +01:00
Bernhard Urban be84042525 [configure] rename "--with-interpreter=yes" to "--enable-interpreter" 2017-03-14 10:59:22 +01:00
Ankit Jain 81129b83c3 Handle windows paths in ResXFileRef, for conversion to string case
- convert the path a little earlier to handle the case for conversion to
  string
- Fixes earlier commit a3195b79f6
- And enable the corresponding test
2017-03-14 09:00:59 +01:00
Zoltan Varga 8b7eee9788 [jit] Add parameter type checks to the SIMD intrinsics to make sure we are handling the proper methods. Fixes #53278. (#4520) 2017-03-13 21:46:46 -04:00
Alexander Köplinger 5bb4b3d154 Bump buildtools to branch that includes portable targets 2017-03-14 00:29:11 +01:00
Zoltan Varga 6f33b62f39 [runtime] Mark array types with more than 32 dimensions as invalid. Move the check for arrays of void into Array.CreateInstance (), since typeof (void).MakeArrayType () is valid. Fixes #53131. (#4514) 2017-03-13 16:02:25 -04:00
Bernhard Urban a28e700ff5 [interp] kill MINT_LDTHISA
not required anymore with new internal ABI
2017-03-13 17:41:31 +01:00
Bernhard Urban ad2d093d06 [interp] allow generic instantiation as argument in runtime_invoke 2017-03-13 17:41:31 +01:00
Bernhard Urban 721ad57069 [interp] more static trampolines 2017-03-13 17:41:31 +01:00
Bernhard Urban c0712cb163 [interp] inflate cee_token properly if it comes from wrapper metadata 2017-03-13 17:41:31 +01:00
Bernhard Urban 64da05d517 [interp] make sure we wrap virtual methods with synchronize wrapper too 2017-03-13 17:41:31 +01:00
Bernhard Urban 5f7db6b93f [interp] clear exception storage in runtime_invoke 2017-03-13 17:41:31 +01:00
Bernhard Urban bae654cbf7 [interp] lock when acquiring memory from a mempool.
`mono_domain_alloc` does that for us. also, use proper locking around
JIT code hashtable.  the interpreter repurpose the JITs hashtable, so
let's use the existing locks.
2017-03-13 17:41:31 +01:00
Bernhard Urban d4513c61d4 [ci] add more steps to interp 2017-03-13 17:41:31 +01:00
Bernhard Urban 1283104761 [tests] update 'make testinterp' target 2017-03-13 17:41:31 +01:00
Bernhard Urban 8fd5b8e0f5 [test-runner] remove duplicated --runtime hanlding 2017-03-13 17:41:31 +01:00
Bernhard Urban 914733cd27 [test-runner] allow passing runtime args 2017-03-13 17:41:31 +01:00
Marek Safar fef19961d7 [System.Windows.Forms] Disable failing test 2017-03-13 09:55:13 +01:00
Marek Safar 78072e093d Bump corefx 2017-03-13 09:44:24 +01:00
Marek Safar a60e3b1497 Bump buildtools 2017-03-13 09:39:50 +01:00
Frederik Carlier 6757632ae7 GDI+ functions: use constant for the library name, fix whitespace (#4515) 2017-03-13 09:15:22 +01:00
Marek Safar 25869d138a [corlib] FileStream::Name needs to include fully qualified normalized name. Fixes #53231 2017-03-12 09:41:23 +01:00
Zoltan Varga 4f187040c6 [jit] Implement RuntimeHelpers.IsReferenceOrContainsReferences intrinsic. Fixes #53153. (#4500) 2017-03-11 23:43:37 -05:00
Jon Purdy ab93bc9a7b [docs] Remove dead metadata APIs. 2017-03-11 15:24:00 -08:00
Jon Purdy b353ba1788 [docs] Remove dead mempool APIs. 2017-03-11 15:24:00 -08:00
Jon Purdy 58ad70577a [docs] Remove dead hash table APIs. 2017-03-11 15:24:00 -08:00
Jon Purdy f6a855df8c [docs] Remove dead GC APIs. 2017-03-11 15:24:00 -08:00
Jon Purdy 067ed199d2 [docs] Remove dead remote wrapper APIs.
They were deleted in d1ace1652b.
2017-03-11 15:24:00 -08:00
Jon Purdy 705d2361ca [docs] Remove dead loader error APIs.
They were deleted in 38cf816b97.
2017-03-11 15:24:00 -08:00
Frederik Carlier ca6d958db0 Remove CAS from System.Drawing unit tests 2017-03-11 20:37:14 +01:00
Marek Safar 69b48401c9 [System.Windows.Forms] Fixes test build failure 2017-03-11 15:21:15 +01:00
Zoltan Varga 51278a7b25 [bcl] Implement RuntimeHelpers.IsReferenceOrContainsReferences () as an icall, so it works even if the intrinsic is disabled. 2017-03-11 11:15:15 +01:00
Ankit Jain a3195b79f6 Handle a file ref, with backslashes, in a .resx, on a non-windows system
File ref of the form:

```xml
  <data name="foo" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>..\Resources\foo.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </data>
```
2017-03-11 11:03:07 +01:00
Alexander Köplinger 572e92c597 [WinForms] Fix Bindable attribute argument to use boolean
Otherwise mono-api-info crashes on System.Windows.Forms.dll with a NotImplementedException.
This is the only place in the codebase where we used `BindableSupport.Yes` instead of `true`.
2017-03-11 01:01:30 +01:00
Marek Safar 1de81ff1da [corlib][Mono.Posix] Remove NunitHelpers.cs reference 2017-03-10 20:36:26 +01:00
Alexis Christoforides 3821e9bead [MacSDK] Another attempt at circumventing signing for Ironlangs build
Roslyn does not support signing on non-Windows, and MSBuild normally refuses to continue.
2017-03-10 13:01:13 -05:00
lateralusX ab66a6156f Fixing checked build after unwind info changes. 2017-03-10 12:26:03 -05:00
Alexis Christoforides eb0e423499 [MacSDK] Use MSBuild to build IronPython/IronRuby. We are deprecating xbuild 2017-03-10 09:31:38 -05:00
Alexis Christoforides 814d37f556 Update Bockbuild 2017-03-10 07:51:36 -05:00
Egor Bogatov ea5c5fe093 Fix [Bug 52795] Infinite loop on MySqlDataReader.ReadAsync() (#4504) 2017-03-10 13:48:59 +01:00
Alexis Christoforides aad9126f5f Update Bockbuild 2017-03-10 05:34:42 -05:00
Johan Lorensson c63aa7cd12 Merge pull request #4444 from lateralusX/jlorenss/windows-unwind-info
Improve unwind support on Windows x64.
2017-03-10 11:16:23 +01:00
Alexis Christoforides f2ba124191 Update Bockbuild 2017-03-10 00:03:36 -05:00
Zoltan Varga 03bd0ea9e6 [arm64] Fix the saving/restoring of fp regs in exception filters, we were saving/restoring them from the incorrect position in MonoContext.fregs. (#4499) 2017-03-09 23:35:04 -05:00
Zoltan Varga 0f2b159ed9 [runtime] Add a test to verify that pedump works. (#4486) 2017-03-09 23:03:29 -05:00
Alexis Christoforides c12b559df3 Update Bockbuild 2017-03-09 22:43:48 -05:00
Alexis Christoforides 420b6c3145 [MacSDK] Fix Ironlangs build with latest MSBuild 2017-03-09 21:23:47 -05:00
Rodrigo Kumpera 1bad3716e3 Merge pull request #4494 from kumpera/important-android-fixes
[runtime] Make sure we use lower numbered signals on Android.
2017-03-09 13:14:35 -08:00
Jon Purdy a4a794266d [api] Remove dead mono_load_image API. 2017-03-09 12:48:46 -08:00
Ludovic Henry 65025fea2c [socket] ret might not have been initialized (#4495) 2017-03-09 13:35:04 -05:00
Alexander Köplinger 982646c232 [Mono.Options] Add missing test file to test sources
It was missed in c1b9fc566a
2017-03-09 19:25:33 +01:00
monojenkins 65cddd7727 [msvc] Update csproj files (#4479) 2017-03-09 19:22:15 +01:00
Marek Habersack 21dec72083 [mkbundle] Encode directory separator character on Windows (#4493)
When storing satellite assemblies, mkbundle prefixes their names with a
directory name derived from the language/locale of the assembly. It uses the
platform's default directory separator character which on Windows defaults to
'\' and that causes problems when building such a bundle on Windows since \ is
an escape sequence prefix inside strings and not escaping it with another \
leads to gcc errors when building the genrated source.

This commit fixes the problem by quoting the directory separator character
properly on Windows.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52845
2017-03-09 10:25:08 -05:00
Alexander Köplinger eff552d9bd [ci] Remove ppc64el checks from run-test-default.sh
This was initially done so we didn't get orange builds
when ppc64el was in the same job as our other archs.

ppc64el was since moved into a separate job so we can
stop skipping the test suites.

Also fixed badges in README.md for ppc64el and s390x
2017-03-09 15:16:03 +01:00
lateralusX 6218be7200 Shorten function name length for static functions. 2017-03-09 15:10:11 +01:00
Marek Safar d772d6a0e3 [mcs] Codegen for auto-property backing field initialization used as assignment. Fixes #53166 2017-03-09 15:06:49 +01:00
Daniel C. Weber eea2d3e250 [Mono.Posix] UnixSIgnal.WaitOne() doesn't block for 0 timeout (#4489)
For timeouts of 0 milliseconds, WaitOne may produce incorrect results. In case of timeout, the result of WaitAny denotes the amount of milliseconds that have timed out. WaitOne relies on WaitAny and interprets the result falsely as the index of the completed handle. This change introduces a check on the timeout and returns `IsSet` when the handle is not allowed to block.

This is in accordance to Microsofts [documentation of WaitOne](https://msdn.microsoft.com/de-de/library/cc189983(v=vs.110).aspx) which states "If millisecondsTimeout is zero, the method does not block. It tests the state of the wait handles and returns immediately.". 

[Here](https://github.com/StephenCleary/AsyncEx.Interop.WaitHandles/blob/master/src/Nito.AsyncEx.Interop.WaitHandles/WaitHandleInterop.cs#L51) is an example of some code relying on correct output of `WaitOne(0)` that is effectively broken by the current behaviour.
2017-03-08 21:09:50 -05:00
Rodrigo Kumpera 3a5adbd2af [runtime] Make sure we use lower numbered signals on Android.
Android on 32bits arm shipped broken headers that made sigset_t be 32 bits instead of 64.

This means that it's not possible to use signals whose value are >= 32. The default implementation
uses RT signals when available (and they are on Android). But RT signals don't work as expected
as their value is >= 32.

This fix hardcodes some safe signals on Android and add asserts about their values to avoid regressions.

See 5005c6f3fb for more details.
2017-03-08 15:34:38 -08:00
Bernhard Urban d455c0d234 [interp] remove g_error call
can hit this case in racy code (e.g. tests/thread5.cs)
2017-03-08 23:02:51 +01:00
Bernhard Urban 4339c540ca [interp] fix another data.klass access. due to generics it has to be resolved with a runtime helper 2017-03-08 23:02:51 +01:00
Bernhard Urban 6504758616 [interp] support stelem for g{,u}int64 2017-03-08 23:02:51 +01:00
Bernhard Urban 3a3baaf72a [interp] pass single fp correctly to icall trampoline
add test to basic-math.cs that tests this specifically.
2017-03-08 23:02:51 +01:00
Bernhard Urban eda8722273 [interp] fix type init exception propagation for methods that trigger static constructors 2017-03-08 23:02:51 +01:00
Bernhard Urban 392de95a84 [interp] support non-empty stack in switch branches 2017-03-08 23:02:51 +01:00
Bernhard Urban ceb5151a23 [interp] fix for ldflda unsafe corner case 2017-03-08 23:02:51 +01:00
Bernhard Urban b5ea5215ef [interp] propogate OOM exception on array instantiation 2017-03-08 23:02:51 +01:00
Bernhard Urban 0b7b9d2bff [exceptions.cs] enable one more test 2017-03-08 23:02:51 +01:00
Bernhard Urban b9d5083353 [interp] respect lower_bound on array access and share behaviour with .Set, .Get and .Address 2017-03-08 23:02:51 +01:00
Bernhard Urban ddbea4b85a [interp] throw overflow exception on long to ulong cast where long is negative 2017-03-08 23:02:51 +01:00
Bernhard Urban 52c9310997 [interp] throw overflow exception on ulong to long cast where ulong is too large to fit in long 2017-03-08 23:02:51 +01:00
Bernhard Urban 3ffd7c6ca8 [interp] throw overflow exception on (0/-1) 2017-03-08 23:02:51 +01:00
Bernhard Urban b9480403b5 [interp] fix overflow corner cases for integer 2017-03-08 23:02:51 +01:00
Bernhard Urban 4b393c4e68 [interp] fix a mem leak in transform 2017-03-08 23:02:51 +01:00
Bernhard Urban 0560b20dad [interp] allocate one more slot for tracking stack types
due to the way basic block handling is done in the interpreter, it can
happen that we have one additional element on the stack (as opposed to
what metadata tells us)
2017-03-08 23:02:51 +01:00
Bernhard Urban 548e5ad0f7 [makefile] cleanup richeck target 2017-03-08 23:02:51 +01:00
Bernhard Urban cc82f7647f [interp] support stelem for guint8 2017-03-08 23:02:51 +01:00
Bernhard Urban 9e0e78ad64 [interp] support reference case for unbox.any 2017-03-08 23:02:51 +01:00
Bernhard Urban b22850efd7 [interp] remove STTHIS completly. 2017-03-08 23:02:51 +01:00
Bernhard Urban b2a93db718 [interp] throw exceptions from icalls 2017-03-08 23:02:51 +01:00
Bernhard Urban cd1797fac9 [interp] proper overflowcheck for size passed to cee_newarr 2017-03-08 23:02:51 +01:00
Bernhard Urban fd8a5f9ebf [interp] throw NRE in mint_vcall insn if receiver is null 2017-03-08 23:02:51 +01:00
Bernhard Urban 8cdf86ee69 [interp] respect generic context for cee_sizeof 2017-03-08 23:02:51 +01:00
Bernhard Urban fa171c4369 [interp] set proper type info for cee_ldtoken bytecode 2017-03-08 23:02:51 +01:00
Bernhard Urban 78fb960c6a [interp] refactor Array::Address, so that readonly. prefix is respected properly 2017-03-08 23:02:51 +01:00
Bernhard Urban 243d65d765 [interp] cee_{stfld,ldfld{,a}} can access static fields too 2017-03-08 23:02:51 +01:00
Bernhard Urban 9862d66925 [interp] fix cee_initobj for reference type 2017-03-08 23:02:51 +01:00
Bernhard Urban a2a647ca37 [interp] implement cee_cpobj 2017-03-08 23:02:51 +01:00
Bernhard Urban fa7f66c939 [interp] transform all kind of clauses
still need to handle filter clauses correctly during stack walking.
2017-03-08 23:02:51 +01:00
Bernhard Urban c6ceaa11df [interp] clear storage for sp, vt_sp and locals properly 2017-03-08 23:02:51 +01:00
Bernhard Urban 396ea09438 [interp] implement cee_unbox and cee_ldobj correctly
unbox is supposed to push a managed pointer on the stack and ldobj does
the actual value copy.  unbox_any is basically unbox+ldobj according to
the spec.

fixes random crashes in test_0_regress_80622:iltests.il
2017-03-08 23:02:51 +01:00
Bernhard Urban 722e5ff2c5 [interp] fix issues around conv.ovf.* bytecodes 2017-03-08 23:02:51 +01:00
Bernhard Urban cd8880b0c3 [interp] fix localloc instruction, storage must be cleared 2017-03-08 23:02:51 +01:00
Bernhard Urban 6761073b2a [interp] clear locals storage also on pointer type 2017-03-08 23:02:51 +01:00
Bernhard Urban d46883ac2d [interp] add iltests.exe to regression suite and mark crashing tests 2017-03-08 23:02:51 +01:00
Bernhard Urban d38d6580e2 [interp] add interpreter specific create_trampoline callback 2017-03-08 23:02:51 +01:00
Bernhard Urban 2889a73335 [generics.cs] enable one more test for interpreter 2017-03-08 23:02:51 +01:00
Bernhard Urban e1c694a6c6 [interp] implement constrained calls to interface methods correctly
compare with 9adc7023e6
2017-03-08 23:02:51 +01:00
Bernhard Urban c013b533f2 [interp] support readonly. prefix for ldelema 2017-03-08 23:02:51 +01:00
Bernhard Urban 5a5cca1bc0 [interp] respect variance in interface dispatch 2017-03-08 23:02:51 +01:00
Bernhard Urban 8112950205 [interp] inflate also on CEE_CALL etc.
also, remove weird hack for delegate.invoke ()
2017-03-08 23:02:51 +01:00
Zoltan Varga d3d1b2d56a [offsets-tool] Remove dependencies on android directory layout by adding a --targetdir=dir argument argument which points to the mono build directory corresponding to the target abi. Only allow one --abi= argument on android. (#4487) 2017-03-08 11:57:31 -05:00
Marek Safar b85b691a1a [System] Collections from CoreFX 2017-03-08 14:26:27 +01:00
Marek Safar 1651cf1ae3 Bump corefx 2017-03-08 14:26:27 +01:00
Alexander Köplinger 2c9e4379c9 [ci] Check if X server is available before running WinForms tests (#4477)
This should hopefully "fix" the mass fails in the WinForms
tests we sometimes see in CI.

We're using the simplest WinForms code that invokes the XplatUI
and causes the X connection to be established, if this fails
then something is seriously wrong and we skip the WinForms tests.
2017-03-08 12:48:28 +01:00
Zoltan Varga ed12a1d4da [arm] Implement aot support for handler block trampolines. 2017-03-07 20:34:51 -05:00
Zoltan Varga 81a4224c7d [arm64] Implement aot support for handler block trampolines. 2017-03-07 18:20:12 -05:00
Alexander Kyte b0b4fb685a Merge pull request #4481 from migueldeicaza/master
[mkbundle] Fixes the embedding of dependency assemblies + test
2017-03-07 13:26:34 -05:00
Zoltan Varga 15deb5b223 [runtime] Fix pedump. 2017-03-07 12:24:50 -05:00
Frederik Carlier 3ad43b66e7 RFI - Support building System.Drawing for NETCOREAPP2.0 (#4483) 2017-03-07 11:26:38 +01:00
Aleksey Kliger abf1a37e2e [mono/tests] Don't use -lib:<dir> use -r:<dir>/asm.dll for framework assemblies
Apparently Roslyn looks in -lib directories only if it doesn't find the needed
assembly in MONO_PATH first.  On the other hand, using a full path with -r will
take priority over the assemblies in system directories.
2017-03-06 18:22:19 -05:00
Aleksey Kliger 2c50197c33 [mini] Run tests with --runtime=mobile for testing_aot_full profile 2017-03-06 18:22:19 -05:00
Aleksey Kliger 123e545dee [runtime] Redirect mobile System.Net.Http to version 4.0.0.0
per mcs/class/System.Net.Http/Assembly/AssemblyInfo.cs
our System.Net.Http AssemblyVersion is 4.0.0.0 when using mobile.
2017-03-06 18:22:19 -05:00
Marek Safar fb14f43a98 [Mono.Options] Update documentation build 2017-03-07 00:01:42 +01:00
Jonathan Pryor c1b9fc566a [Mono.Options] Add Mono.Options.Command, .CommandSet
Mono.Options.CommandSet allows easily having separate commands and
associated command options, allowing creation of a *suite* along the
lines of **git**(1), **svn**(1), etc.

CommandSet allows intermixing plain text strings for `--help` output,
Option values -- as supported by OptionSet -- and Command instances,
which have a name, optional help text, and an optional OptionSet.

	var suite = new CommandSet ("suite-name") {
		// Use strings and option values, as with OptionSet
		"usage: suite-name COMMAND [OPTIONS]+",
		{ "v:", "verbosity", (int? v) => Verbosity = v.HasValue ? v.Value : Verbosity+1 },
		// Commands may also be specified
		new Command ("command-name", "command help") {
			Options = new OptionSet {/*...*/},
			Run     = args => { /*...*/},
		},
		new MyCommandSubclass (),
	};
	suite.Run (new string[]{...});

CommandSet provides a `help` command, and forwards `help COMMAND`
to the registered Command instance by invoking Command.Invoke()
with `--help` as an option.
2017-03-06 23:37:55 +01:00
Miguel de Icaza 62de061fb2 [mkbundle] Fixes the embedding of dependency assemblies + test 2017-03-06 14:39:23 -05:00
Zoltan Varga 8c7b88f1aa Fix the build. 2017-03-06 13:12:11 -05:00
Aleksey Kliger 6f2cbfaade [coop handles] Assert if interior ptr handle passed to mono_gchandle_from_handle 2017-03-06 13:00:27 -05:00
Aleksey Kliger aaa5b33e18 [coop handles] Use a bitmap per HandleChunk to track interior ptr handles
instead of using a flag byte in each HandleChunkElem.
2017-03-06 13:00:27 -05:00
Aleksey Kliger 6ce41773fb [reflection] Use coop handles for MonoMethodInfo.get_method_info and MonoPropertyInfo.get_property_info 2017-03-06 13:00:27 -05:00
Aleksey Kliger af0192d09a [marshal] Pin valuetype ref icall arguments.
There are now 4 kinds of arguments to icalls:
  1. Plain old values like 'int', 'bool', etc.  Passed from the wrapper to the
     icall as is.
  2. Objects in the managed heap.  Passed using coop handles.
  3. 'out' objects in the managed heap.  A NULL coop handle is passed in
     and its final value is written back out to the caller's out argument.
  4. Value types passed by 'ref' or 'out'.  An "interior" coop handle is created which has
     the effect of pinning the object into which the ref points (if it points
     to the stack, nothign happens).  The argument is passed to the icall as a
     raw reference (MonoFoo*, not MonoFooHandle).  The ref will be unpinned
     when the icall wrapper returns.
2017-03-06 13:00:27 -05:00
Aleksey Kliger fbdf874ee5 [coop handles] Add handles for interior pointers / valuetype handles
- Call mono_handle_stack_scan for both the precise and the imprecise gc scans.
- For now assert during scan that all handles are to the beginning of an
  object.
- Add TYPED_VALUE_HANDLE_DECL Macro to declare valuetype handles:
     TYPED_VALUE_HANDLE_DECL (MonoMethodInfo);
     /* Declare MonoMethodInfoValueHandle and MonoMethodInfoValueHandleOut */
- Add MONO_HANDLE_NEW_GET_VALPTR (h, type, field) macro to create a new handle that
  points to "field" (of type "type") in the object "h".
2017-03-06 13:00:27 -05:00
Frederik Carlier d1be740678 Make System.Drawing unit tests use Assert.Throws instead of [ExpectedException] (#4476)
* Use Assert.Throws<> intstead of ExpectedException

* System.Drawing.Tests: Use Assert.Throws instead of ExpectedException
2017-03-06 18:12:35 +01:00
Marek Safar 725d5fdcc2 [resx2sr] Handle duplicate keys 2017-03-06 15:52:42 +01:00
Bernhard Urban 7d1d8f51d8 [sgen] use memmove as src and dst can overlap
valgrind said this on `mcs --version`:

```
==807== Thread 1:
==807== Source and destination overlap in memcpy(0x413f050, 0x413f050,
8)
==807==    at 0x4C32513: memcpy@@GLIBC_2.14 (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==807==    by 0x7FB6DD: sgen_qsort_rec (sgen-qsort.c:76)
==807==    by 0x7FB8CC: sgen_qsort (sgen-qsort.c:118)
==807==    by 0x7ED834: major_free_swept_blocks (sgen-marksweep.c:2136)
==807==    by 0x7F0590: sgen_memgov_calculate_minor_collection_allowance
(sgen-memory-governor.c:114)
==807==    by 0x7F0D2E: sgen_memgov_major_collection_end
(sgen-memory-governor.c:278)
==807==    by 0x7A6C71: major_finish_collection (sgen-gc.c:2116)
==807==    by 0x7A6E23: major_do_collection (sgen-gc.c:2158)
==807==    by 0x7A7464: sgen_perform_collection (sgen-gc.c:2355)
==807==    by 0x7A85AF: sgen_gc_collect (sgen-gc.c:2854)
==807==    by 0x77C022: mono_gc_collect (sgen-mono.c:2574)
==807==    by 0x726A18: mono_domain_finalize (gc.c:439)
==807==
==807== Source and destination overlap in memcpy(0x413f078, 0x413f078,
8)
==807==    at 0x4C32513: memcpy@@GLIBC_2.14 (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==807==    by 0x7FB6DD: sgen_qsort_rec (sgen-qsort.c:76)
==807==    by 0x7FB798: sgen_qsort_rec (sgen-qsort.c:92)
==807==    by 0x7FB8CC: sgen_qsort (sgen-qsort.c:118)
==807==    by 0x7ED834: major_free_swept_blocks (sgen-marksweep.c:2136)
==807==    by 0x7F0590: sgen_memgov_calculate_minor_collection_allowance
(sgen-memory-governor.c:114)
==807==    by 0x7F0D2E: sgen_memgov_major_collection_end
(sgen-memory-governor.c:278)
==807==    by 0x7A6C71: major_finish_collection (sgen-gc.c:2116)
==807==    by 0x7A6E23: major_do_collection (sgen-gc.c:2158)
==807==    by 0x7A7464: sgen_perform_collection (sgen-gc.c:2355)
==807==    by 0x7A85AF: sgen_gc_collect (sgen-gc.c:2854)
==807==    by 0x77C022: mono_gc_collect (sgen-mono.c:2574)
==807==
==807== Source and destination overlap in memcpy(0x413f088, 0x413f088,
8)
==807==    at 0x4C32513: memcpy@@GLIBC_2.14 (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==807==    by 0x7FB6DD: sgen_qsort_rec (sgen-qsort.c:76)
==807==    by 0x7FB798: sgen_qsort_rec (sgen-qsort.c:92)
==807==    by 0x7FB798: sgen_qsort_rec (sgen-qsort.c:92)
==807==    by 0x7FB8CC: sgen_qsort (sgen-qsort.c:118)
==807==    by 0x7ED834: major_free_swept_blocks (sgen-marksweep.c:2136)
==807==    by 0x7F0590: sgen_memgov_calculate_minor_collection_allowance
(sgen-memory-governor.c:114)
==807==    by 0x7F0D2E: sgen_memgov_major_collection_end
(sgen-memory-governor.c:278)
==807==    by 0x7A6C71: major_finish_collection (sgen-gc.c:2116)
==807==    by 0x7A6E23: major_do_collection (sgen-gc.c:2158)
==807==    by 0x7A7464: sgen_perform_collection (sgen-gc.c:2355)
==807==    by 0x7A85AF: sgen_gc_collect (sgen-gc.c:2854)
```
2017-03-06 13:09:31 +01:00
Alexander Köplinger fb4d198131 [cert-sync] Don't import into BTLS store if BTLS is not available (#4475)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53015
2017-03-06 12:06:55 +01:00
Vladimir Kazakov b39878bbda Finalize the implementation of SignedXml.ComputeSignature(). (#4452)
* Finalize the implementation of SignedXml.ComputeSignature().

The implementation was taken from Reference Source, which makes the behaviour of this method the same as in .NET Framework, as well as makes it possible to use custom signature descriptions.
2017-03-06 11:12:04 +01:00
Zoltan Varga 690c34df5f [jit] Fix an assert in mono_unwind_ops_encode_full () caused by an off-by-one error. Fixes #53066. 2017-03-06 02:31:49 -05:00
Zoltan Varga b37a2639e9 [arm64] Fix the passing of small arguments on the stack in the gsharedvt trampoline, the calculation of their stack offset was incorrect in two places. Fixes #52866. 2017-03-05 00:25:43 -05:00
monojenkins 6bb074bbfb [msvc] Update csproj files (#4474) 2017-03-04 22:52:47 +01:00
Vincent Povirk a56212b5ae [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.
2017-03-04 12:03:56 -05:00
Ludovic Henry b85e7c862b [corert] Import System.Threading.ThreadPoolBoundHandle 2017-03-03 19:15:36 -05:00
Ludovic Henry b41347b9f4 [corert] Import System.Diagnostics.Debug 2017-03-03 15:28:51 -05:00
Marek Safar 875ab8db4c [System.Core] Collections from corefx 2017-03-03 17:16:31 +01:00
Aleksey Kliger 3e4783c04b [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.
2017-03-03 09:46:46 -05:00
Aleksey Kliger 9547921445 [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)
2017-03-03 09:46:46 -05:00
Ludovic Henry 5eb363dbf1 [threads] Remove ThreadState_StopRequested (#4462) 2017-03-02 21:26:00 -05:00
Zoltan Varga 3f3be880fa [jit] Remove some duplicate declarations. 2017-03-02 19:45:10 -05:00
Zoltan Varga 1a07a83f17 [jit] Fix MethodAccessExceptions, the caller and callee were switched. (#4465) 2017-03-02 19:21:08 -05:00
Ludovic Henry 30d60224a8 [threads] Remove mono_threads_create_thread (#4411) 2017-03-02 18:47:41 -05:00
Zoltan Varga c667ba8f62 [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.
2017-03-02 16:08:00 -05:00
Ludovic Henry a5624bf9ea [threads] Remove dead field cached_culture_info (#4410) 2017-03-02 16:06:27 -05:00
Johan Lorensson 5134b17082 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.
2017-03-02 15:09:19 -05:00
Rodrigo Kumpera a19175129f Merge pull request #4454 from kumpera/allow_sioc_with_managed_impl
Allow banned assemblies with LoaderFrom
2017-03-02 14:45:00 -05:00
Nikolay Amiantov c6de69eb21 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.
2017-03-02 20:28:07 +01:00
powerctrl f9e87491df 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
2017-03-02 14:20:27 -05:00
monojenkins eec02ff936 [msvc] Update csproj files (#4461) 2017-03-02 18:55:37 +01:00
Marek Safar 86aa29ba9c Bump cecil 2017-03-02 17:56:05 +01:00
Ludovic Henry 3f86444112 [threads] Remove mono_threads_suspend_needs_abort_syscall (#4450) 2017-03-02 09:55:31 -05:00
lateralusX eca868c73c Smaller code formatting changes. 2017-03-02 12:36:11 +01:00
Zoltan Varga e71a7f33ef [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.
2017-03-02 06:22:06 -05:00
Rodrigo Kumpera d2a6ce3a93 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.
2017-03-01 18:15:56 -05:00
Zoltan Varga 4d7109cceb [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) 2017-03-01 18:05:51 -05:00
Marek Safar f6b11e2213 [corlib][System] Concurrent collections from corefx 2017-03-01 23:35:15 +01:00
Ludovic Henry d01c819b05 [threads] Remove unused mono_thread_internal_stop (#4449) 2017-03-01 14:19:58 -05:00
Rodrigo Kumpera 8059fb5c5c [loader] Revert allowing SIOC 4.3. This is fine for now as we support LoadFrom as a work-around. 2017-03-01 10:34:47 -08:00
Rodrigo Kumpera 2b10be3758 [loader] Pass LoadFrom down to image loading so we can make decisions based on that. 2017-03-01 10:17:32 -08:00
Rodrigo Kumpera 16e5b3dbf8 Pass LoadFrom info down to assembly loading. 2017-03-01 09:48:33 -08:00
Rodrigo Kumpera 8b671a8c31 Merge pull request #4373 from NattyNarwhal/haiku
Restore Haiku support
2017-03-01 12:08:38 -05:00
Rodrigo Kumpera 5aa5218a13 [runtime] SIOC 4.3.0 has a managed impl that works under mono. Don't ignore it. 2017-02-28 16:27:40 -08:00
Rodrigo Kumpera 9a09cb3ca5 [tools] Update nuget hash extractor so we don't block SIOC 4.3.0. 2017-02-28 16:27:14 -08:00
Bernhard Urban f9dcaa74a9 [interpreter] rename interpreter to interp
for folks without autocompletion :P
2017-02-28 22:59:28 +01:00
Bernhard Urban 271f003d33 [generics.cs] enable more testcases for interpreter 2017-02-28 22:59:28 +01:00
Bernhard Urban b5a4413ca9 [interpreter] use explicit addressing for stack slots 2017-02-28 22:59:28 +01:00
Bernhard Urban 78da0216d2 [interpreter] add basic-vectors.cs to richeck target 2017-02-28 22:59:28 +01:00
Bernhard Urban f39517dcc9 [interpreter] add {exceptions,devirtualization,basic-simd}.cs to richeck target 2017-02-28 22:59:28 +01:00
Bernhard Urban a9fc05d4af [interpreter] add floating point support to icall trampoline, add basic-math.cs to richeck target 2017-02-28 22:59:28 +01:00
Bernhard Urban 9c630f56ce [interpreter] add arrays.cs to richeck target 2017-02-28 22:59:28 +01:00
Bernhard Urban 57172b4f19 [objects.cs] enable last two remaining tests for interpreter
\o/
2017-02-28 22:59:28 +01:00
Bernhard Urban e6de93e0c3 [interpreter] fix array built-ins wrt. multiarray access 2017-02-28 22:59:28 +01:00
Bernhard Urban 8946cb628f [interpreter] fix metadata access for ldtoken insn in wrappers 2017-02-28 22:59:28 +01:00
Bernhard Urban 29455cce9b [interpreter] implement ref type for ldelem bytecode 2017-02-28 22:59:28 +01:00
Bernhard Urban c0eb4ba374 [interpreter] install stack walking callback 2017-02-28 22:59:28 +01:00
Bernhard Urban a5aa5a1354 [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. 2017-02-28 22:59:28 +01:00
Bernhard Urban 5b30a15806 [interpreter] allow generic inst type in icall trampoline 2017-02-28 22:59:28 +01:00
Bernhard Urban 550d7b0095 [interpreter] if unboxing is required on virtcall, point into object instead of copying 2017-02-28 22:59:28 +01:00
Bernhard Urban 4accf0d718 [generics.cs] test calling an interface, that's implemented by a generic value type 2017-02-28 22:59:28 +01:00
Bernhard Urban 1e7d4e1401 [interpreter] properly inflate method on generic virtual call 2017-02-28 22:59:28 +01:00
Bernhard Urban 02782549c3 [interpreter] inflate method signature for delegate.invoke () 2017-02-28 22:59:28 +01:00
Bernhard Urban 3f6f50317d [interpreter] inflate signature for calli with proper generic_context 2017-02-28 22:59:28 +01:00
Bernhard Urban 959d68eacc [object/interpreter] add trap for future pitfalls 2017-02-28 22:59:28 +01:00
Bernhard Urban bf71c7a73c [interpreter] add init_delegate callback
and set `method` field in delegate
2017-02-28 22:59:28 +01:00
Bernhard Urban bc59e605dd [interpreter] use jit icall for delegate ctor 2017-02-28 22:59:28 +01:00
Bernhard Urban 159153b539 [trampolines] make sure no delegate trampoline is created in interpreter mode 2017-02-28 22:59:28 +01:00
Bernhard Urban 84e9a10987 [objects.cs] testcase for delegate with instance method that uses `this' 2017-02-28 22:59:28 +01:00
Bernhard Urban ca8f94773d [interpreter] pop extra arg in CEE_MONO_CALLI_EXTRA_ARG 2017-02-28 22:59:28 +01:00
Rodrigo Kumpera f14b6234e4 Merge pull request #4440 from kumpera/fix-assembly-remapping
[runtime] Fix assembly remapping by using a hashtable. Fixes #52846 and #52743
2017-02-28 12:23:26 -08:00
monojenkins 66d987e38b [msvc] Update csproj files 2017-02-28 17:37:29 +01:00
lateralusX d135465fba Improve unwind support on Windows x64.
This commit improves the unwind support on Windows x64 by implementing a number
of missing features. It also adds support for out of proc function table callback
module on older OS versions and switch to different function table methods
(growable function tables) on Win8/Win2012Server and later OS versions.

Commit aligns more to the windows x64 prolog/epilog ABI, but since mono
uses negative offsets from frame pointer while x64 windows uses positive, it is
not possible to do a 100% "correct" representation in the prolog, but if we don’t
give the OS unwinder the full unwind metadata in the frame pointer use case,
we can trick unwinder to do the right thing presenting correct callstacks in
debuggers.

Commit includes representation of windows unwind info in mono's unwind data
using extensions to better integrate windows specific unwind info in
areas currently not supported (like trampolines). It will also be easier to implement
unwind info in full AOT objects in the future, if windows specific unwind data is
included in mono’s unwind data structures.

On Win8/Win2012Server and later OS versions, all function table data is registered
using growable function tables giving full support for callstacks on live debug targets
and crash dumps. On previous OS versions function table callbacks are used together
with an out of proc module. This works for live debugging in WinDBG and Visual Studio
(if right permissions are given to the debuggers to load out of proc unwind module).
Crash dumps works as expected in WinDBG but currently not in Visual Studio for older OS
versions using callback support. If that use case needs to be supported it needs to be
solved in a separate PR, but since we support crash dumps in Visual Studio on later OS
versions and in WinDBG on earlier, it is still possible to analyze crash dumps by picking
the right tool.

Debuggers needs some additional information to work with function table callbacks out of proc
modules (NOTE, this is NOT needed on Win8/Win2012Server and later).

WinDBG:

To just do live debugging, it is possible to run the following command in WinDBG,

settings set EngineInitialization.VerifyFunctionTableCallbacks=false

To do crash dump analysis the following registry key needs to be set,

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\KnownFunctionTableDlls

Add the full path to mono-2.0-dac-sgen.dll matching the mono-2.0-sgen.dll as a 32-bit REG_DWORD.

NOTE, adding the registry key removes the need to set the setting.

Visual Studio:

To do live debugging, set the same registry key as WinDBG use case.
2017-02-28 14:52:41 +01:00
Vlad Brezae d899b02874 Merge pull request #4381 from BrzVlad/feature-generational-hash
[sgen] Generational MonoGHashTable
2017-02-28 14:30:18 +02:00
Rodrigo Kumpera 5e0d39a8a1 [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.
2017-02-27 16:46:00 -08:00
Alexander Köplinger 2a239b5205 [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.
2017-02-27 23:43:56 +01:00
Andi McClure c2c4503360 Merge pull request #4438 from xmcclure/monodis-fix
Fix monodis
2017-02-27 16:00:48 -05:00
Andi McClure 0c38b2846a 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).
2017-02-27 15:54:05 -05:00
Rodrigo Kumpera 6025544e01 Merge pull request #4433 from kumpera/android-fixes
Fix a few issues on Android
2017-02-27 15:46:03 -05:00
Rodrigo Kumpera 34012db895 [jit] Rewrite some logging to work on embedded systems. 2017-02-27 12:45:29 -08:00
Rodrigo Kumpera f35595be4d [jit] Fix LMF codegen on android arm64.
Android doesn't have fast tls either, so we must use the jit_tls variant.
2017-02-27 12:45:28 -08:00
Rodrigo Kumpera e461b821b1 [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.
2017-02-27 12:45:19 -08:00
Aleksey Kliger (λgeek) b7f7f8c40d [runtime] Mark mono_error_init external only. (#4437)
Runtime should use the error_init() from mono/utils/mono-error-internals.h
2017-02-27 15:08:48 -05:00
Vlad Brezae cb21cf2519 Merge pull request #4434 from BrzVlad/fix-unload-hang
[threads] Don't ignore abort requests in abort protected blocks
2017-02-27 22:05:27 +02:00
Marek Safar f88093694b Update ms-test-suite 2017-02-27 18:20:45 +01:00
Marek Safar 91cd0472de [System.Numerics] Use corefx implementation 2017-02-27 18:20:45 +01:00
Rodrigo Kumpera f89d6b0c76 Merge pull request #4431 from vkargov/vk-leaking-points
[runtime] Fix memory leak in mono_save_seq_point_info().
2017-02-27 11:34:02 -05:00
Calvin 530ad57bc9 Haiku hrev50954 makes this ifdef unnecessary 2017-02-27 11:27:55 -04:00
Calvin 8120d7baad More proper detection of reset_priority, make stub for Haiku 2017-02-27 11:27:53 -04:00
Calvin 79f69c8cd7 Fix eglibc configure script on Haiku
Now properly recognizes -ltextencoding
2017-02-27 11:27:52 -04:00
Calvin 52d4b9dcb7 Improve build and configure
* detect sys/errno.h

* Fix errenous LIBS in haiku

* use HAVE_MINCORE
2017-02-27 11:27:51 -04:00
Calvin 3e2a367d91 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?)
2017-02-27 11:27:50 -04:00
Calvin 68c190b1d6 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.
2017-02-27 11:27:49 -04:00
Calvin ce4977fd6c Get support libraries compiling
These return no-ops, but its enough to make it happy
2017-02-27 11:27:47 -04:00
Calvin 487b036c28 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.
2017-02-27 11:27:46 -04:00
Vlad Brezae bc25f308ca [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.
2017-02-25 02:59:14 +02:00
Vladimir Kargov 7dc414e181 [runtime] Fix memory leak in mono_save_seq_point_info(). 2017-02-24 13:43:44 -08:00
Zoltan Varga 655ac68c8a [runtime] Speed up mono_icall_start()/mono_icall_end() a bit by using inline versions of the MonoError functions. (#4424) 2017-02-24 12:16:15 -05:00
Aleksey Kliger (λgeek) 5c11fe6475 [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.
2017-02-24 12:15:33 -05:00
Zoltan Varga 6a8c21d3ea [runtime] Add fastpaths to the stelem wrappers for the case when the array element type and the value type are the same. (#4427) 2017-02-24 11:24:31 -05:00
Marek Safar de9d6af30d [Mono.Data.Sqlite] Add test for b78f4f6e5f 2017-02-24 16:31:54 +01:00
Marek Safar 7584a761ba [Mono.Data.Sqlite] Change default datetime convert format to excluded datetime kind. Fixes #46929 2017-02-24 16:18:43 +01:00
Alexander Köplinger 244d35f301 Revert "[Facades] Build netstandard.dll with net_4_x profile by default"
It broke the build.
2017-02-24 14:28:00 +01:00
Ludovic Henry 98a369ffa9 [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.
 =================================================================
```
2017-02-24 08:19:10 -05:00
Ludovic Henry 4fb9e11be7 [hybrid] Fix more tests run 2017-02-24 08:02:39 -05:00
Ludovic Henry 874d6d4481 [hybrid] Enable COM, Remoting and AppDomains runtime support 2017-02-24 08:02:39 -05:00
Alexander Köplinger caaad87769 [Facades] Build netstandard.dll with net_4_x profile by default 2017-02-24 12:53:10 +01:00
Marek Safar bafdce393e [mcs] Update 995e5620fb to do actual comparison 2017-02-24 10:01:01 +01:00
monojenkins 5927c87748 [msvc] Update csproj files 2017-02-24 08:22:12 +01:00
Zoltan Varga 491730fbc3 [jit] Remove an #ifdef ENABLE_LLVM from mini-os.h, the cross-compile genmdesc.pl can't handle it. 2017-02-23 17:26:55 -05:00
Rodrigo Kumpera 26748dcdbf Merge pull request #4419 from BrzVlad/fix-oom-nre
[sgen] Fix oom nre
2017-02-23 13:14:23 -08:00
Zoltan Varga b36c8440d3 [linker] Update the mscorlib descriptor with missing generic interfaces. 2017-02-23 15:37:23 -05:00
Alexis Christoforides 6d107fdeca Update Bockbuild 2017-02-23 15:13:36 -05:00
Alexander Köplinger a7bed9a7fc Force LF line endings for .sources and Makefiles too
This should fix the Windows build.
2017-02-23 16:38:52 +01:00
Marek Safar 995e5620fb [mcs] Use correct types comparer for comparing hidden imported interface members. Fixes #51522 2017-02-23 16:14:23 +01:00
Alexander Köplinger 8d0e921d8b Fix Windows build due to line ending changes in sed
The recent sed update in cygwin [1] changed the way sed handles
carriage returns. This meant that every .in file we processed
still contained CR, which doesn't work for .sh files.

Force LF line endings for those files (and also other shell scripts).

[1] https://cygwin.com/ml/cygwin-announce/2017-02/msg00036.html
2017-02-23 14:21:55 +01:00
Marek Safar f1fa4ecd4d [mcs] Emit leave for redirected jumps out of rewritten finally exit scope. Fixes #52599 2017-02-23 12:30:42 +01:00
Marek Safar 421088dfce [System] Tweak socket test 2017-02-23 12:30:42 +01:00
Marek Safar 8e7cae914b Fixes windows po/ build 2017-02-23 11:34:45 +01:00
Marek Safar a5f5ca7e4b [System] Update flaky test 2017-02-23 11:08:14 +01:00
Egor Bogatov 368c02f522 [System.Data] referencesource -> corefx: ProviderBase & SqlClient stuff (#4383)
* [System.Data] referencesource -> corefx

* [System.Data] referencesource -> corefx

* [System.Data] corefx migration, fix ActivityCorrelator

* [System.Data] use DbProviderFactory, DbConnectionPoolGroupProviderInfo, OperationAbortedException from corefx
2017-02-23 01:02:54 +01:00
Vlad Brezae 0fc4608b1b [sgen] Throw OOM also from the managed allocator
Allocation functions from object.c correctly throw OOM when sgen allocation returns NULL. When allocating with the managed allocator we invoke sgen directly (as a fallback) and we didn't handle the NULL return case.

Fixes #52437
2017-02-23 01:33:09 +02:00
Vlad Brezae 8d3e2a3c82 [sgen] Rename confusing variable 2017-02-23 00:56:29 +02:00
Vlad Brezae 8fdae0685f Merge pull request #4403 from BrzVlad/fix-workers-par-context
[sgen] Lock around worker start, not only finishing
2017-02-23 00:35:22 +02:00
Rodrigo Kumpera ef88a33d1c [loader] When loading the parent of a GTD fails. We must disable gclass recording for it.
mono_class_create_from_typedef: When loading a GTD, we track what ginsts' of it were loaded in the meanwhile
so we can fix some information that will be wrong (such as if it's a VT or not).

Were not stopping the recording when a GTD type failed to load its parent. This would result in *A LOT* of ginsts
being captured and would cause issues during domain unload.
2017-02-22 14:24:28 -08:00
Zoltan Varga cb947b7a56 [arm] Fix the passing of structs with 8 byte alignment with llvm on armeabi, they need to be passed as an int64 array to let llvm know that it might need to insert a dummy argument so they are passed in a even register pair. Fixes #52548. 2017-02-22 15:08:41 -05:00
Ludovic Henry 25a554dc6b [threads] Ensure we have balanced appdomain push/pop when attaching the thread on shutdown (#4416) 2017-02-22 14:55:59 -05:00
Marek Safar f03f5bf483 Bump corefx 2017-02-22 20:20:36 +01:00
Zoltan Varga 53925041e1 [runtime] Use TARGET_WIN32 instead of HOST_WIN32 when setting calling conventions, so cross compilers running on windows do the right thing. (#4412) 2017-02-22 12:49:10 -05:00
Zoltan Varga 9389d44cba [runtime] Fix mono_bitset_count () so it works on win64 as well. (#4413) 2017-02-22 12:47:47 -05:00
Marek Safar e1328b4a36 Bump ikvm 2017-02-22 11:19:49 +01:00
Marek Safar 16dd36fe77 [System] Test fix for watch 2017-02-22 10:35:55 +01:00
Ludovic Henry f8f323d671 [Process] Fix NonChildProcessWaitForExit Exited callback (#4409) 2017-02-21 18:42:42 -05:00
Alexis Christoforides 4c4176ac3f Update bockbuild 2017-02-21 18:21:56 -05:00
Rodrigo Kumpera 46a0e22cc5 Merge pull request #4380 from alexanderkyte/conflicting_attrs
[runtime] Fail gracefully when method has conflicting attributes
2017-02-21 16:45:51 -05:00
Zoltan Varga a794f55d16 [jit] Remove some dead code. 2017-02-21 16:05:00 -05:00
Ludovic Henry 0d2d3266b7 [threadpool] Do not swallow exception in RegisterWaitForSingleObject callback (#4408) 2017-02-21 15:34:03 -05:00
Alexis Christoforides 3d7713edcc Update bockbuild 2017-02-21 14:41:24 -05:00
Marek Safar f786b0d001 Revert "[configure] Remove mcs endianess check (it shouldn't be needed)"
This reverts commit 9aa9822808.
2017-02-21 19:50:17 +01:00
Alexis Christoforides 3ab1a56f73 Merge pull request #4169 from evincarofautumn/fix-xmm-scanning-mac-x86
Fix XMM scanning on Mac x86.
2017-02-21 13:41:23 -05:00
Marek Safar c51a8e79ef Bump cecil 2017-02-21 17:59:14 +01:00
monojenkins 77779a3798 [msvc] Update csproj files 2017-02-21 17:34:50 +01:00
Edward Betts 539a6580da correct spelling mistakes (#4405) 2017-02-21 12:03:07 +01:00
Marek Safar 4ccd94d7cc [mcs] Add codegen for null operator on result of awaited instance expression of property access. Fixes #52578 2017-02-21 11:57:44 +01:00
Marek Safar 9aa9822808 [configure] Remove mcs endianess check (it shouldn't be needed) 2017-02-21 11:57:44 +01:00
Marek Safar bc209e41d7 [Microsoft.CSharp] Replaced with CoreFX implementation 2017-02-21 10:07:24 +01:00
Marek Safar 4ebb99f7a2 Merge pull request #4398 from marek-safar/mono.csharp
[Mono.CSharp] Remove type conflicts with mscorlib types. Fixes #52590
2017-02-20 17:26:47 +01:00
Marek Safar 1171b0c1c0 Bump corefx 2017-02-20 17:16:02 +01:00
Marek Safar 70deea8dde [mcs] Inflate constraints of compiler generated proxy base call methods. Fixes #52294 2017-02-20 17:14:40 +01:00
Vlad Brezae c5efaeb498 [sgen] Lock around worker start, not only finishing
If we don't take the finished_lock when starting workers, the workers that we started could have already finished the work and switch to non-parallel context before we are even able to signal all of them.
2017-02-20 18:11:52 +02:00
Vlad Brezae ea9d8f02a9 [runtime] Use proper hash function for key_gc hashes
If the key gets moved by the GC and we only hash based on current address, we are left with invalid hashing.
2017-02-20 14:33:28 +02:00
Vlad Brezae 79c1053d83 [runtime] Counter for max hashtable chain length 2017-02-20 14:24:27 +02:00
Vlad Brezae 1339280bf5 Revert "[Utils] Use g_direct_equal if NULL is passed in as the equals function"
This reverts commit 914ecbcfec.

Having equal_func NULL is an optimization to avoid unnecessary calls.
2017-02-20 14:24:26 +02:00
Vlad Brezae 5d373fb3e2 [sgen] Include optimization for arm/arm64 targets 2017-02-20 14:24:26 +02:00
Vlad Brezae 09e456bd98 [runtime] Avoid equal calls in MonoGHashTable
mono_g_hash_table_find_slot is very hot.
2017-02-20 14:24:25 +02:00
Vlad Brezae dd4c3c2277 [runtime] Use better hashing for refobject_hash 2017-02-20 14:24:25 +02:00
Vlad Brezae 4f1a64acb0 [runtime] Reduce collisions with open addressing hashes
In some hashtables we add multiple elements with the same hash. If we use only the address for hashing they would cluster since they are likely to have close addresses.
2017-02-20 14:24:24 +02:00
Vlad Brezae 779d417c8f [sgen] Generational mono g hashtable
We mark cards when storing in hashtables. During minors, instead of scanning the entire tables, we only scan the sections for the dirty cards. In order to simplify the implementation we split into separate key/value tables.

To achieve this, instead of using an user descriptor for the hashtable structure, we directly register the tables and we create a new type of root descriptor for it to teach sgen how to find pointers in it. In addition to the precise scan of the root, which is done during majors, we also support a remset scan for it. We expect all roots registered as ROOT_TYPE_WBARRIER, to use this new descriptor (ROOT_DESC_VECTOR). In order for a root descriptor to be in the ROOT_TYPE_WBARRIER category, it has to have a defined remset scan mode.
2017-02-20 14:24:23 +02:00
Marek Safar 765b41d0eb [Mono.CSharp] Simplify .sources structure 2017-02-20 09:49:19 +01:00
Alexander Kyte a26b7f61fe [runtime] Fail gracefully when method has conflicting attributes 2017-02-19 19:44:13 -05:00
Zoltan Varga 15a6c8a875 [jit] Fix support for gsharedvt constrained calls which return enums. Fixes #52600. 2017-02-18 16:37:10 -05:00
Ludovic Henry cd1fb04733 [threadpool] Let the runtime abort and wait for threads on shutdown (#4348)
* [threadpool] Let the runtime abort and wait for threads on shutdown

We would previously have the threadpool abort and wait for its threads during runtime shutdown, but it would tend to be buggy or leaky. The runtime already takes care of aborting and waiting all the other threads, so we simply also let it take care of the threadpool threads.

* [threadpool] Wake up all parked threads on shutdown

This fixes a hang at shutdown, where one or more threadpool threads might not be unparked and only exit after the timeout, delaying runtime shutdown.
2017-02-17 14:47:24 -05:00
Ankit Jain b495a722fe [xbuild] Show the deprecation notice with logo, and so hide it with (#4399)
`/nologo`. It is not controlled by logging levels now.
But we also show the deprecation notice if we couldn't parse
the arguments, which would be more likely to be noticed by a user.
2017-02-17 13:32:13 -05:00
Vlad Brezae cb44ebe851 [sgen] Move some cardtable functions to sgen 2017-02-17 18:03:47 +02:00
Vlad Brezae 721a1200e4 [runtime] Open addressing for MonoGHashTable
Some whitespace and other cleanup fixes
2017-02-17 18:03:45 +02:00
Ludovic Henry f18e9a35e7 [ProcessTest] Ensure we enable raising Exited event (#4397) 2017-02-17 09:23:39 -05:00
Marek Safar f50619864a [Mono.CSharp] Remove type conflicts with mscorlib types. Fixes #52590 2017-02-17 14:50:47 +01:00
Jonathan Pryor 2fc85bb367 Merge pull request #4396 from radical/xbuild-deprec-fix
[xbuild] Don't show the deprecation notice for minimal or quiet logging
2017-02-16 17:17:37 -05:00
Bernhard Urban 4281399ba4 [interpreter] move interpreter specific trampoline definition to mini.h, also move trampoline outside of DISABLE_JIT guard 2017-02-16 23:09:38 +01:00
Bernhard Urban bdc40b7009 [interpreter] clean up exported symbols and header organization 2017-02-16 23:09:38 +01:00
Bernhard Urban 6a1bc81524 [interpreter] remove temporary generic-interp.cs, and use Category attribute to disable testcases that fail with the interpreter
add objects.cs as well and disable test cases accordingly.
2017-02-16 23:09:38 +01:00
Bernhard Urban f0e2ab213d [interpreter] respect Category Attribute for --regression tests 2017-02-16 23:09:38 +01:00
Bernhard Urban 5f6f7b17bc [interpreter] hacky implementation for create_method_pointer
not quite sure yet what the requirements are, but this works now for
executing a simple hello world :-) in metadata/gc.c we use this
interface to call the Finalize method on objects.
2017-02-16 23:09:38 +01:00
Bernhard Urban a26da0742b [interpreter] force vtable setup before method lookup 2017-02-16 23:09:38 +01:00
Bernhard Urban 5a20b20939 [interpreter] skip boxing if it's already a non-valuetype 2017-02-16 23:09:38 +01:00
Bernhard Urban 27b511e9e8 [interpreter] fix misc type resolving issues 2017-02-16 23:09:38 +01:00
Bernhard Urban 9c4c68f6c0 [interpreter] pop from value type stack when loading field from value type 2017-02-16 23:09:38 +01:00
Bernhard Urban 66f515c6e6 [interpreter] fix off-by-one errors around loading and storing args 2017-02-16 23:09:38 +01:00
Bernhard Urban 36506fd65b [interpreter] implement constrained.callvirt insn 2017-02-16 23:09:38 +01:00
Bernhard Urban 4b6221f88e [interpreter] special casing for string objects 2017-02-16 23:09:38 +01:00
Bernhard Urban 1d38766f1d [interpreter] implement {st,ld}elem for value types 2017-02-16 23:09:38 +01:00
Bernhard Urban 04fd965bc6 [interpreter] use runtime helper to unbox `this' 2017-02-16 23:09:38 +01:00
Bernhard Urban 42d14faddb [interpreter] make mint_{ldind_i,box} so that it can also operate on elements deeper on the stack 2017-02-16 23:09:38 +01:00
Bernhard Urban 1be92405d9 [interpreter] allow value types to be passed in interp->native transition and up to six args
won't work for windows.
2017-02-16 23:09:38 +01:00
Bernhard Urban 2e591671a4 [interpreter] simplify {ld,st}sfld insns and use runtime helpers 2017-02-16 23:09:38 +01:00
Bernhard Urban 2b8362fa4a [interpreter] be more verbose for debugging 2017-02-16 23:09:38 +01:00
Bernhard Urban 069b2287b0 [interpreter] respect GENERICINST in stackval_from_data 2017-02-16 23:09:38 +01:00
Bernhard Urban 65a94cb15f [interpreter] use mono_value_copy instead of doing a manual memcpy. 2017-02-16 23:09:38 +01:00
Bernhard Urban daae700d53 [interpreter] add more regression tests to generics-interp.cs 2017-02-16 23:09:38 +01:00
Bernhard Urban 8d11edbb18 [driver] allow --interpreter for regular execution 2017-02-16 23:09:38 +01:00
Ankit Jain 0d08e2b3fb [xbuild] Don't show the deprecation notice for minimal or quiet logging
.. levels. This is useful for scripts that might depend on minimal/quiet
levels, to parse output of a specific target execution, eg.
Xamarin.Android .
2017-02-16 16:57:07 -05:00
Ludovic Henry 3c31172e41 [threadpool] Extract ThreadPoolDomain creation from tpdomain_get 2017-02-16 15:36:44 -05:00
Ludovic Henry 804044e4bd [threadpool] Make sure we check if the runtime is shutting down in case of interruption 2017-02-16 15:36:44 -05:00
Ludovic Henry ad4eb74c6f [threadpool] Make ThreadPoolWorker staticaly allocated 2017-02-16 15:36:44 -05:00
Ludovic Henry f48449d629 [threadpool] Make ThreadPool global variable staticaly allocated
We wouldn't free it on cleanup, so we would end up leaking it anyway.
2017-02-16 15:36:44 -05:00
Aleksey Kliger 28e8525372 [w2file] Fix shutdown assert in checked mode
console_close triggered a MONO_REQ_GC_SAFE_MODE assert in checked mode on
because the console handles were unref'd which caused them to close.

Until w32handle is coop-aware, just transition to GC unsafe mode (a noop if
it's already in unsafe) in these callbacks.
2017-02-16 13:45:00 -05:00
Aleksey Kliger ed1d25225b [w32file] Transition to GC safe mode when file handles unref'd.
And don't transition around calls to mono_w32file_close which does its own coop transition
2017-02-16 13:45:00 -05:00
Aleksey Kliger 2166f0315a [checked] Include file and line number in thread state assertions. 2017-02-16 13:45:00 -05:00
Alexander Köplinger f0945bf7f6 Revert "[ci] Temporarily use http url to download server until cert is fixed"
This reverts commit 9281d4a7e6.

SSL works again now on the download server
2017-02-16 19:40:35 +01:00
Ludovic Henry b6f511dc16 [process] Allocate a handle even for non-child processes (#4393) 2017-02-16 13:10:33 -05:00
Rodrigo Kumpera deda0b8d8c Merge pull request #4385 from mono/work-btls-02152017
[btls]: Make configure fail when building on Android without '--with-btls-android-ndk'
2017-02-16 09:42:57 -08:00
monojenkins cb0267cf43 [msvc] Update csproj files (#4395) 2017-02-16 17:35:07 +01:00
Ludovic Henry e697335417 [treadpool] Fix flaky System.Threading.ThreadTest.SetNameInThreadPoolThread test (#4392) 2017-02-16 07:20:41 -05:00
Ludovic Henry ff5956eacb [socket] Add EPROTOTYPE error case (#4391)
Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=52549
2017-02-16 07:18:12 -05:00
Rodrigo Kumpera fd6829c5b9 Merge pull request #4376 from kumpera/test-hardneing
Disable some flaky tests and harden another one.
2017-02-16 01:01:33 -08:00
Alexander Köplinger ed685e8b76 [System] Fix failing ClientWebSocket test
The wrong part of the ifdef was deleted in a4df7d4923,
we need to InvalidOperationException instead of PNSE.
2017-02-16 02:58:43 +01:00
Ludovic Henry b7f2b467d6 [socket] Fix bad parameter passed to select (#4390)
If fd is equals to FD_SETSIZE, then we pass (FD_SETSIZE + 1) as first parameter to select, making it return EINVAL.
2017-02-15 20:56:49 -05:00
Alexander Köplinger 1063240b86 Merge pull request #4386 from akoeplinger/fix-netstandard
Fix netstandard facade build and remove the NETSTANDARD ifdef from profiles
2017-02-16 02:55:45 +01:00
Ludovic Henry 5f7e9663af [socket] Fix race on SocketAsyncResult (#4389)
It might be possible that the callback modifies the current SocketAsyncResult via the Init method. We observe it with AcceptAsync with a ReceiveAsync in the callback.
2017-02-15 20:46:26 -05:00
Marek Safar a4df7d4923 [System] Fixes failing tests on mobile 2017-02-16 00:04:19 +01:00
Rodrigo Kumpera aaf7b009c0 [corlib] Assert of wait failure. 2017-02-15 14:34:29 -08:00
Rodrigo Kumpera a6c34bea95 [configure.ac] Don't set TARGET_ANDROID when cross compiling to non-android linux. 2017-02-15 14:31:39 -08:00
Rodrigo Kumpera 36f29ca619 [configure.ac] Don't check for getpwnam_r and getpwuid_r on android as AC_CHECK_FUNCS incorrectly detects them on Android. 2017-02-15 14:30:29 -08:00
Alexander Köplinger 75702b65c9 [bcl] Remove the NETSTANDARD ifdef from profiles
We're always using the code now and will deal with the
differences to .NET 4.x by producing reference assemblies.
2017-02-15 19:53:59 +01:00
Alexander Köplinger b50ac20959 [Facades] Fix netstandard facade build 2017-02-15 19:33:25 +01:00
Martin Baulig c363aae8d1 [btls]: Make configure fail when building on Android without '--with-btls-android-ndk'.
When building on Android with BTLS support, the '--with-btls-android-ndk' argument
is required to teach the underlying cmake the NDK location.  Fixes #52511.
2017-02-15 19:13:58 +01:00
monojenkins 6e89ac3b20 [msvc] Update csproj files (#4384) 2017-02-15 17:33:08 +01:00
Marek Safar 85f0de201f [mcs] lifted binary operator for decimal arguments need to call user operator for comparison. Fixes #52086 2017-02-15 17:20:29 +01:00
Alexander Köplinger b117a53b8f [man] Remove outdated version numbers (#4382)
We haven't been consistent in keeping those version numbers
up to date as we bump Mono's version so it's less confusing
to not show them in the manual pages.

`mono --version` is and has been the source of truth.
2017-02-15 17:01:34 +01:00
Marek Safar 09d49bbe57 [mcs] Always resolve new initializers with conditional access receivers enabled. Fixes #52340 2017-02-15 14:36:03 +01:00
Marek Safar e98d3b9ca2 [System.Net.Http] Add Transfer-Encoding: chunked special handling. Fixes #47599 2017-02-15 13:10:43 +01:00
Marek Safar b472a0391c Merge pull request #4371 from marek-safar/cecil-update
Cecil update
2017-02-15 12:07:58 +01:00
Marek Safar 0605fe6928 [Mono.CodeContracts] Read debug symbols only when they are going to be used 2017-02-15 08:57:52 +01:00
Marek Safar 1e1016775e Cecil update 2017-02-15 08:57:51 +01:00
Rodrigo Kumpera 779b5e8aed [corlib] Rewrite the timer tests to something that can actually be verified. 2017-02-14 16:33:28 -08:00
Alexander Köplinger 17c5a00c59 [System.ServiceModel.Internals] Use the mobile sources for testing_aot_full and orbis profile (#4378) 2017-02-14 22:13:47 +01:00
Aleksey Kliger 965750f13a [w32file] transition to GC unsafe in file handle close callbacks.
Followup to last commit (f238640c9f).
We need to transition to unsafe to call file_share_release and the _wapi_
functions, and then back to safe to call close(2).
2017-02-14 12:39:59 -05:00
Aleksey Kliger (λgeek) f238640c9f [w32file] Push coop transitions into functions, closer to syscalls (#4370)
* [w32file] Push coop transitions into functions, closer to syscalls

Previous the coop transitions happened in the icalls and high level
platform-independent functions.  Now they surround syscalls and platform API
calls, instead.

(Among other benefits, this fixes a problem where MoveFile on unix was
implemented in some circumstances in terms of CopyFile which resulted in an
illegal coop transition from blocking to blocking.)

* There is a FIXME with `mono_w32handle_new_fd` and `mono_w32handle_close`: the w32handle API is not coop-friendly yet, so we have to switch to gc safe mode around calls to `w32handle_new_fd` and `w32handle_close`.  In the case of `w32handle_close`, it calls back into the w32file functions `pipe_close`, `console_close` and `file_close`.  So the calls to `close(2)` inside those functions are not surrounded by transitions to GC safe mode - instead they require that we're already in safe mode (as is the case when they're called from w32handle).
2017-02-14 11:41:38 -05:00
Neale Ferguson 16edc1e552 Fix DateTime.Now and CurrentTimeToUtc during DST transition time (#4172)
* During the ambiguous hour .NET will return the DST version of the time whereas mono is returning the base time. Rather than use the transitions array we look up the Adjustment rules (which are created from the transition rules in the first place).

In addition, CurrentTimeToUtc() also has problems around the transition time.

Added test and fixed another.

Fixes #43805.

* Despite the tutorial on msdn about daylight saving time, .NET interprets the 'ambiguous' hour of DST as being DST rather than standard time which is what mono did.
2017-02-14 14:47:21 +01:00
Rodrigo Kumpera 769d2a66b7 [corlib] Harden a GC test against possible false pinnig. 2017-02-13 21:51:55 -08:00
Rodrigo Kumpera cd7a379d4d [corlib] Disable broken tests that depend on crazy precise scheduling and system timers.
The disabled tests assume perfect scheduling and non-coalescing system timers. Neither exists
on OSX Sierra, iOS or Android. This tests fail there regularly.
2017-02-13 21:38:52 -08:00
mathieubourgeois 516e1cf793 Fix when() clause cutting stack traces when filtering doesn't succeed (fix for 46661) (#4328)
* * [exceptions] When encountering a filter (when) clause, don't setup the stack trace before we know if the filter is going to work. Otherwise, any exception that isn't blocked by the when clause will have its stack trace cut at the point of the parent of the function containing the when clause
* Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=46661

* + Added test case for bug 46661
2017-02-13 21:53:05 -05:00
Alexander Köplinger 4e54ac3d4b [Facades] Update netstandard facade to latest
Includes latest changes from dotnet/standard repo.
2017-02-14 03:42:43 +01:00
Vincent Povirk 35ffcbc1a3 [tests] Fix out of tree build. (#4372) 2017-02-14 00:26:39 +01:00
Alexis Christoforides c283d07830 [MacSDK] Updated location of bundled PCL assemblies 2017-02-13 18:13:23 -05:00
Alexis Christoforides d14339d661 Bump Bockbuild 2017-02-13 17:22:07 -05:00
Alexis Christoforides 466765f73f [MacSDK] Switch back to xbuild for IronPython build. MSBuild seems to be having trouble 2017-02-13 17:05:59 -05:00
Alexis Christoforides 9887662433 Bump Bockbuild 2017-02-13 17:05:59 -05:00
Marek Safar e4bd4dbb15 [System.Net.Http] Allow re-sending StreamContent. Fixes #52448 2017-02-13 22:38:15 +01:00
Zoltan Varga 7bfb9bcb78 [jit] Disable llvm for overly complex methods, to avoid compilation slowdowns. Fixes #52475. 2017-02-13 14:35:51 -05:00
Zoltan Varga 764de0ed5d [ssa] Fix an assertion if the buffer used to keep renaming history gets full. 2017-02-13 14:35:51 -05:00
Alexis Christoforides 2fb5b32d59 Bump Bockbuild 2017-02-13 14:19:02 -05:00
Alexis Christoforides 6a5690b9af Bump bockbuild 2017-02-13 13:47:00 -05:00
Alexis Christoforides 9433d2c80a Bump bockbuild 2017-02-13 09:56:11 -05:00
Alexis Christoforides f7f2aadc63 Bump bockbuild 2017-02-13 08:29:39 -05:00
Alexis Christoforides 85b89a1f4c [MacSDK] updates 2017-02-13 07:47:46 -05:00
Alexis Christoforides ac10f4e562 [MacSDK] Update F# 2017-02-13 07:47:46 -05:00
Marek Safar aad8adc02d [System] Fixes failing tests on watch 2017-02-13 12:50:12 +01:00
Alexis Christoforides cfd8ee350b Bump bockbuild 2017-02-13 06:37:41 -05:00
Alexis Christoforides eedeb428d6 [MacSDK] Use full Mono version, incl. build number in build
Also add a VERSION file in the package.
2017-02-13 06:35:02 -05:00
Alexis Christoforides 7100d93117 [MacSDK] Update MSBuild 2017-02-13 06:35:02 -05:00
Alexis Christoforides 7e96bcfa38 Move Mac package command to scripts so that it's available without configuring 2017-02-13 06:35:02 -05:00
Marek Safar 611f3eea3e [System.ServiceModel] Disable unreliable test 2017-02-13 10:09:01 +01:00
Marek Safar eaeadc3cdd Bump roslyn to rc4 2017-02-13 09:15:25 +01:00
Ludovic Henry fa4c0b6af3 [finalizer] Suspend finalizer thread on after shutdown timeout (#4363)
Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=52429
2017-02-12 11:10:42 -05:00
Zoltan Varga 7da0d3c26b [runtime] Remove an obsolete option from --help=devel. 2017-02-10 23:41:45 -05:00
Alexander Köplinger b17ddc5c15 [tools] Install pdb files for security tools (#4364)
We don't use the global executable.make install logic for the tools
in security so we missed updating this to copy .pdb's as well.
2017-02-10 20:56:08 +01:00
Bernhard Urban 6c856a2dce [exceptions] introduce suspend-on-native-crash that suspends on every native crash
not just `SIGSEGV`. rename `suspend-on-sigsegv` but keep it as an alias around.
2017-02-10 19:55:30 +01:00
Zoltan Varga 8e49b6eb26 [runtime] Avoid holding the init lock while calling the cctor in mono_runtime_class_init (), its not needed any more. (#4361) 2017-02-10 13:47:23 -05:00
monojenkins 28173013b5 [msvc] Update csproj files 2017-02-10 18:02:08 +01:00
Alexis Christoforides 2436b702f9 Bump bockbuild 2017-02-10 11:27:31 -05:00
Marek Safar 97ad3a34d9 [System.Data] Add RESX_RESOURCE_STRING 2017-02-10 16:03:48 +01:00
Eberhard Beilharz 82974a28da [swf] Fix pasting of Unicode text
Previously pasting of Unicode text, e.g. from LibreOffice, resulted in
question marks being displayed.

This fixes Xamarin-7359.

Change-Id: I78ec4cb1bbbd0e14da91d06a6fc517bc5c91e135
2017-02-10 11:39:09 +01:00
Marek Safar 2ac4e6a5c8 [System] CodeDom from CoreFX 2017-02-10 08:54:32 +01:00
Alexis Christoforides cc8d9648c0 Bump bockbuild 2017-02-09 23:52:15 -05:00
Alexis Christoforides 95ac41a19b "WIP (auto-committed by bockbuild)" 2017-02-09 23:29:52 -05:00
Alexis Christoforides f26e4b2f6e Bump Bockbuild 2017-02-09 23:04:40 -05:00
Ludovic Henry 9393226b12 [threads] Make OSEvent alertable to fix bug #51653 (#4347) 2017-02-09 22:02:43 -05:00
Alexis Christoforides 924d93d1c5 Bump bockbuild 2017-02-09 19:00:55 -05:00
Ludovic Henry ecf2510108 [process] Improve error message for inaccessible process (#4354)
Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=51561
2017-02-09 14:57:59 -05:00
Alexander Köplinger 12b44a0e94 [Mono.Security] Check NewLocalMachinePath too for deciding if store is machine store (#4357)
The code in X509Store only checked the legacy X509StoreManager.LocalMachinePath
when deciding whether CspProviderFlags.UseMachineKeyStore should be
set when dealing with private keys.

However, with BTLS we now also have X509StoreManager.NewLocalMachinePath.

This caused an issue/regression in the recent 4.8 builds that
started importing into the BTLS cert store when using cert-sync:
https://github.com/mono/mono/commit/968c60a0f32c7a4c92568c3feda7503f99b98c94

Because cert-sync is ran at package installation time as root
on Linux we would erroneously not pass UseMachineKeyStore (because
the paths between legacy and BTLS store are different), which in turn
causes KeyPairPersistence to look into the user directory, e.g.
~/.config/.mono/keypairs. Since on a clean machine that directory
hierarchy doesn't exist, it goes on and creates it -> we now have
the ~/.config directory owned by root which means a normal user
application can't write to it anymore (like NuGet) and crashes.

The fix is to check for the BTLS store path as well so KeyPairPersistence
uses the machine path and ~/.config is not created on package installation.

See e.g. https://github.com/travis-ci/travis-ci/issues/7271
2017-02-09 18:30:53 +01:00
Marek Safar 686fae761c [build] Add simple target for easier corefx strings updating 2017-02-09 17:12:43 +01:00
Rodrigo Kumpera 3b2913ca03 Merge pull request #4248 from Unity-Technologies/boehm-gc-alloc-fixed
Implement mono_gc_alloc_fixed/mono_gc_free_fixed on Boehm to match SGen
2017-02-08 22:11:25 -08:00
Ludovic Henry 41fced547f [process] Fix Process.GetProcessesByName (#4351)
To get a process by name, we need to access the other process ProcessName, but it can fails on non-win32 platforms. This failure wouldn't be caught in the referencesource implementation trigerring this bug.

The exception we would observe would be:
 Unhandled Exception:
 System.InvalidOperationException: Process has exited, so the requested information is not available.
   at System.Diagnostics.Process.get_ProcessName () [0x0002d] in /Users/alexander/dev/mono/mcs/class/System/System.Diagnostics/Process.cs:336
   at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_ProcessName ()
   at Program.Main (System.String[] args) [0x0003b] in <9c838a66cdc44c81b38c974edcc9c029>:0
 [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Process has exited, so the requested information is not available.
   at System.Diagnostics.Process.get_ProcessName () [0x0002d] in /Users/alexander/dev/mono/mcs/class/System/System.Diagnostics/Process.cs:336
   at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_ProcessName ()
   at Program.Main (System.String[] args) [0x0003b] in <9c838a66cdc44c81b38c974edcc9c029>:0

Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=52345
2017-02-08 22:29:03 -05:00
Zoltan Varga 9780c4d801 [runtime] Fix the reflected type of Delegate.Method if the method is an inherited virtual method. Fixes #39444. (#4353) 2017-02-08 22:25:18 -05:00
Ludovic Henry 82bcac8efa [threads] Allow resetting the name of a threadpool thread (#4350)
Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=47221
2017-02-08 21:12:44 -05:00
Zoltan Varga 6df483ca43 [runtime] Add a cache for generic array helper wrappers to reduce the number created. This works because there are a lot of duplicates due to the fact that the interfaces passed to setup_generic_array_ifaces () have the same context. (#4343) 2017-02-08 18:16:09 -05:00
Zoltan Varga 740380de09 [jit] Remove the MONO_INIT_VARINFO macro, its only used in one place. (#4349) 2017-02-08 18:11:53 -05:00
Martin Baulig 8b18c84289 [btls]: Fix MonoBtlsX509Store.cs.AddTrustedRoots(). (#4340)
This internal method is only called from Mono.Btls.Interface.BtlsStore
and used by the web-tests.

Call MonoBtlsProvider.SetupCertificateStore(store) to make its
behavior consistent with the internal implementation.
2017-02-08 17:12:02 +01:00
Ludovic Henry d46d59e019 Revert "[threads] Make OSEvent alertable to fix bug #51653" (#4346) 2017-02-08 10:33:22 -05:00
Ludovic Henry 63aec27545 [threads] Make OSEvent alertable to fix bug #51653 (#4341) 2017-02-08 10:01:08 -05:00
Martin Baulig 4c6c6f0ef8 [btls]: Fix MonoBtlsProvider.SetupCertificateStore(MonoTlsSettings,bool). (#4337)
* When 'settings != null' and 'settings.CertificateSearchPaths == null',
  then we add the default paths, including the 'settings.TrustAnchors'.
  This applies to all platforms, including Android.

* In MonoBtlsContext, we can now simply call
  MonoTlsProvider.SetupCertificateStore(MonoTlsSettings,bool) instead of
  having a custom version of it.
2017-02-08 14:33:47 +01:00
Niklas Therning 1894134817 Merge pull request #4335 from ntherning/skip-unwind-info-functions-on-windows-with-disabled-jit
Skip unwind info functions on Windows when JIT is disabled
2017-02-08 11:18:55 +01:00
Niklas Therning 8bbf58446d Merge pull request #4333 from ntherning/Mono-Posix-Stdlib-do-not-clobber-Marshal.GetLastWin32Error
Make sure Stdlib.GetLastError() never clobbers Marshal.GetLastWin32Error()
2017-02-08 11:16:17 +01:00
Marek Safar 5ceccbe744 Bump corefx 2017-02-08 08:10:12 +01:00
Zoltan Varga 202a99c4eb [lldb] Avoid a crash with the mono_tramp_info_register () call in load_aot_module (). 2017-02-07 22:03:43 -05:00
Zoltan Varga a878333ecd [sdb] Add an attach test, not yet enabled. 2017-02-07 18:35:27 -05:00
Marek Safar aeabef2ae6 [xbuild] Add deprecation warning 2017-02-07 23:27:52 +01:00
Alexander Köplinger 9281d4a7e6 [ci] Temporarily use http url to download server until cert is fixed 2017-02-07 22:50:36 +01:00
Martin Baulig d3aa5f9504 [btls]: MonoBtlsError.GetError(out string, out int) returns 0, not null. (#4338) 2017-02-07 22:24:02 +01:00
Ludovic Henry ede498bb6f [threadpool] Fix hang on threadpool cleanup (#4330)
Waiting for the threadpool threads to exit on shutdown triggers a hand. The simplest solution is to not wait for them, and let the OS clean them up.

This is not an ideal solution, but this is to fix a months-long chase for this bug, and to release a less-buggy monthly release.
2017-02-07 15:09:47 -05:00
Zoltan Varga 38ceab1547 [runtime] Add a workaround for #50529 by locking around pthread_create()/pthread_join () calls so they can't happen at the same time. (#4332) 2017-02-07 14:35:50 -05:00
monojenkins 1ce00698ff [msvc] Update csproj files (#4336) 2017-02-07 17:36:06 +01:00
Niklas Therning ce46242d2c Skip unwind info functions on Windows when JIT is disabled
mono_arch_code_chunk_new()/mono_arch_code_chunk_destroy() are not compiled in
on Windows when DISABLED_JIT is defined.
code_manager_chunk_new()/code_manager_chunk_destroy() in mini-runtime.c, which
use these functions, will however be compiled in on Windows regardless of
whether DISABLED_JIT is defined or not. This causes linking failures due to
missing mono_arch_code_chunk_new()/mono_arch_code_chunk_destroy() symbols when
building on Windows and DISABLE_JIT is defined.
2017-02-07 15:09:03 +01:00
Niklas Therning bb3db1248b Merge pull request #4334 from ntherning/exclude-mono_w32socket_disconnect-on-non-desktop-uwp
Exclude mono_w32socket_disconnect() on unsupported Windows families
2017-02-07 15:00:34 +01:00
Niklas Therning 08f1fdcf14 Exclude mono_w32socket_disconnect() on unsupported Windows families 2017-02-07 10:22:15 +01:00
Marek Safar 76f89cdb64 [corlib] Update TimeZoneTest ios simulator check 2017-02-07 10:22:01 +01:00
Niklas Therning 0311475c60 Make sure Stdlib.GetLastError() never clobbers Marshal.GetLastWin32Error() 2017-02-07 09:45:06 +01:00
Niklas Therning f2f19e9503 Temp fix for broken TimeZoneInfo on Windows families without registry access
Band aid fix until we can switch to CoreRT's implementation.
2017-02-07 09:22:43 +01:00
Vladimir Kargov 2282f874a7 [tests] Remove a misplaced backslash in a grep expression. 2017-02-06 15:51:28 -08:00
Vladimir Kargov f23af186aa [runtime] Skip non-SSA variables in Abcrem. 2017-02-06 15:51:27 -08:00
Vladimir Kargov e8efa63b23 [runtime] Add the MONO_INS_FOR_EACH_REG macro. 2017-02-06 15:51:26 -08:00
Vladimir Kargov 17fe3de8e0 [runtime] Mark the correct parent contexts as recursive for recursive definitions in Abcrem. 2017-02-06 15:51:25 -08:00
Andi McClure c4034198f8 Remove comment from Thread.cs describing field removed in 4.8 2017-02-06 17:33:48 -05:00
Martin Baulig 7b847a8d61 Remove debugging spew in MonoBtlsX509LookupMonoCollection.cs. 2017-02-06 23:28:26 +01:00
Zoltan Varga 1c3c4d86b3 [arm] Use TARGET_IOS instead of __APPLE__ so we don't use the ios abi when cross compiling from osx to android. 2017-02-06 17:26:05 -05:00
Martin Baulig 4ecb683985 [btls]: Add option to specify the certificate search paths. (#4318)
* [btls]: Add option to specify the certificate search paths.

* MonoTlsSettings.CertificateSearchPaths: new property.

Valid values are

- @default - add default search paths
- @user - add default user search path
- @machine - add default machine search path
- @trust - add 'MonoTlsSettings.TrustedRoots'
- @pem:<directory> - custom directory containing certificates in PEM format
- @der:<directory> - same, in DER format

* Make it internal for the moment.

* Cosmetic; use "?.".
2017-02-06 23:18:21 +01:00
Vlad Brezae 17c867e883 [sgen] Don't assert when suspending detaching thread (#4292)
This means that the thread will be part of the stw (not skipped), so if the stack pointer is not between the expected ranges we dont scan the thread. In other parts of the runtime, suspending here is handled by the suspend_can_continue flag.
2017-02-06 14:20:21 -05:00
Alexander Köplinger 52a81ab58d [tests] Fix duplicate variable setting in assemblyresolve
Probably bad merge conflict resolution in 5d054b1852
2017-02-06 12:32:48 +01:00
Alexander Kyte 5d054b1852 [runtime] Get mono/tests running on bitcode/arm (#4233) 2017-02-06 01:12:54 -05:00
Alexander Köplinger d9360c5b6c [acceptance-tests] Baseline failing coreclr tests for now (#4325)
We can look into them when we have time, but for now let's
just ensure no new failures sneak in.
2017-02-04 16:50:01 +01:00
Alexander Köplinger d7be7eb748 [xbuild] Add .NET 4.6.2 entries and frameworklist.xml (#4326) 2017-02-04 16:48:56 +01:00
Jon Purdy 7f1b9c9e86 [runtime] Require C# namespace to be quoted.
In GENERATE_GET_CLASS_WITH_CACHE and GENERATE_TRY_GET_CLASS_WITH_CACHE,
we were just quoting the namespace immediately.
2017-02-03 13:33:47 -08:00
Jon Purdy 7de7a8d09a [runtime] Avoid 'strncpy'.
Its null-padding behavior can be surprising.
2017-02-03 13:33:47 -08:00
Jon Purdy f138f07d16 [runtime] Use double-underscored attributes.
E.g., 'aligned' => '__aligned__'. We use the following attributes:

 * aligned
 * always_inline
 * cold
 * deprecated
 * error
 * format
 * naked
 * noinline
 * packed
 * printf
 * tls_model
 * unavailable
 * used
 * visibility
 * warn_unused_result
2017-02-03 13:33:47 -08:00
Jon Purdy cf55649fc0 [runtime] Remove redundant #includes. 2017-02-03 13:33:47 -08:00
Jon Purdy e103b436e7 [runtime] Avoid invalid characters.
There were some unquoted backticks and form-feed characters.
2017-02-03 13:33:47 -08:00
vkargov 87c9f31526 [runtime] Use ins->prev in mono_analyze_liveness. (#4296)
* [runtime] Add the missing MONO_BB_FOR_EACH_INS_REVERSE macro.

* [runtime] Use ins->prev instead of building reverse ins array in mono_analyze_liveness.
2017-02-03 15:52:56 -05:00
Zoltan Varga aacea00096 [runtime] Fix the computation of token sizes in ppdb files, the PDB stream has an additional table which contains the token sizes for the metadata tables referenced by the ppdb tables. (#4321) 2017-02-03 07:43:14 -05:00
Ankit Jain 5e27431a9a [xbuild] Disable pre-2.0 csc hack to use /debug:portable (#4322)
This hack should not be required now, as roslyn emits the correct debug
files with /debug:full and /debug:pdbonly, on non-windows platform.

This manifested as https://bugzilla.xamarin.com/show_bug.cgi?id=50710 ,
where the Xamarin.Mac targets override `$(CscToolExe)` to use `mcs`, but
xbuild's `ManagedCompiler` *always* converts `DebugType={full,pdbonly}`
to `/debug:portable`, which would cause mcs to complain.
2017-02-03 13:19:05 +01:00
Zoltan Varga 227eadaee6 [runtime] Factor out some code from mono_metadata_compute_size () to make it easier to add ppdb support later. NFC. (#4320) 2017-02-02 14:30:06 -05:00
Vlad Brezae 87f6f25a21 Merge pull request #4306 from BrzVlad/fix-roslyn-ppc
[ppc] Save all the registers in the context
2017-02-02 21:11:33 +02:00
Vlad Brezae dc527ab341 Revert "Default powerpc to build with mcs (#4313)"
This reverts commit 6a2a23dceb.
2017-02-02 21:09:20 +02:00
Vlad Brezae 7a8be4d2d0 [ppc] Save all the registers in the context
When suspending a thread, we were only saving the callee save registers in the context. Therefore SGen was failing to pin some objects. In order to store the registers in order, a code refactoring was necessary.
2017-02-02 21:09:18 +02:00
Martin Baulig bb569d1653 [btls]: Make the 'MonoBtlsX509LookupMonoCollection' logic consistent with the native implementation. (#4319) 2017-02-02 18:48:20 +01:00
Martin Baulig 01288a7550 [BTLS]: Improve error handling. (#4317)
* Add new native mono_btls_error_peek_error_line() and
  mono_btls_error_get_error_line().

* Add `MonoBtlsError.PeekError(out string, out int)` and
  `MonoBtlsError.GetError(out string, out int)` overloads.

* MonoBtlsContext.GetException(): use it here.
2017-02-02 18:43:02 +01:00
Martin Baulig e4b4e981d6 Merge pull request #4316 from mono/work-51562
[btls]: Allow importing a null `byte[]`.  Fixes #51562.
2017-02-02 12:06:23 +01:00
Niklas Therning 63df1eab87 Merge pull request #4312 from ntherning/winaot-tests-on-jenkins
Adds CI scripts to run the test suites under the winaot profile
2017-02-02 02:11:36 -05:00
Zoltan Varga 3b543687c6 Revert "[runtime] Fix the computation of token sizes in ppdb files, the PDB stream has an additional table which contains the token sizes for the metadata tables referenced by the ppdb tables. (#4304)"
This reverts commit c35cdfa2de.

Revert this as it causes test failures.
2017-02-01 15:36:40 -05:00
Jonathan Chambers 1de3239d7b Send assembly and type load events in the domain that contains them rather than the root domain in the attach/defer case. (#4314) 2017-02-01 14:58:23 -05:00
Martin Baulig 8ef0666048 [btls]: Allow importing a null byte[]. Fixes #51562. 2017-02-01 19:36:33 +01:00
Zoltan Varga c35cdfa2de [runtime] Fix the computation of token sizes in ppdb files, the PDB stream has an additional table which contains the token sizes for the metadata tables referenced by the ppdb tables. (#4304) 2017-02-01 13:05:22 -05:00
Zoltan Varga 644a586355 [x86] Fix a race in the single stepping seq point assembly, we were doing a null check using cmp_membase, following by a call_membase, but the value could change between the two instructions, leading to a nullref. Fixes #50117. (#4308) 2017-02-01 12:56:34 -05:00
Zoltan Varga 3ae33568bd [sdb] Add a Domain property to AssemblyMirror. (#4309) 2017-02-01 12:45:38 -05:00
Zoltan Varga 66df37380c [runtime] Update comments in mono-debug-debugger.h. 2017-02-01 12:42:56 -05:00
monojenkins e68ef38c18 [msvc] Update csproj files (#4315) 2017-02-01 17:40:17 +01:00
Alexander Köplinger 6a2a23dceb Default powerpc to build with mcs (#4313)
It crashes during build with roslyn on Jenkins.
2017-02-01 16:47:01 +01:00
Egor Bogatov c92b9b30df [System.Data] referencesource -> corefx (#4299)
* [System.Data] SQLTypes from corefx

* [System.Data] DataStorage + subclasses from corefx

* [System.Data] remove dead referencesource.sources references

* [System.Data] Generate SR.cs from corefx using resx2sr tool

* [System.Data] move common references to corefx.common.sources

* [System.Data] remove /ReferenceSources/SR.cs

* [System.Data] remove duplicates in corefx.common.sources (accidentally were added)

* [System.Data] simple types & enums from corefx

* [System.Data] referencesource -> corefx

* [System.Data] Referencesource -> corefx

* [System.Data] re-order (sort) files in corefx.common.sources, DbCommandBuilder from corefx

* [System.Data] Referencesource -> corefx

* [System.Data] DataRow, DataSet, Filters, etc from corefx. XmlDataDocument is internal in corefx but used to be public in mono.

* [System.Data] rollback referencesource changes

* [System.Data] Wrap /referencesource/DataSet.cs with #ifdef COREFX in order to include missing DataSetSchemaImporterExtension and ignore DataSet
2017-02-01 15:49:21 +01:00
Alexander Köplinger 492ef28c44 [System] Disable SocketTest.ConnectedProperty on testing_aot_full for now
It failed since we introduced this profile and it was disabled
on Mac a few years ago. A bug is filed to investigate why it only
fails on FullAOT on Linux but works on non-FullAOT builds.

Disable the test for now to get closer to a green build.

https://bugzilla.xamarin.com/show_bug.cgi?id=52157
2017-02-01 15:20:11 +01:00
Alexander Köplinger f5aec6d5e2 [ci] Bump timeout for compile-runtime-tests
The new Azure Windows builders sometimes run into this timeout.
2017-02-01 14:27:01 +01:00
Niklas Therning 6ce1db7596 Adds CI scripts to run the test suites under the winaot profile 2017-02-01 14:00:36 +01:00
Niklas Therning 578c224c25 Merge pull request #4301 from ntherning/fix-Mono.Posix-API-breakage
Fixes the Mono.Posix API breakage introduced in #3985
2017-02-01 07:58:54 -05:00
Zoltan Varga 1e8a8bffb4 [runtime] Fix parse_optimizations () so the optimization names don't … (#4300)
* [runtime] Fix parse_optimizations () so the optimization names don't need to be in a particular order.

* [jit] Avoid unused bits in optflags.
2017-02-01 07:42:14 -05:00
Zoltan Varga faa7954849 [ppdb] Fix support for embedded ppdb data. 2017-02-01 05:37:32 -05:00
Niklas Therning a55ddfca06 Fixes the Mono.Posix API breakage introduced in #3985
Also reverts the changes done to support/map.c. This is a generated file which
shouldn't be changed directly. An alternate fix for the problem in map.c on
Windows was to make sure L_SET et al are defined in mph.h which was already
done for Solaris.
2017-02-01 09:19:35 +01:00
Marek Safar 18c9df1789 Merge pull request #4310 from marek-safar/roslyn-rc3
Bump roslyn to rc3
2017-02-01 09:10:29 +01:00
Marek Safar 1af7e953e8 Merge pull request #4302 from marek-safar/corefx-bump
Bump corefx
2017-02-01 08:31:03 +01:00
Marek Safar 5e63a3ebfb Bump roslyn to rc3 2017-01-31 23:52:58 +01:00
Marek Safar 42b505ce2f Bump corefx 2017-01-31 23:34:24 +01:00
Alexander Köplinger 7a1a02ab7c [tests] Fix assemblyresolve_event4.exe and reference-loader.exe FullAOT test fails
Fix assemblyresolve/Makefile.am so it correctly AOTs the
dependency of assemblyresolve_event4.exe (CLASS was empty before).

Disable reference-loader.exe since we can't AOT the
TestingReferenceAssembly.dll assembly which is a dependency
of the test so it would fail. Discussed with Aleksey, this is OK
because even if we could AOT the assembly we wouldn't use it since
the assembly loader looks at the managed assembly first, finds the
attribute and bails out before looking at the AOT image.
2017-01-31 22:08:35 +01:00
Alexander Köplinger 16b933f883 [System] Fix AsyncOperationManager test that fails on the testing_full_aot profile
It seems the first assert only applies to XI/XM, so use those
in the condition instead of the profiles where it doesn't apply.
2017-01-31 20:23:00 +01:00
Alexander Köplinger e76fa87fe0 Don't try to AOT test assemblies in runtime_preset=all (#4303)
This got broken in ee048db72f
when the winaot profile was added to FULL_AOT_TESTS since we
enable that profile for building with runtime_preset=all which
means that FULL_AOT_TESTS would be defined and the runtime tests
would try to AOT the test assemblies.

Instead, we now only try to AOT if we're actually testing
a profile that needs it. Also introduced a new HYBRID_AOT_TESTS
variable and replaced the existing INSTALL_TESTING_AOT_HYBRID
since that profile would run into the same issue if we included
it in runtime_preset=all (using the INSTALL_ variables to decide
about tests is misleading!)
2017-01-31 19:18:58 +01:00
Marek Safar e3a6168dc2 [mono] Update ignored assemblies list to include System.ValueTuple 2017-01-30 17:47:29 +01:00
Marek Safar 74ca13ad75 [mono] Update ignored assemblies list to include System.Reflection.DispatchProxy 2017-01-30 17:47:29 +01:00
Alexander Köplinger 2bdb9ac999 [System.ServiceProcess] Fix test failure on Windows Server 2016
Use different service as the former has different dependencies
on the server edition.
2017-01-30 17:17:07 +01:00
Alexander Köplinger 845817b13a [System.Web] Fix two more EOL test failures on Windows 2017-01-30 17:17:06 +01:00
Rodrigo Kumpera 964ac3c81e Merge pull request #4297 from kumpera/fix-profiler-osx-linking
[profiler] On OSX, don't link against libmonosgen.
2017-01-30 10:54:55 -05:00
Marek Safar fd5bcaa48b [build] Use multiple inputs in profiled aot 2017-01-28 04:49:28 -05:00
Jon Purdy 980fc8d8cd [docs] Add a basic doxyfile
Bare minimum Doxygen configuration with dependency graphs.
2017-01-28 03:39:07 +01:00
Alexander Köplinger d61e7aca9a [bcl] Update tests that failed when .cs file contained CRLF
Most of them used multiline C# string literals which
means they contained the line ending character of the file.
Updated to make the tests resilient to having CRLF instead of LF.

Some of the mcs tests used a checksum to compare files,
ensured those are checked out using LF.
2017-01-28 02:25:55 +01:00
Rodrigo Kumpera 33a4d7cdd2 Fix non-osx build. 2017-01-27 14:51:31 -05:00
Rodrigo Kumpera d22678f8ba [profiler] Don't link to libmonosgen on OSX. Fixes in tree execution.
Loading profiling modules from the build tree fails on OSX because libmonosgen usually is not present in the install prefix.

This change is slightly overly complicated as I explicitly don't want to change iOS&friends.
2017-01-27 13:29:15 -05:00
Marek Safar 9bee02a3ff [scripts] Set custom csc nursery-size 2017-01-27 13:29:13 -05:00
Marek Safar 73ce529dcd [build] Install correct csc aot images 2017-01-27 13:29:13 -05:00
Bernhard Urban cb521c3c69 [interpreter] make space in args array to sneak in this in mint_newobj 2017-01-27 18:45:15 +01:00
Bernhard Urban 824201fcb8 [interpreter] change calling convention for this argument
the interpreter handles the `this` argument in the frame explicitly.
This doesn't align well with mini which treats `this` as normal
parameter on the stack.  That's just asking for troubles, e.g. for
native wrappers we convert signatures from virtual to static.
2017-01-27 18:45:15 +01:00
Bernhard Urban 934fa3892a [interpreter] fix CEE_LDOBJ for valuetypes 2017-01-27 18:45:15 +01:00
Bernhard Urban 6313ca4b41 [interpreter] first version of CEE{LD,ST}ELEM 2017-01-27 18:45:14 +01:00
Bernhard Urban a9ee8086e5 [interpreter] fixed bug in mint_vtresult, we need the new vt address on the stack 2017-01-27 18:45:14 +01:00
Bernhard Urban da995a21dc [interpreter] reserve storage on valuetype stack in mint_unbox 2017-01-27 18:45:14 +01:00
Bernhard Urban bcd85da0e2 [interpreter] fix some type -> klass accesses
mono_class_from_mono_type respects generic instantiations
2017-01-27 18:45:14 +01:00
Bernhard Urban 1ac870838e [interpreter] call managed boxing for nullable 2017-01-27 18:45:14 +01:00
Bernhard Urban 0dce72bd54 [interpreter] make box instruction respect generics 2017-01-27 18:45:14 +01:00
Bernhard Urban 593827bdd3 [interpreter] improve tracing 2017-01-27 18:45:14 +01:00
Bernhard Urban ca9279d3bb [interpreter] implement unbox_any. call managed unbox implementation for Nullable struct 2017-01-27 18:45:14 +01:00
Bernhard Urban 4c8d570eb1 [interpreter] add temporary regression tests for generics
until we can execute generics.cs
2017-01-27 18:45:14 +01:00
Bernhard Urban defa64af03 [interpreter] integrate compile_method and runtime_invoke into mini 2017-01-27 18:45:14 +01:00
Marek Safar 8e6f129087 [runtime] Add more system assemblies remapping 2017-01-27 12:20:51 -05:00
Alexander Köplinger 7ef66cccd9 A few more LF .gitattributes fixes 2017-01-27 15:58:54 +01:00
Alexander Köplinger 8aba97e42a Always use LF line endings for config.rpath/configure.host as well 2017-01-27 15:19:02 +01:00
Alexander Köplinger a16103f4b4 Add .sh extension to update_submodules so it gets correct line ending
It'd not be recognized as a shell file so it'd get CRLF line
endings on Windows which doesn't work. Also added a shebang.

Also remove get-cygwin-deps.sh, it is long outdated.
Correct instructions are on the Mono website.
2017-01-27 15:19:01 +01:00
Alexander Köplinger b112f67c45 Make sure .sh files always have LF line ending
This removes the need to set core.autocrlf=input when compiling
Mono on Windows via cygwin.
2017-01-27 14:14:23 +01:00
David Karlaš fb5bc8d4c5 [Debugger] Added support for stepping over await and out of async met…
…hods

method-to-ir.c: Added sequence points on IL offsets yieldOffsets and resumeOffsets since we need stepping to stop yieldOffset and ability to set breakpoint on resumeOffset
seq-points.c: This change is needed since we need to know if we are at last non-empty SeqPoint in method, but without this change is_last_non_empty method in debugger-agent.c would loop forever since blocks point between each other in cycles
doest-app.cs and dtest.cs: unit test
debugger-agent.c: I will explain how stepping over `await` and stepping out of `async` method works in commit message, code itself should be self explaining with comments

Step-In and Step-Out case: inside `async` method we do everything same except two things:
1. At end of method we switch to step-out logic
This is important because normal stepping-in/over would step out into “thread pool” calling code. Which is not what we want, we want to continue stepping where .Wait, .Result or `await` is waiting for our Task to finish. `is_last_non_empty` is needed because last non-empty SeqPoint is placed before SetResult(see line 33 in decompiled method below) so we can do StepOut logic before SetResult method is called.  I will explain how step-out works below.
2. When stepping is finished we check if we stepped on yieldOffset(this happens when user is about to step over `await` call) and Task has IsCompleted false(didn’t finish immediately)(line 11 in decompiled method). If we stopped on yieldOffset we put breakpoint on resumeOffset SeqPoint(line 19 in decompiled method) and resume execution so when our AsyncStateMachine is called back after Task(the one that our `await` call triggered) is finished we hit breakpoint and user is just after `await` call. It’s important that we set `async_id` before resuming at yieldOffset so we can check when breakpoint is hit if this is our Task or some other that is executing at same time, since we can’t check threads since threads can change before and after `await` call.

Step-Out case: When user requests step-out or user requests step-in/over and we are at end of method, we set breakpoint in special .Net framework method called “NotifyDebuggerOfWaitCompletion” and call “SetNotificationForWaitCompletion” method so after Task is finished(when we call .SetResult, line 33 in decompiled method).

Method that called our `async` method and got our Task(on which we called “SetNotificationForWaitCompletion”) returned. When it calls .Wait(), .Result, or `await` on our task it will call “NotifyDebuggerOfWaitCompletion”(framework does this). At that point our breakpoint(inside “NotifyDebuggerOfWaitCompletion”) is hit and we do step-out until we get to where user called .Wait(), .Result, and `await`.(Of course if ProjectCodeOnly is enabled, otherwise it’s in 1 method above “NotifyDebuggerOfWaitCompletion”).

I added also ppdb dump and monodis if anyone wants more data:

C# code:
public static async Task<int> ss_await_1 () {
    var a = 1;
    await Task.Delay (20);
    return a + 2;
}
C# decompiled:
  1: void IAsyncStateMachine.MoveNext ()
  2: {
  3:     int num = this.<>1__state;
  4:     int result;
  5:     try {
  6:         TaskAwaiter taskAwaiter;
  7:         if (num != 0) {
  8:           this.<a>5__1 = 1;
  9:           taskAwaiter = Task.Delay (20).GetAwaiter ();
10:           if (!taskAwaiter.get_IsCompleted ()) {
11:                this.<>1__state = 0;
12:                this.<>u__1 = taskAwaiter;
13:               Tests.<ss_await_1>d__90 <ss_await_1>d__ = this;
14:               this.<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter, Tests.<ss_await_1>d__90> (ref taskAwaiter, ref <ss_await_1>d__);
15:                return;
16:            }
17:        }
18:        else {
19:            taskAwaiter = this.<>u__1;
20:            this.<>u__1 = default(TaskAwaiter);
21:            this.<>1__state = -1;
22:        }
23:        taskAwaiter.GetResult ();
24:        taskAwaiter = default(TaskAwaiter);
25:        result = this.<a>5__1 + 2;
26:    }
27:    catch (Exception exception) {
28:        this.<>1__state = -2;
29:        this.<>t__builder.SetException (exception);
30:        return;
31:    }
32:    this.<>1__state = -2;
33:    this.<>t__builder.SetResult (result);
34:}

ppdb dump for this method:
<method containingType="Tests+&lt;ss_await_1&gt;d__90" name="MoveNext">
    <sequencePoints>
    <entry offset="0x0" hidden="true" document="1" />
    <entry offset="0x7" hidden="true" document="1" />
    <entry offset="0xe" startLine="744" startColumn="46" endLine="744" endColumn="47" document="1" />
    <entry offset="0xf" startLine="745" startColumn="3" endLine="745" endColumn="13" document="1" />
    <entry offset="0x16" startLine="746" startColumn="3" endLine="746" endColumn="25" document="1" />
    <entry offset="0x23" hidden="true" document="1" />
    <entry offset="0x7c" startLine="747" startColumn="3" endLine="747" endColumn="16" document="1" />
    <entry offset="0x87" hidden="true" document="1" />
    <entry offset="0xa1" startLine="748" startColumn="2" endLine="748" endColumn="3" document="1" />
    <entry offset="0xa9" hidden="true" document="1" />
    </sequencePoints>
    <scope startOffset="0x0" endOffset="0xb7" />
    <asyncInfo>
    <kickoffMethod declaringType="Tests" methodName="ss_await_1" />
    <await yield="0x35" resume="0x50" declaringType="Tests+&lt;ss_await_1&gt;d__90" methodName="MoveNext" />
    </asyncInfo>
</method>

monodis:
.method private final virtual hidebysig newslot
        instance default void MoveNext ()  cil managed
{
    // Method begins at RVA 0x41f0
.override Could not decode method override class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext due to (null)
// Code size 183 (0xb7)
.maxstack 3
.locals init (
    int32 V_0,
    int32 V_1,
    valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiterV_2,
    class Tests/'<ss_await_1>d__90' V_3,
    class [mscorlib]System.Exception V_4)
IL_0000:  ldarg.0
IL_0001:  ldfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
IL_0006:  stloc.0
.try { // 0
    IL_0007:  ldloc.0
    IL_0008:  brfalse.s IL_000c

    IL_000a:  br.s IL_000e

    IL_000c:  br.s IL_0050

    IL_000e:  nop
    IL_000f:  ldarg.0
    IL_0010:  ldc.i4.1
    IL_0011:  stfld int32 Tests/'<ss_await_1>d__90'::'<a>5__1'
    IL_0016:  ldc.i4.s 0x14
    IL_0018:  call class [mscorlib]System.Threading.Tasks.Task class [mscorlib]System.Threading.Tasks.Task::Delay(int32)
    IL_001d:  callvirt instance valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter class [mscorlib]System.Threading.Tasks.Task::GetAwaiter()
    IL_0022:  stloc.2
    IL_0023:  ldloca.s 2
    IL_0025:  call instance bool valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::get_IsCompleted()
    IL_002a:  brtrue.s IL_006c

    IL_002c:  ldarg.0
    IL_002d:  ldc.i4.0
    IL_002e:  dup
    IL_002f:  stloc.0
    IL_0030:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
    IL_0035:  ldarg.0
    IL_0036:  ldloc.2
    IL_0037:  stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter Tests/'<ss_await_1>d__90'::'<>u__1'
    IL_003c:  ldarg.0
    IL_003d:  stloc.3
    IL_003e:  ldarg.0
    IL_003f:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32> Tests/'<ss_await_1>d__90'::'<>t__builder'
    IL_0044:  ldloca.s 2
    IL_0046:  ldloca.s 3
    IL_0048:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32>::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter, class Tests/'<ss_await_1>d__90'> ([out] !!0&, [out] !!1&)
    IL_004d:  nop
    IL_004e:  leave.s IL_00b6

    IL_0050:  ldarg.0
    IL_0051:  ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter Tests/'<ss_await_1>d__90'::'<>u__1'
    IL_0056:  stloc.2
    IL_0057:  ldarg.0
    IL_0058:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter Tests/'<ss_await_1>d__90'::'<>u__1'
    IL_005d:  initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
    IL_0063:  ldarg.0
    IL_0064:  ldc.i4.m1
    IL_0065:  dup
    IL_0066:  stloc.0
    IL_0067:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
    IL_006c:  ldloca.s 2
    IL_006e:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
    IL_0073:  nop
    IL_0074:  ldloca.s 2
    IL_0076:  initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
    IL_007c:  ldarg.0
    IL_007d:  ldfld int32 Tests/'<ss_await_1>d__90'::'<a>5__1'
    IL_0082:  ldc.i4.2
    IL_0083:  add
    IL_0084:  stloc.1
    IL_0085:  leave.s IL_00a1

} // end .try 0
catch class [mscorlib]System.Exception { // 0
    IL_0087:  stloc.s 4
    IL_0089:  ldarg.0
    IL_008a:  ldc.i4.s 0xfffffffe
    IL_008c:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
    IL_0091:  ldarg.0
    IL_0092:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32> Tests/'<ss_await_1>d__90'::'<>t__builder'
    IL_0097:  ldloc.s 4
    IL_0099:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32>::SetException(class [mscorlib]System.Exception)
    IL_009e:  nop
    IL_009f:  leave.s IL_00b6

} // end handler 0
IL_00a1:  ldarg.0
IL_00a2:  ldc.i4.s 0xfffffffe
IL_00a4:  stfld int32 Tests/'<ss_await_1>d__90'::'<>1__state'
IL_00a9:  ldarg.0
IL_00aa:  ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32> Tests/'<ss_await_1>d__90'::'<>t__builder'
IL_00af:  ldloc.1
IL_00b0:  call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<int32>::SetResult(!0)
IL_00b5:  nop
IL_00b6:  ret
} // end of method <ss_await_1>d__90::MoveNext
2017-01-27 11:17:57 +01:00
David Karlaš da69fcc7f6 [Ppdb] Support for reading CustomDebugInformation and more specifically AsyncMethodDebugInfo 2017-01-27 11:17:57 +01:00
monojenkins 8a8e9532b4 [msvc] Update csproj files (#4295) 2017-01-26 17:40:33 +01:00
Egor Bogatov b37bb1736d [System.Data] SqlTypes and DataStorage from corefx (#4291) 2017-01-26 08:48:23 -05:00
Alexander Köplinger 30b91fc0a9 [ci] Set execute bit on run-test-mcs.sh 2017-01-26 11:59:09 +01:00
Marek Safar 35b66dec34 [ci] run mcs tests on mcs lane 2017-01-25 21:48:51 -05:00
Alexander Köplinger efce0da079 Fix PLATFORM_AOT_SUFFIX check in configure.ac 2017-01-26 01:33:49 +01:00
Alexander Köplinger 1d87187a1b Skip AOTing profile assemblies if AOT_BUILD_FLAGS is not set
Fixes the issue from a4b3ba6177
and 6f4f3643c6.

When building those profiles as part of runtime_preset=all,
the AOT_BUILD_FLAGS variable is not set so AOTing doesn't work
because the command line flag in rules.make is incomplete.

We don't really need/want to AOT for runtime_preset=all,
the point is just to make sure these BCL profiles still build.
2017-01-25 21:17:10 +01:00
Marek Safar 7e6c33c3e7 [tools] Simplify cecil usage in stringreplacer 2017-01-25 14:42:43 -05:00
Alexander Köplinger a4b3ba6177 Disable winaot in the runtime_preset=all as well
It runs into the same issue as orbis (6f4f3643c6).
2017-01-25 20:22:18 +01:00
Aleksey Kliger (λgeek) 9aa19cb3ec [appdomain] Use coop handles for most methods in System.AppDomain (#4286)
* [runtime] Use coop handles for ves_icall_System_AppDomain_GetData

* [runtime] Add mono_string_new_utf16_handle function that returns a MonoStringHandle

* [runtime] Use coop handles for ves_icall_System_AppDomain_InternalGetProcessGuid

* [runtime] Use coop handles for System.AppDomain icalls

  - ves_icall_System_AppDomain_InternalIsFinalizingForUnload
  - ves_icall_System_AppDomain_InternalPushDomainRef
  - ves_icall_System_AppDomain_InternalPushDomainRefByID
    (This one is slightly non-trivial because we switch from MonoException to MonoError)
  - ves_icall_System_AppDomain_InternalPopDomainRef
  - ves_icall_System_AppDomain_InternalSetDomainByID

* [runtime] Use coop handles for ves_icall_System_AppDomain_InternalSetDomain

* [runtime] Use coop handles for ves_icall_System_AppDomain_SetData

* [runtime] Coop handles for some AppDomain icalls

  - ves_icall_System_AppDomain_getCurDomain
  - ves_icall_System_AppDomain_getFriendlyName
  - ves_icall_System_AppDomain_getRootDomain
  - ves_icall_System_AppDomain_getSetup

* [coop handles] Add mono_string_handle_length function

* [marshal] Add mono_marshal_xdomain_copy_value_handle

* [coop handles] Add mono_aray_new_full_handle

* [appdomain] Use handles in mono_array_clone_in_domain

* [runtime] Use coop handles for ves_icall_System_AppDomain_createDomain

* [appdomain] Use coop handles for ves_icall_System_AppDomain_InternalUnload
2017-01-25 13:53:46 -05:00
Marek Safar 90b639f797 Merge pull request #4276 from henricm/winaot
Updates for winaot profile
2017-01-25 13:16:04 -05:00
Henric Müller 5a28b08795 Changing Win32_IP_ADAPTER_INFO to struct to work on AOT builds 2017-01-25 16:34:55 +01:00
Henric Müller 2f6630d46a Fixing AsyncOperationManagerTest test for winaot profile 2017-01-25 16:34:32 +01:00
Henric Müller 65b7f542d6 Fixing tests that asume IPV4 when first adapter is IPV6 2017-01-25 16:34:09 +01:00
Henric Müller fd83021804 Enabling NativeObjectSecurity on windows aot 2017-01-25 16:33:47 +01:00
Henric Müller 2c84763a1a Fixes in NetworkInformation for winaot profile
* Enabling windows specific code for winaot profile
which were disabled with MOBILE define.
* Making sure Win32_FIXED_INFO struct can get marshalled
correctly for AOT builds.
2017-01-25 16:33:24 +01:00
Henric Müller 262a4ae9b4 Enabled win specific time zone code using WIN_PLATFORM 2017-01-25 16:33:00 +01:00
Henric Müller aa40ebb990 Enabled win specific code in registry classes using WIN_PLATFORM 2017-01-25 16:32:34 +01:00
Henric Müller 1cdf024aba Enabling Windows specific code paths with WIN_PLATFORM 2017-01-25 16:32:10 +01:00
Henric Müller b015b474f3 Adding winaot corlib test assembly in LoadWithPartialName 2017-01-25 16:31:47 +01:00
Henric Müller e274e6f7eb Removing mini-exeptions-native-unwinder from project file 2017-01-25 16:31:24 +01:00
Henric Müller 0c61cdc666 Adding .exp to git ignore file. 2017-01-25 16:31:00 +01:00
Henric Müller e1b885c28e Adding Console support for winaot
Introducing a `MONO_FEATURE_CONSOLE` to be used instead of disabling
Windows specific Console related classes using `MOBILE` ifdef. The
`MONO_FEATURE_CONSOLE` will be set for profiles not setting `NO_CONSOLE`
which currently monodriod and monotouch profiles do.
2017-01-25 16:29:12 +01:00
Rodrigo Kumpera b2e515dcc8 Merge pull request #4280 from vargaz/class-init-cond
[runtime] Implement the wait in mono_runtime_class_init_full () using…
2017-01-25 08:53:12 -05:00
Henric Müller ee048db72f Updates for winaot profile 2017-01-25 10:14:01 +01:00
Henric Müller 96374a84a6 Added support for Windows AOT suffix
* Adding support for .dll and .exe AOT suffixes.
* Fix issue with parsing gsharedvt optimazation flag on Windows.
2017-01-25 10:07:48 +01:00
Alexander Köplinger 6f4f3643c6 Temporarily exclude orbis from the runtime_preset=all to fix build break
It breaks on Jenkins with:

```
23:53:28 make aot-all-profile
23:53:28 MONO_PATH="class/lib/orbis/" /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-amd64/runtime/mono-wrapper  ,temp-path=class/lib/orbis/I18N.CJK.dll_bitcode_tmp --verbose class/lib/orbis/I18N.CJK.dll > class/lib/orbis/I18N.CJK.dll.so.aot-log
23:53:28 Cannot open assembly ',temp-path=class/lib/orbis/I18N.CJK.dll_bitcode_tmp': No such file or directory.
```
2017-01-25 03:36:31 +01:00
Alexander Köplinger 603badbd39 [bcl] Fix build for orbis profile 2017-01-24 23:55:38 +01:00
Alexander Köplinger 849f12ba7d [socket] Fix order of parameters for mono_w32file_create
In 56edb3357c the call to ves_icall_System_IO_MonoIO_Open
was changed to mono_w32file_create, but that function uses a different parameter order:

```
mono_w32file_create (name, fileaccess, sharemode, createmode, attrs)
ves_icall_System_IO_MonoIO_Open (filename, mode, access_mode, share, options, error)
```

Fix the order so the parameters we pass are the intended ones.
2017-01-24 22:35:44 +01:00
monojenkins ab87d5de93 [msvc] Update csproj files (#4287) 2017-01-24 18:12:19 +01:00
Vlad Brezae 16ada3424a Merge pull request #3806 from BrzVlad/feature-parallel-gc-final
[sgen] Parallel concurrent major
2017-01-24 13:03:05 +02:00
Marek Safar 77f171e6a3 Bump corert 2017-01-23 21:58:43 -05:00
Marek Safar edaa13248b [build] Add new profile 2017-01-23 15:43:36 -05:00
Ludovic Henry 243cf3bd96 [socket] Ensure werror is initialized to 0 2017-01-23 15:29:07 -05:00
Marek Safar 0546b369ab [build] Add System.Text.Encoding.CodePages dependency used for non-ascii files in build 2017-01-23 12:58:08 -05:00
monojenkins 5afd4aa990 [msvc] Update csproj files (#4284) 2017-01-23 18:19:22 +01:00
Zoltan Varga 6c147e7028 [runtime] Remove duplicate unused SHA1 implementation. 2017-01-23 13:51:01 +01:00
Bernhard Urban b2a7f2eb38 [mono-sha1] make SHA1Transform thread-safe
should fix https://bugzilla.xamarin.com/show_bug.cgi?id=41133

The bug exposed itself as System.MethodAccessExceptionMethod which is
thrown when a method isn't allowed to call another method.  Several
things are checked for this: Among other things, the runtime checks if
the public key in the friend list of the caller assembly matches the
public key in the callee assembly.

The issue here was that two threads computed the SHA1 at the same time,
using the same buffer and therefore computing garbage.
2017-01-23 13:44:04 +01:00
Zoltan Varga 5e50c3d874 [aot] Allow the redirection of aot profile output to an already opened fd using outfile=#<fdnum>. 2017-01-23 05:48:54 -05:00
Zoltan Varga 74e0eb90f3 [runtime] Implement the wait in mono_runtime_class_init_full () using a cond variable instead of a mutex.
Previously it waited for the initialization to be done using a mutex lock/unlock, which needed some additional checks before acquiring the lock. Use a normal cond variable instead. Remove some code duplication from the lock cleanup code.
2017-01-23 00:40:14 -05:00
Zoltan Varga 359fd834fd Enable AOT for all roslyn assemblies. 2017-01-23 00:19:36 -05:00
Alexander Köplinger 5a28370d8a Fix a few cppcheck errors (#4281)
* [zlib] Fix CppCheck error "Shifting a negative value is undefined behaviour"

This matches what upstream now does:
https://github.com/madler/zlib/blob/2edb94a3025d288dc251bc6cbb2c02e60fbd7438/inflate.c#L1529

* [scripts] Fix CppCheck error "Memory leak: nargv"

* [tests] Fix CppCheck error: "Memory leak: reference"

* [aot-compiler] Fix CppCheck error: "Resource leak: infile"

* [metadata] Fix CppCheck error: "Uninitialized variable: ret"
2017-01-23 03:11:40 +01:00
Rodrigo Kumpera 5c62590ba7 Merge pull request #4274 from kumpera/cctor-abort
[runtime] Latest attempt at the cctor abort race. All tests passing locally.
2017-01-22 10:20:38 -05:00
Alexander Köplinger 9716aeb321 Fix tarball build
w32api.h wasn't included in any sources in the Makefile.
Also fix path in vcxproj, the file is in mono/utils not mono/metadata.
2017-01-22 03:13:56 +01:00
Zoltan Varga 67df72ae22 [aot] Init the plt before setting acfg->methods_loaded which is accessed outside the lock. 2017-01-21 06:06:29 -05:00
Ludovic Henry 56edb3357c [io-layer] Extract error (#4279)
* [file] Remove dead field

* [process] Remove wapi_getpid

* [process] Remove CloseHandle

* [io-layer] Remove dead MONO_TRACE

* [io-layer] Extract error

* [io-layer] Extract wapi.h

* [io-layer] Remove the io-layer
2017-01-20 20:15:19 -05:00
Zoltan Varga a69c38055f [runtime] Fix the loaded llvm build. 2017-01-20 19:02:43 -05:00
Marek Safar 203864e977 [corlib] Removes unused method 2017-01-20 23:24:27 +01:00
Alexander Köplinger 0f29c64e73 [btls] Remove last traces of statically linked btls
It was removed in d831fc4ec4.
2017-01-20 20:34:29 +01:00
Alexander Köplinger a104a895ca [btls] Add dependency on btls source files in Makefile so change tracking works 2017-01-20 20:33:37 +01:00
Alexander Köplinger db2f41e964 Really fix the file mode this time...
Sorry, should probably get a coffee :(
2017-01-20 19:49:03 +01:00
Alexander Köplinger cfec2ebeac Fix inadvertent file mode change in previous commit 2017-01-20 19:46:28 +01:00
Alexander Köplinger c98d0ecdf7 [Facades] Refresh netstandard20 typeforwarders 2017-01-20 19:40:55 +01:00
Alexander Köplinger 3ec54319a3 [profiler] Add mono-profiler-aot.h to EXTRA_DIST
This broke the tarball build.
2017-01-20 18:27:05 +01:00
Ludovic Henry f23f72c9de [io-layer] Extract file (#4255)
* [io-layer] Merge io related headers

* [io-layer] Remove global variable _wapi_had_shut_down

* [io-layer] Inline io-portability.c file into io.c

* [io-layer] Inline locking.c file into io.c

* [io-layer] Inline posix.c file into io.c

* [file] Move metadata/file-io* files to metadata/w32file*

* [io-layer] Extract file functions

* [file] Remove overlapped parameter which is always NULL

* [file] Remove SECURITY_ATTRIBUTES parameter which is always NULL

* [file] Remove GET_FILEEX_INFO_LEVELS parameter which is always GetFileExInfoStandard

* [file] Replace ULARGE_INTEGER parameter type with guint64

* [file] Replace WIN32_FILE_ATTRIBUTE_DATA parameter type with MonoIOStat

* [file] Remove mono_w32file_create unused parameter tmplate

* [file] Fix win32 build
2017-01-20 11:32:48 -05:00
Aleksey Kliger (λgeek) b3d9af9023 [reflection] Use coop handles for MonoMethod icalls (#4272)
* [reflection] Use coop handles for MonoMethod.GetGenericArguments

* [reflection] Use handles for ves_icall_MonoMethod_GetGenericMethodDefinition
  and two more trivial functions:
  - ves_icall_MonoMethod_get_IsGenericMethod
  - ves_icall_MonoMethod_get_IsGenericMethodDefinition

* [runtime] Add mono_method_get_base_method function

  - Internal function in class-internals.h, for now.
  - Code factored out from ves_icall_MonoMethod_get_base_method
  - ves_icall_MonoMethod_get_base_method just calls this utility and wraps on
    reflection objects, using handles.

* [reflection] Use coop handles for ves_icall_MonoMethod_MakeGenericMethod_impl

* [reflection] Use coop handles for ves_icall_MonoMethod_GetPInvoke

* [reflection] Use coop handles for ves_icall_MonoMethod_get_core_clr_security_level

* [reflection] Use coop handles for ves_icall_MonoMethod_get_name
2017-01-20 10:35:02 -05:00
Vlad Brezae a4c5367b44 [sgen] Always use a context specialized gray stack 2017-01-20 17:04:47 +02:00
Alexander Köplinger 6f2ce1ddf9 [bcl] Rename FEATURE_MONO_CAS to MONO_FEATURE_CAS
To be consistent with the other MONO_FEATURE_* defines.
2017-01-20 16:00:56 +01:00
Zoltan Varga 441f21bf48 [runtime] Mono.Dynamic.Interpreter is no more, delete it from the list of assemblies compiled by make fullaotcheck. 2017-01-20 05:08:58 -05:00
Zoltan Varga 906ed413f5 [runtime] Fix locking issues while accessing MonoClass bitfields. (#4275) 2017-01-20 03:28:22 -05:00
Alexander Köplinger 59af66cfe9 [System.Transactions] Add stubs and visibility fixes for netstandard20 APIs 2017-01-20 03:07:36 +01:00
Rodrigo Kumpera 70872177bb [runtime] Poll for interruption on cctor execution if mono_threads_end_abort_protected_block returns true. 2017-01-19 18:04:46 -08:00
Rodrigo Kumpera 5c7d98989a [runtime] Add new thread state INTERRUPT_REQUEST_DEFERRED to fix race with abort protected blocks.
The way this works is that when we install a protected block, we change a interrupt requested to interrupt request deferred.
Then, when protected block count drops to zero, we switch back and inform the caller to poll for interrupts.

Additionally, when interrupting, we set it to deferred if there's a protected block in effect and it's not a self interrupt.
2017-01-19 18:02:20 -08:00
Rodrigo Kumpera 39beec794d [threading] Change mono_thread_try_resume_interruption to check for the abort threshold too. 2017-01-19 18:01:43 -08:00
Rodrigo Kumpera 933a18326a [runtime] Workaround in Environment::Exit icall in case current thread has an interruption token installed. Tracked under bug #51653. 2017-01-19 18:00:46 -08:00
Rodrigo Kumpera 45be0e7fb9 [mono/tests] Use multiple return values to make it easy to pinpoint the failure. 2017-01-19 17:59:16 -08:00
Michael DeRoy fd29140735 Fix memory leak when creating sequence points (#4273) 2017-01-19 19:28:47 -05:00
Vlad Brezae 13ff81c713 [sgen] Always use one concurrent worker
We have the infrastructure to use multiple concurrent workers, but, in theory, this could starve the mutator threads. In the future, we should do additional research and consider using multiple concurrent workers.
2017-01-20 00:45:20 +02:00
Vlad Brezae dcd66b592e [sgen] Awaken workers if they are finished while there is work to steal 2017-01-20 00:45:19 +02:00
Vlad Brezae b180e9de9c [sgen] Use non-synchronized gray stack when only one worker is running 2017-01-20 00:45:19 +02:00
Vlad Brezae 4ea34f62a5 [sgen] Spread the initial roots of workers
A parallel phase starts with enqueuing of jobs and of sections to the distribute gray queue. In order to have a good work distribution we split jobs into multiple smaller jobs. We now do the same with the initial gray queue sections, by trying to always have a minimum number of starting sections.
2017-01-20 00:45:18 +02:00
Vlad Brezae 74435adcf9 [sgen] Worker gray queue stealing
When a worker is out of work, it tries to steal a section from the bottom of another workers' private gray queue. This operation takes a lock. Pushes/Pops done by the owner thread on its own private gray queue are done in lock free fashion, using membar/CAS (at section level).
2017-01-20 00:45:18 +02:00
Vlad Brezae 0b7fbf1d6a [sgen] Properly init the size of a new gray queue section
To avoid confusion
2017-01-20 00:45:17 +02:00
Vlad Brezae 050d17df80 [profiler] Fix vtune build 2017-01-20 00:45:17 +02:00
Vlad Brezae 33e80a5291 [sgen] Add worker index to the binary protocol entries 2017-01-20 00:45:16 +02:00
Vlad Brezae 8e72650298 [sgen] Clean exit if we can't read binprot file due to unsupported version 2017-01-20 00:45:16 +02:00
Vlad Brezae 956ebf32ab [sgen] Switch to nopar context when we are left with one worker
Non-parallel context is significantly faster since it doesn't require CAS-ing. Use it when we are left with only one worker so we don't regress performance.
2017-01-20 00:45:15 +02:00
Vlad Brezae 792ec4419a [sgen] Parallel mod union scan jobs 2017-01-20 00:45:14 +02:00
Vlad Brezae 85a5fd5867 [sgen] Avoid allocating mod union cardtables for los objects when scanning
We should consider doing the same when marking the mod union card table, if we have no cards to mark.
2017-01-20 00:45:14 +02:00
Vlad Brezae 4522c35476 [sgen] Remove unused function 2017-01-20 00:45:13 +02:00
Vlad Brezae 24ae43d6a9 [sgen] Use parallel workers when finishing concurrent collections 2017-01-20 00:45:13 +02:00
Vlad Brezae c282c5b4ee [sgen] Make getting object size safe with parallel collector 2017-01-20 00:45:12 +02:00
Vlad Brezae 5ce1564be2 [sgen] Support cementing from multiple workers 2017-01-20 00:45:12 +02:00
Vlad Brezae 9915f47f62 [sgen] Disable concurrent queue redirection
We used to support the case where workers are running and when the main gc thread populates the redirected gray queue, these queue sections are moved to the workers distribute gray queue from where they are distributed to all the workers. In order to simplify the process, the main gc thread should never do any relevant gc work concurrently with the workers. This means that we no longer need to handle the above case.
2017-01-20 00:45:11 +02:00
Vlad Brezae 6dd609be32 [sgen] Add parallel copying infrastructure
Parallel copying should happen only when the world is stopped and the gc thread is not running. Each thread allocates from its own block freelist, which he obtains by pop-ing the global block free list.

When a worker has to copy an object, it first allocates a new object in a major block and initialises its contents. Afterwards it tries to forward the vtable, using a CAS operation. If the vtable already contains a forwarded object, we just return the forwarded address, and the object that we allocated will be left to die (we expect this case to be extremely unlikely, otherwise we could re-enque the free object in its block's freelist).

After the copying is done, the caller has the duty to update references and mark the new object (which we have to do it also with a CAS).

FIXME : This means that an object can reside on a gray queue without being marked, so another thread can enque again this same object. We should refactor this copying/mark/enqueing mechansim to avoid these issues.
2017-01-20 00:45:11 +02:00
Vlad Brezae e382aa00b5 [sgen] Add free lists for each workers
These will be used for object allocation by the workers
2017-01-20 00:45:10 +02:00
Vlad Brezae 7dc021c96d [sgen] Parallel precleaning of los objects
In the future we should consider splitting large objects.
2017-01-20 00:45:10 +02:00
Vlad Brezae 175bf89a99 [sgen] Remove unused parameter 2017-01-20 00:45:09 +02:00
Vlad Brezae c8b5a33e5c [sgen] Parallel major blocks precleaning
We allow spliting a major_scan_cardtable into multiple smaller jobs. For precleaning, we enqueue num_workers precleaning jobs, each one precleaning one in every num_workers blocks from the list.
2017-01-20 00:45:09 +02:00
Vlad Brezae 0a29510f23 [sgen] Split precleaning into multiple jobs 2017-01-20 00:45:08 +02:00
Vlad Brezae 5f2d0db2ba [sgen] Enqueue preclean through a worker finish callback
It moves enqueuing back to the main gc giving more flexibility.
2017-01-20 00:45:08 +02:00
Vlad Brezae d9141894cc [sgen] Enable multiple workers 2017-01-20 00:45:07 +02:00
Vlad Brezae 8e128c0f2c [sgen] CAS on LOS marking
We make sure we don't double enqueue a large object.
2017-01-20 00:45:07 +02:00
Vlad Brezae 9b4efca29b [sgen] Add CAS object marking for concurrent workers
When marking an object we need to make sure we are not unmarking other objects (since marking is stored as bits). This also allows us to make sure that we never enqueue the same object multiple times on separate gray queues.
2017-01-20 00:45:06 +02:00
Vlad Brezae bcb359628e [sgen] Add separate scan/copy context for concurrent parallel configuration 2017-01-20 00:45:06 +02:00
Vlad Brezae b0f00d71a9 [sgen] Use array with fixed-size element for mark words
There is no benefit in using pointer size element and we need to special case between architectures.
2017-01-20 00:45:05 +02:00
Vlad Brezae f87454a5fe [sgen] Support multiple workers 2017-01-20 00:45:03 +02:00
Rodrigo Kumpera 843d3c0633 [runtime] Collapse interruption_requested and abort_protected_block_count into a single var.
This change doesn't change behavior.
2017-01-19 13:34:51 -08:00
Aleksey Kliger 6e91d455db [sre] Use coop handles in parts of sre.c
* Convert ves_icall_RuntimeType_MakeGenericType to use handles.
* The above necessitates converting mono_reflection_bind_generic_parameters and
  mono_reflection_type_get_handle (renamed to
  mono_reflection_type_handle_mono_type) to use handles.
* From there we have to touch a lot of builder internals:
  - ves_icall_DynamicMethod_create_dynamic_method
  - ves_icall_ModuleBuilder_RegisterToken
  - ves_icall_ModuleBuilder_basic_init
  - ves_icall_ModuleBuilder_getMethodToken
  - ves_icall_ModuleBuilder_getToken
  - ves_icall_ModuleBuilder_getUSIndex
  - ves_icall_TypeBuilder_create_runtime_class
* As well as runtime functions
  - mono_image_insert_string
  - mono_image_create_token
  - mono_class_{get,has,set}_ref_info
  - mono_reflection_is_usertype
  - mono_dynimage_encode_reflection_sighelper
  - mono_dynamic_image_register_token
2017-01-19 15:07:26 -05:00
Miguel de Icaza a5aa762c16 Add mdb2ppdb man page, remove prj2make man page 2017-01-19 13:48:14 -05:00
Rodrigo Kumpera 7179d6ebdb Merge pull request #4269 from kumpera/nuget-fixing-round2
[runtime] A pair of small fixes for the ignore assembly work.
2017-01-19 10:26:54 -08:00
Vlad Brezae 43629d1ae0 [sgen] Add multiple thread support for sgen thread pool 2017-01-19 20:05:12 +02:00
Vlad Brezae 64dce80403 [sgen] Add parallel configuration to the sgen testing suite 2017-01-19 20:05:12 +02:00
Vlad Brezae 78b236bbab [sgen] Add option for a new parallel concurrent collector 2017-01-19 20:05:11 +02:00
Vlad Brezae b7333558ec [sgen] Remove unused prototypes 2017-01-19 20:05:11 +02:00
Vlad Brezae c313d43751 [sgen] Use thread safe addition to block list
This will enable us to to parallel block allocation, which is useful when doing parallel copying. We no longer compact the array (using the default array list allocator instead) so we need to account for unallocated slots (slots with null value) in the array at any time (see FOREACH_BLOCK).
2017-01-19 20:05:08 +02:00
Ludovic Henry 82f231ff91 [threads] Fix crash on unknown policy (#4264)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=51545
2017-01-19 09:31:01 -05:00
Ludovic Henry 3c3e566002 [threadpool] Fix race on runtime shutdown (#4263)
We cannot free the threadpool, because there is a race on shutdown where a managed thread may request a new threadpool thread, but we already destroyed the threadpool. So to avoid a use-after-free, we simply do not free the threadpool, as we won't be able to access the threadpool anyway because the ref count will be 0

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=51219
2017-01-19 09:30:07 -05:00
Ludovic Henry e343ad0cfd [io-layer] Extract socket (#4241)
* [socket] Extract win32 and unix specific code from w32socket.c

* [socket] Extract WSAGetLastError and WSASetLastError

* [socket] Extract closesocket

* [socket] Extract iocltsocket

* [socket] Extract socket-wrappers.h functions

* [socket] Extract w32handle operations

* [socket] Extract WSAIoctl

* [socket] Do not use mono_w32socket_ioctl for disconnect

* [socket] Extract errno_to_WSA

* [socket] Remove redundant mono_w32handle_get_type/mono_w32handle_lookup

* [socket] Inline _wapi_* functions

* [socket] Make disconnect not rely on mono_w32socket_ioctl

* [socket] Remove unused parameters to mono_w32socket_transmit_file

* [socket] Refactor calls to mono_w32socket_convert_error

* [socket] Remove dead code
2017-01-19 09:25:55 -05:00
Rodrigo Kumpera 6220d11404 [mini] Add new JIT flag JIT_FLAG_DISCARD_RESULTS to reduce the noise when profiling the jit with --compile-all. (#4266)
JI registration dominates profiling as it has some perf issues itself.
2017-01-19 06:34:50 -05:00
Rodrigo Kumpera bc0c2d37e0 [runtime] A pair of small fixes for the ignore assembly work.
image.c (do_mono_image_load): Ignore refonly images when checking for ignorable assemblies.

icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Load the image in ref only mode.
2017-01-18 17:54:32 -08:00
Alexander Köplinger 7fca4572d9 [btls] Disable RC4 cipher suites by default
They should not be used anymore according to https://tools.ietf.org/html/rfc7465
and browser like Chrome, Firefox and Edge/IE [1] already removed them.

We should to do the same. To have everything in one place I also moved
the disabling of SSLv2/v3 to the mono_btls_ssl_ctx_new function as well
instead of disabling it on each single connection.

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

[1] https://blogs.windows.com/msedgedev/2016/08/09/rc4-now-deprecated/
2017-01-18 21:54:47 +01:00
Alexis Christoforides ec53a1c257 [bockbuild] Fix a packaging regression 2017-01-18 15:21:58 -05:00
Rodrigo Kumpera 346125c061 Merge pull request #4262 from kumpera/fix-windows
Fix the windows build.
2017-01-18 13:18:41 -05:00
Rodrigo Kumpera 290ebcc653 Fix the windows build. 2017-01-18 07:50:51 -08:00
Alexander Köplinger ec0d74690d [pdb2mdb] Detect portable PDB and fail gracefully instead of crashing (#4261)
Before when trying to convert an assembly that had a portable PDB
instead of a native PDB alongside it we'd just crash in the
Microsoft.Cci pdb reader.

We now check whether the symbol file is a portable PDB and exit
gracefully with an error message and exit code 2 from the app.

Users which access the Converter class (like e.g. Xamarin Android [1])
directly can now catch the PortablePdbNotSupportedException to
do custom logic.

[1] https://github.com/xamarin/xamarin-android/blob/15f7547fa673e02256a75910c60c5e13eb158d2b/src/Xamarin.Android.Build.Tasks/Tasks/ConvertDebuggingFiles.cs#L28
2017-01-18 16:48:07 +01:00
Aleksey Kliger e4b93cd0bd [reflection] Fix ves_icall_RuntimeTypeHandle_GetGenericTypeDefinition_impl
There was a typo in ea176c5bb8 that inadvertantly
replaced `generic_class` by `klass`.
2017-01-18 10:30:43 -05:00
Aleksey Kliger e7d19721c6 [coop handles] Fix mono_gchandle_get_target_handle
Apparently it did not get exercised previously.
2017-01-18 10:30:43 -05:00
Aleksey Kliger d31b27997a [test] RuntimeType.GetGenericTypeDefiniton should return the TypeBuilder
even after CreateType has already been called.
2017-01-18 10:30:43 -05:00
Bernhard Urban d9825c6ac8 [mini-posix] close file stream before exec'ing into GDB/LLDB
otherwise it isn't ensured that the content is written to the file.
2017-01-18 15:47:48 +01:00
Bernhard Urban 0cddd56945 [mini-posix] fix indent 2017-01-18 15:47:48 +01:00
Bernhard Urban be9594fe94 [exception] add another testcase where an exception is rethrown explicitly (and therefore another behavior is expected) 2017-01-18 15:47:11 +01:00
Bernhard Urban 4288c5dc31 [exception] retain stack trace when an exception is rethrown 2017-01-18 15:47:11 +01:00
Rodrigo Kumpera f367b437ba Merge pull request #4234 from kumpera/katia-flavia
[runtime] Deny loading bad images.
2017-01-18 01:21:30 -05:00
Alexis Christoforides 1b3e850d20 [bockbuild] Fix packaging regression 2017-01-17 18:21:58 -05:00
Rodrigo Kumpera 26b60ef9c6 [tools] Add nuget-hash-extractor tool to help produce the runtime ignored assemblies table.
This tool takes a folder full of nupkg file and print macro invocations to add to image.c:ignored_assemblies.

Usage:

make download
make run

The download.sh script downloads all nugets we want to ignore. So update it before running if you have more you want to add.
2017-01-17 14:35:57 -08:00
Rodrigo Kumpera 9ec8ec5389 [runtime] Deny loading images that belong to a set of well known bad images.
Matching is done by assembly name and GUID. This should be enough to narrow
down the effect.

This approach is not very efficient as it waits for quite some of the loading
process to be on its way before detection. It works in the case that only a few
rare images are matched.
2017-01-17 14:35:50 -08:00
Alexis Christoforides a72a0b458d [MacSDK] Fix typo in ironlangs manifest 2017-01-17 16:33:26 -05:00
Jonathan Chambers 863ddf25bf Implement mono_gc_alloc_fixed on Boehm to be uncollectable. This matches SGen behavior and avoids needing to register fixed allocated memory as a root. 2017-01-17 15:59:44 -05:00
monojenkins 28ec46d6e2 [msvc] Update csproj files (#4254) 2017-01-17 19:17:57 +01:00
Bernhard Urban 03c4efe204 [interpreter] fix castclass and isinst instruction
`mono_object_isinst_mbyref_checked` was removed recently. however, this
code unnecessary checks cases that are covered by
`mono_object_isinst_checked` anyway.
2017-01-17 17:26:32 +01:00
Marek Safar 1c77897951 Clean up few warnings 2017-01-17 13:47:42 +01:00
Alexander Köplinger 997a652923 [tests] Use correct MONO_PATH directory for tools like MCS/ILASM
We need to use the mcs/class/lib/build directory so Roslyn
works (it runs into AOT bugs in net_4_x).

This was fixed in a few other places already, fix more.
2017-01-17 13:05:03 +01:00
Zoltan Varga bf5e2fa8b2 [lldb] Embed the actual entry in the jit descriptor structure to avoid a roundtrip. Add a timer for the amount of time spent in __mono_jit_debug_register_code (). Avoid emitting info for specific trampolines for now. 2017-01-17 04:13:38 -05:00
Zoltan Varga eb66d4cfc2 [tools] Add mdb2ppdb tool for converting a .mdb file to a portable pdb .pdb file. (#4251) 2017-01-17 00:22:28 +01:00
Alexander Kyte 70ce36925b [runtime] Enable unwind_backtrace on ARM/linux (#4230) 2017-01-15 20:18:19 -05:00
Zoltan Varga 3e9e81c1a8 [jit] Optimize constrained calls to Enum.GetHasCode () to avoid boxing. Fixes #51330. (#4250) 2017-01-15 19:52:46 -05:00
Zoltan Varga ebb1e7eb22 [runtime] Remove glib usage from public headers. (#4242) 2017-01-15 19:32:48 -05:00
Zoltan Varga 38983b6b1b [jit] Fix a regression introduced by the addition of an assert in bf467001b1. 2017-01-15 12:54:30 -05:00
monojenkins b18a62e599 [msvc] Update csproj files (#4249) 2017-01-14 18:21:08 +01:00
Marek Safar a9a282e77d Merge pull request #4246 from Unity-Technologies/mcs-generic-constraint-enumerator
[mcs] Ignore constraints on enumerator generic methods. Fixes #51506
2017-01-13 20:01:03 +01:00
Josh Peterson 1f64de8154 [mcs] Ignore constraints on enumerator generic methods. Fixes #51506
This is similar to the change at 30f6c9933a
2017-01-13 09:44:03 -05:00
Alexander Köplinger 968c60a0f3 [btls] Remove btls-cert-sync and integrate it into cert-sync
cert-sync already knew how to import into the BTLS cert store,
update it to always import into both stores so we don't need
the btls-cert-sync tool anymore.
2017-01-13 14:43:04 +01:00
Alexander Köplinger 3aa59f2e6b [Mono.Security] Consider _newFormat when building certificate collection in X509Store
It only looked at the legacy format where certificates had the *.cer
extension, the new BTLS store uses *.0 extension.
2017-01-13 14:43:03 +01:00
Ludovic Henry c5d43075c3 [hybrid] Enable gsharedvt trampoline on amd64 2017-01-13 09:42:59 -02:00
Ludovic Henry 924ef78270 [hybrid] Ensure gsharedvt isn't disabled once it's been enabled
We would observe gsharedvt being disabled on desktop, even after passing --hybrid-aot. This would happen because we would call `mono_set_optimizations` without the `gsharedvt` optimisation enabled, thus calling `mono_set_generic_sharing_vt_supported(FALSE)` disabling again gsharedvt.
2017-01-13 09:42:59 -02:00
Ludovic Henry 6312022a95 [hybrid] Enable logging for methods not found with gsharedvt enabled 2017-01-13 09:42:59 -02:00
Marek Safar 71897f6d15 [Facades] Implementation types from CoreFX 2017-01-13 09:15:01 +01:00
Rodrigo Kumpera bf467001b1 Merge pull request #4198 from vkargov/vk-prevbb
[jit] Fix the prev_bb quick lookup in mono_merge_basic_blocks().
2017-01-12 15:13:49 -08:00
Rodrigo Kumpera b128a290be Merge pull request #4212 from BrzVlad/fix-ephemeron-leak
[corlib] Avoid unbounded resizes of ephemeron arrays
2017-01-12 15:11:30 -08:00
Aleksey Kliger 11eb6b0475 [runtime] Use mono_{object,class}_is_transparent_proxy () where possible
instead of comparing the klass to mono_defaults.transparent_proxy_class directlyi.
2017-01-12 16:46:42 -05:00
Aleksey Kliger dd40906bb8 [runtime] Fix compile error in mono_domain_from_appdomain when DISABLE_REMOTING is defined
mono_defaults.transparent_proxy_class is #ifdef'd out when remoting is disabled.
2017-01-12 16:46:42 -05:00
Zoltan Varga ba9514f620 [runtime] Add an --enable-minimal=mdb option for disabling support for .mdb symbol files. 2017-01-12 16:32:54 -05:00
Aleksey Kliger 8dec9848f6 [mini] Initialize profiler in mini_init
Initializing the profiler later fixes a segfault with cooperative GC due to
thread info callbacks not being initialized.
2017-01-12 15:31:20 -05:00
Alexander Köplinger 44c78cbed9 [ci] Fix interpreter config and simplify CI_TAGS checking in run-jenkins.sh
The elif for the interpreter was done after the elif
that catches (almost) all cases so it was ignored.

Simplify and condense the CI_TAGS checking so it's
easier to understand and more readable.
2017-01-12 21:07:31 +01:00
Bernhard Urban 14976c12aa [configure] avoid avoid 'no symbols' warnings on darwin (2nd attempt) 2017-01-12 20:16:37 +01:00
Aleksey Kliger (λgeek) 1003c4b19f [reflection] Coop handles for more icalls in System.RuntimeTypeHandle (#4220)
* [reflection] Use handles for ves_icall_RuntimeType_get_DeclaringMethod

* [reflection] Use handles for System.RuntimeType.GetInterfaces

* [reflection] Use handles for System.RuntimeType.GetInterfaceMapData

* [reflection] Use handles for System.RuntimeType.GetGenericArgumentsInternal

* [reflection] Use handles for System.RuntimeType.MakePointerType

* [reflection] Use handles for ves_icall_RuntimeType_get_DeclaringType

* [reflection] Use handles for more System.RuntimeType icalls

  - CreateInstanceInternal
  - GetConstructors_native
  - GetCorrespondingInflatedConstructor
  - GetCorrespondingInflatedMethod
  - GetEvents_native
  - GetFields_native
  - GetGenericParameterPosition
  - GetMethodsByName_native
  - GetNestedTypes_native
  - GetPacking
  - GetTypeCodeImplInternal
  - IsTypeExportedToWindowsRuntime
  - IsWindowsRuntimeObjectType
  - get_core_clr_security_level
  - make_array_type
  - make_byref_type
2017-01-12 14:05:59 -05:00
Bernhard Urban af132734b6 [unwind] respect link register on ppc and use right dwarf register for PC depending on ELF spec version
fixes a regression introduced by 3baad19c6c
2017-01-12 19:26:23 +01:00
Zoltan Varga 1121caa963 [runtime] Support TransparentProxy-es in mono_domain_from_appdomain (). 2017-01-12 13:19:27 -05:00
Rodrigo Kumpera bc2340ff3c Merge pull request #3563 from lewurm/interpreter
reviving interpreter
2017-01-12 09:46:05 -08:00
Marek Safar 0fd12d3ff5 Fixes build 2017-01-12 18:19:56 +01:00
Marek Safar 3713ba550c [Mono.Security] Add IVT to Xamarin dlls 2017-01-12 16:41:47 +01:00
Marek Safar fe8cf937d1 Merge pull request #4235 from grendello/android_dns_servers
[BCL,Android] Get DNS server addresses from Android
2017-01-12 12:56:41 +01:00
Marek Habersack bb9981e61c [BCL,Android] Get DNS server addresses from Android
This change implements retrieving a list of DNS server addresses from Android
instead of attempting to parse `/etc/resolv.conf` which doesn't exist on
Android.
The list is retrieved by calling native function in Xamarin.Android that gets
the data from the system.

Part 2 of fix for https://bugzilla.xamarin.com/show_bug.cgi?id=48016
2017-01-12 12:45:36 +01:00
Marek Safar 65aaee5d8d Bump cecil 2017-01-12 10:40:59 +01:00
Zoltan Varga 32690b3021 [aot] Add 'profile-only' argument to only aot methods found in the profile file. 2017-01-12 03:32:06 -05:00
Zoltan Varga f0156ef4cd [aot] Add a 'verbose' argument to the aot compiler, use it to print out more information on profile loading errors. 2017-01-11 22:04:26 -05:00
Zoltan Varga 901322a88b [aot] Add support for loading multiple profile files. 2017-01-11 21:23:16 -05:00
Zoltan Varga a43a4290b8 [lldb] Avoid a crash in mono_lldb_remove_method () if lldb is not enabled. 2017-01-11 17:56:18 -05:00
Jon Purdy e6c312f927 [ilasm] Support 'nooptimization' attribute. 2017-01-11 13:57:15 -08:00
Zoltan Varga 487cab2ad1 [msvc] Add lldb.c to the vs project. 2017-01-11 16:50:12 -05:00
Zoltan Varga a3c230a730 [lldb] Use mono_unwind_get_cie_program () instead of mono_arch_get_cie_program () which might not be available on all platforms. 2017-01-11 16:17:45 -05:00
Martin Baulig 41b471428a [BTLS]: Fix callback method signatures. 2017-01-11 21:14:09 +01:00
Martin Baulig 0bb7e2e421 [BTLS]: Remove unused local variables. 2017-01-11 21:14:08 +01:00
Alexander Köplinger e135936e2f [btls] Fix function declaration and add it to btls-key.h header 2017-01-11 20:40:35 +01:00
Marek Safar 30f6c9933a [mcs] Don't do constraints on fabricated generic methods. Fixes #47672 2017-01-11 20:18:13 +01:00
Marek Safar cd9f3030cd [System.Windows.Forms] Clean up misused __MonoCS__ 2017-01-11 20:18:13 +01:00
monojenkins fc057335ef [msvc] Update csproj files (#4226) 2017-01-11 19:35:12 +01:00
Alexander Köplinger 5b014f9c48 Merge pull request #4224 from akoeplinger/fix-46602
[btls] Create a native BTLS key handle for X509CertificateImplBtls.PrivateKey
2017-01-11 19:32:38 +01:00
Zoltan Varga 6e72e0ec95 Lldb support code for mono (#4225)
* Initial version of lldb support code.

* [lldb] Keep all the debug entries in a linked list so lldb can read it after attaching to the process.

* [lldb] Add an --enable-minimal=lldb option to disable the code. Add locking.

* [lldb] Add support for dynamic methods by adding a new protocol entry for unloading code regions.

* [lldb] Add beginnings of a test suite using the lldb python bindings.

* [lldb] Emit line number info for methods, not used yet.

* [lldb] Add dummy fields to structures to make sure 64 bit fields are 64 bit aligned.

* [lldb] Finish emission of line number info.

* [lldb] Use mono_method_full_name () for computing method names.

* [lldb] Emit info for specific trampolines as well.

* [lldb] Add tests for line number info.

* [lldb] Fix unwind info encoding on x86.

* [lldb] Skip seq points with no native offset.

* [lldb] Add tests for breakpoints.
2017-01-11 12:12:32 -05:00
Aleksey Kliger (λgeek) bf862b4206 [remoting] Coop handles for proxy objects (#4208)
* [remoting] Use coop handles in several functions

  - icall System.Runtime.Remoting.Proxies.RealProxy.InternalGetTransparentProxy
  - mono_remote_class
  - mono_remote_class_vtable
  - mono_upgrade_remote_class
  - mono_object_handle_get_virtual_method
  - mono_object_handle_isinst
  - mono_object_handle_isinst_mbyref

* [reflection] Use handles in System.RuntimeTypeHandle.IsInstanceOfType

* [runtime] Rewrite mono_object_castclass_mbyref
  in terms of mono_object_handle_isinst_mbyref.

  This is an external API function that isn't used inside the runtime.

* [runtime] Remove mono_object_isinst_mbyref_checked

  It was a runtime internal funciton.

  All of its former callers have been converted to use mono_object_handle_isinst_mbyref.
2017-01-11 10:38:49 -05:00
Marek Safar 9197bd0e1c Merge pull request #4219 from marek-safar/corert-bump
Update ValueTuple implementation
2017-01-11 14:32:31 +01:00
Vlad Brezae c7978a2788 [corlib] Avoid unnecessary ephemeron array resizes 2017-01-11 13:22:25 +02:00
Vlad Brezae a3b053bacf [corlib] Avoid unbounded resizes of ephemeron arrays
We compute the size of the array based on how many live ephemerons it stores, and not based on the previous size of the array which doesn't indicate anything.

Fixes leak from #47388.
2017-01-11 13:21:59 +02:00
Marek Safar ddb72c43c8 [corlib] Update ValueTuple implementation 2017-01-11 11:01:24 +01:00
Marek Safar 3d9aca5e59 Bump corert 2017-01-11 11:01:23 +01:00
Zoltan Varga bf1862930b [jit] Extends an array in mono_spill_global_vars () instead of asserting. Fixes #50789. (#4201) 2017-01-11 04:31:21 -05:00
Marek Safar 6a5fd42faf Merge pull request #4222 from alexanderkyte/fix_mismatch_com_disabled
[runtime] Fix corlib out of date error with disabled COM
2017-01-11 09:44:17 +01:00
Chris Hamons bb0564ff3c Mono BCL test fixes so XM can run them (#4210) 2017-01-10 16:59:08 -06:00
Alexander Köplinger a9d75b4b66 [btls] Create a native BTLS key handle for X509CertificateImplBtls.PrivateKey
When setting X509CertificateImplBtls.PrivateKey we'd previously just
update the fallback instance. This causes problems if other code
internal to System.dll like MonoBtlsContext.SetPrivateCertificate()
tries to fetch the NativePrivateKey since it'd be null at that point.

This scenario happens e.g. with HttpListener, it supports a special
directory in ~/.config/.mono/httplistener which contains <port>.cer
and <port>.pvk files (public and private key) that will be used
as the server certificate. In that code we're reading the private
key from the file and assigning it to X509CertificateImplBtls.PrivateKey
without ever having a native BTLS handle.

The fix is to create such a native BTLS handle from the managed
private key when needed.

Note that we can't simply always do this e.g. in the PrivateKey
setter because the setter will be used with instances that
don't actually contain a private key. We can't throw in those
cases so instead we do it only when NativePrivateKey is accessed.

To make the code clearer and easier to read, `privateKey` was
renamed to `nativePrivateKey` in X509CertificateImplBtls.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=46602
2017-01-10 22:33:49 +01:00
Alexander Köplinger af85a09321 [btls] Call Reset() in X509CertificateImplBtls.Import()
Otherwise we'd not clear the fields like subjectName, issuerName, etc.
and the properties they're backing would continue to return old values.
2017-01-10 22:20:16 +01:00
Alexander Köplinger 2cadd74de8 [btls] Free handle returned by EVP_PKEY_get1_RSA
From the header docs:

> The |get1| functions return a fresh reference to the underlying
> object or NULL if |pkey| is not of the correct type.
2017-01-10 22:20:15 +01:00
Alexander Köplinger 27b7a9f2c6 [System] Use non-obsolete API in SslStream 2017-01-10 21:45:02 +01:00
monojenkins 6c97220ddc [msvc] Update csproj files (#4221) 2017-01-10 19:33:39 +01:00
Alexander Kyte 4d5088dbe3 [runtime] Fix corlib out of date error with disabled COM 2017-01-10 18:26:18 +00:00
Alexander Köplinger ca5104094c [bcl] Remove System.Activities.Presentation folder from referencesource
We won't import it into Mono anytime soon and the long paths
cause issues when checking out Mono on Windows.
2017-01-10 16:31:29 +01:00
Aleksey Kliger (λgeek) ea176c5bb8 [reflection] Coop handles icalls in System.Reflection and System.RuntimeTypeHandle (#4217)
* [sre] Add typed coop handle declarations

* [reflection] Implement mono_reflection_get_token_handle

  Rewrite mono_reflection_get_token_checked to use it.

* [reflection] Use handles for ves_icall_reflection_get_token

  - Get rid of mono_reflection_get_token_checked
  - Rename mono_reflection_get_token_handle to mono_reflection_get_token_checked

* [reflection] Use handles for ves_icall_GetCurrentMethod

* [reflection] Use handles for ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType_native

* [reflection] Use handles for ves_icall_System_Reflection_Module_ResolveSignature

* [reflection] Use handles for ves_icall_System_Type_internal_from_name

* [reflection] Use handles for ves_icall_System_Type_internal_from_handle

* [runtime] Use coop handles for System.Object.GetType ()

* [reflection] Use handles for ves_icall_MonoField_GetParentType

* [reflection] Use handles for ves_icall_MonoField_ResolveType

* [reflection] Use handles for most icalls in System.RuntimeTypeHandle

  - GetArrayRank
  - GetAttributes
  - GetBaseType
  - GetElementType
  - HasInstantiation
  - IsArray
  - IsByRef
  - IsComObject
  - IsGenericTypeDefinition
  - IsGenericVariable
  - IsPointer
  - IsPrimitive
  - type_is_assignable_from

* [reflection] Use handles for ves_icall_RuntimeTypeHandle_GetGenericTypeDefinition_impl

  and ves_icall_RuntimeTypeHandle_GetGenericParameterInfo
2017-01-10 10:22:14 -05:00
Aleksey Kliger 086b93022e [runtime] Set the pinvoke bit for handles-using icall callsites.
The MonoMethodSignature:pinvoke bit causes the IR translation to clear the
upper bits of return values that are smaller than a register. (See
mono_emit_widen_call_res)

Without this change, any icall returning a boolean (8 bits on .NET) might have
non-zero upper bits which will cause branches to misbehave.
2017-01-10 10:05:05 -05:00
Marek Safar d97516d1d1 [build] Add WIN_PLATFORM define 2017-01-10 11:14:22 +01:00
Zoltan Varga 7512b5422b Revert "[configure] avoid 'no symbols' warnings on darwin"
This reverts commit c1f39f3cb4.

Reverted this to get CI back.
2017-01-09 18:15:41 -05:00
Zoltan Varga 2ba6bcbc48 [aot] Rewrite the AOT profiler. (#4176)
* [aot] Rewrite the AOT profiler.

The AOT profiler is used to collect the methods/instances used at runtime.
Usage:
* mono --profile=aot:output=out.aotprof <app>
* mono --aot=profile=out.aotprof <assembly>

The first command will run <app>, collecting the list of methods it uses into the out.aotprof file.
The second command passes the profile file to the AOT compiler to have it generate additional generic instances.

* [docs] Add a section for AOT profiling to the mono(1) man page.

* [build] Collect AOT profile info from building mscorlib in the build profile, and use it when aot-ing the csc assemblies.

* [runtime] Add missing mono-profiler-aot.h file.

* [runtime] Tidy up usage of MONO_PROFILER_API.

* [aot] Improve error handling in the aot profiler.

* [aot] Improve error handling, add more diagnostics.
2017-01-09 17:37:57 -05:00
Bernhard Urban ec10c6e3fb [amd64/tramp] hide interpreter specific trampoline behind ifdef 2017-01-09 23:34:04 +01:00
Bernhard Urban 21b0819db1 [interpreter] fix warnings in trampoline and remove dead code 2017-01-09 23:34:01 +01:00
Bernhard Urban 918958bbdb [interpreter] get rid of ugly copy/paste hack and include mini.h instead 2017-01-09 23:33:58 +01:00
Bernhard Urban 9fef9cfb66 [interpreter] fix compiler warnings 2017-01-09 23:33:56 +01:00
Bernhard Urban a7c2b841b9 [interpreter] remove basic-simd.exe from richeck target
due to the switch to roslyn we get different code for certain scenarios;
roslyn relies more on a working implementation of generics...
2017-01-09 23:33:53 +01:00
Bernhard Urban a4fcc5a694 [interpreter] guard some debug messages with DEBUG_INTERP 2017-01-09 23:33:51 +01:00
Bernhard Urban a7aba9c582 [interpreter] initialize tls subsystem 2017-01-09 23:33:48 +01:00
Bernhard Urban 796e882c19 [interpreter] remove CALLINT opcode, go through wrapper instead.
the managed wrapper already does everything properly, don't replicate
the logic. For example, since recently some icalls marked with `HANDLE`
require a MonoError object.
2017-01-09 23:33:45 +01:00
Bernhard Urban a81fa4ca1e [interpreter] support conversion of internal pointer type in conv.u 2017-01-09 23:33:43 +01:00
Bernhard Urban f1e08ad12f [interpreter] master rebase fixups 2017-01-09 23:33:40 +01:00
Bernhard Urban 3a29de4999 [interpreter] remove FIXME 2017-01-09 23:33:38 +01:00
Bernhard Urban 609b2c3257 [interpreter] implement CEE_MONO_LDPTR_INT_REQ_FLAG 2017-01-09 23:33:35 +01:00
Bernhard Urban 36e075d3f2 [interpreter] factor out CALL transformation
... so that it can be reused for CEE_MONO_CALLI_EXTRA_ARG
2017-01-09 23:33:32 +01:00
Bernhard Urban 16c727740e [interpreter] add MINT_ICALL_V_P opcode 2017-01-09 23:33:30 +01:00
Bernhard Urban beb96e3cf4 [interpreter] allow up to three arguments in interpreter->native trampoline 2017-01-09 23:33:27 +01:00
Bernhard Urban e8cfc817b7 [interpreter] fix multicast delegates 2017-01-09 23:33:24 +01:00
Bernhard Urban 79f61fbc17 [interpreter] properly clean up the error in get_virtual_method 2017-01-09 23:33:22 +01:00
Bernhard Urban 10430d10ce [interpreter] fix interface method lookup 2017-01-09 23:33:19 +01:00
Bernhard Urban a399d26270 [interpreter] fix ves_array_set 2017-01-09 23:33:16 +01:00
Bernhard Urban 2e9f51d2d7 [interpreter] support return vals in interpreter->native trampoline 2017-01-09 23:33:14 +01:00
Bernhard Urban dd8dfa78c9 [interpreter] do proper unboxing according to its type 2017-01-09 23:33:11 +01:00
Bernhard Urban 500afe3edc [interpreter] add filter to regression harness 2017-01-09 23:33:09 +01:00
Bernhard Urban cfebb416c8 [interpreter] remove wrong error trap 2017-01-09 23:33:06 +01:00
Bernhard Urban b06df4403c [interpreter] fix vtable lookup 2017-01-09 23:33:03 +01:00
Bernhard Urban f241afa9ce [interpreter] implement UNBOX_ANY with UNBOX (ignoring generics) 2017-01-09 23:33:01 +01:00
Bernhard Urban 29de444b4f [interpreter] register missing callback 2017-01-09 23:32:58 +01:00
Bernhard Urban 342285a5bb [interpreter] improve --regression flag wrt exceptions 2017-01-09 23:32:55 +01:00
Bernhard Urban ecc0f09a9e [interpreter] first version of trampoline for interpreter->native transition
this trampoline is supposed to handle an arbritrary amount of arguments.
The trade-off is that this is a bit slower, however, it only requires
one instantiation as opposed to an instantiation for every method
signature.
2017-01-09 23:32:53 +01:00
Bernhard Urban 7db2325992 [interpreter] more asserts and debug info 2017-01-09 23:32:50 +01:00
Bernhard Urban be27ecc37d [ci] add interpreter 2017-01-09 23:32:48 +01:00
Bernhard Urban d29b812ca7 [interpreter] run more regression tests 2017-01-09 23:32:45 +01:00
Bernhard Urban 2bc49b4f03 [mini] update .gitignore 2017-01-09 23:32:42 +01:00
Bernhard Urban 355b85fa59 [interpreter] add configure flag and --regression flag 2017-01-09 23:32:40 +01:00
Bernhard Urban aeb374d274 [interpreter] make stacktraces partially work 2017-01-09 23:32:37 +01:00
Bernhard Urban 4cfd69c91e [interpreter] throw overflow exception for div instruction 2017-01-09 23:32:34 +01:00
Bernhard Urban 6f98c98c8e [interpreter] add --regression feature for basic execution engine tests 2017-01-09 23:32:32 +01:00
Bernhard Urban 88385892af [interpreter] print instruction as string 2017-01-09 23:32:29 +01:00
Bernhard Urban d7c2e71e32 [interpreter] output thread addr as hex 2017-01-09 23:32:26 +01:00
Bernhard Urban 280222dcd4 [interpreter] fix build 2017-01-09 23:32:24 +01:00
Bernhard Urban c9fe53836a [interpreter] revive mono interpreter 2017-01-09 23:32:21 +01:00
Alexander Köplinger 0007e99a87 [btls] Capture inner exception in MobileAuthenticatedStream
Previously we'd just throw the catched exception again
which overwrites its stacktrace, making it less useful
since all you can see is e.g. a NullReferenceException
(re)thrown at MobileAuthenticatedStream:218.

We now capture the original exception information so
the stacktrace is more complete.
2017-01-09 19:48:37 +01:00
Alexander Köplinger ecf1f25fcd [btls] Use MONODROID ifdef instead of ANDROID
We use the former everywhere else in the codebase.
2017-01-09 18:59:10 +01:00
Alexander Köplinger 6d2420f49a [btls] Fix wrong path returned from MonoBtlsProvider.GetSystemStoreLocation()
The path ".mono/certs/NewTrust" doesn't actually exist,
it's called ".mono/new-certs/Trust". Look it up from
MonoBtlsX509StoreManager instead.

This API isn't used anywhere in the BTLS code, that's
probably why it wasn't noticed.
2017-01-09 18:55:51 +01:00
Alexander Köplinger 8c95b57796 [Mono.Security] Add message to obsolete APIs with replacements
It's very confusing to get an "obsolete" warning
without knowing what to replace the API with.
2017-01-09 17:29:15 +01:00
Marek Safar c3b962c865 [System] Fixes ios unresolved symbols 2017-01-09 16:53:46 +01:00
Johan Lorensson 440a7c06af Merge pull request #4195 from lateralusX/jlorenss/win-build-dependency
Fix build_init vcxproj to correctly detect changes in config.h.
2017-01-09 14:20:38 +01:00
Jonathan Chambers bccf7177f7 Add code manager callbacks so JIT can track memory chunk ranges and register stack walk handlers on Win64 (#4213) 2017-01-07 04:00:37 -05:00
Marek Safar 129f185e58 Bump nunit-lite 2017-01-06 17:40:53 +01:00
Marek Safar 3088ba686e [tools] Add C# strings encoding to resx2sr 2017-01-06 17:40:26 +01:00
Marek Safar 695282c94b [build] Update mini tests tools to use correct path 2017-01-06 10:28:04 +01:00
Marek Safar 6245fc7b4e [corlib] Clean up some warnings 2017-01-06 09:12:42 +01:00
Zoltan Varga ee0c587fff [aot] Avoid a crash in the aot compiler if a delegate doesn't have a BeginInvoke ()/EndInvoke () method. Fixes #51206. 2017-01-05 19:46:53 -05:00
Zoltan Varga 2d7588f339 [jit] Fix the check for calling mono_get_vtable_var (), check for 'cfg->method' instead of 'method', the latter is the inlined method. (#4209) 2017-01-05 19:24:05 -05:00
Zoltan Varga b428249c7a [aot] Aot System.Numerics.dll as well for the make fullaotcheck/llvmonlycheck targets. 2017-01-05 16:39:58 -05:00
Aleksey Kliger 286ddebd9c Revert "[reflection] Additional coop handles changes (#4197)"
This reverts commit 59ed24831a.
2017-01-05 12:08:53 -05:00
monojenkins c11459faf3 [msvc] Update csproj files (#4207) 2017-01-05 17:36:22 +01:00
Aleksey Kliger (λgeek) 59ed24831a [reflection] Additional coop handles changes (#4197)
* [sre] Add typed coop handle declarations

* [reflection] Implement mono_reflection_get_token_handle

  Rewrite mono_reflection_get_token_checked to use it.

* [reflection] Use handles for ves_icall_reflection_get_token

  - Get rid of mono_reflection_get_token_checked
  - Rename mono_reflection_get_token_handle to mono_reflection_get_token_checked

* [reflection] Use handles for ves_icall_GetCurrentMethod

* [reflection] Use handles for ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType_native

* [reflection] Use handles for ves_icall_System_Reflection_Module_ResolveSignature

* [reflection] Use handles for ves_icall_System_Type_internal_from_name

* [reflection] Use handles for ves_icall_System_Type_internal_from_handle

* [runtime] Use coop handles for System.Object.GetType ()

* [reflection] Use handles for ves_icall_MonoField_GetParentType

* [reflection] Use handles for ves_icall_MonoField_ResolveType

* [reflection] Use handles for most icalls in System.RuntimeTypeHandle

  - GetArrayRank
  - GetAttributes
  - GetBaseType
  - GetElementType
  - HasInstantiation
  - IsArray
  - IsByRef
  - IsComObject
  - IsGenericTypeDefinition
  - IsGenericVariable
  - IsPointer
  - IsPrimitive
  - type_is_assignable_from

* [reflection] Use handles for ves_icall_RuntimeTypeHandle_GetGenericTypeDefinition_impl

  and ves_icall_RuntimeTypeHandle_GetGenericParameterInfo
2017-01-05 11:29:09 -05:00
Marek Safar b572846271 [System] Cleanup some warnings 2017-01-05 15:01:08 +01:00
Marek Safar 22d1d4ad1c Merge pull request #4205 from marek-safar/compression
[System] Use GZipStream from corefx
2017-01-05 09:37:55 +01:00
Alexander Köplinger ffff742d89 [bcl] Look in all .sources files when gathering files to dist
Previously we would only look into files ending in libraryname.sources.
This breaks down in cases where we used e.g. "#include common.sources"
because those files don't match the pattern and would be left out.

To fix this we could either start resolving includes in the .sources,
but the simpler fix is to just dist files from all normal .sources files.
2017-01-05 03:58:36 +01:00
Bernhard Urban c1f39f3cb4 [configure] avoid 'no symbols' warnings on darwin
This helps to get rid of the messages like these:

```
/Applications/Xcode8.1-beta1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libmonosgen-2.0.a(libmonoruntimesgen_la-coree.o) has no symbols
/Applications/Xcode8.1-beta1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libmonosgen-2.0.a(libmonoruntimesgen_la-file-mmap-windows.o) has no symbols
/Applications/Xcode8.1-beta1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libmonosgen-2.0.a(libmonoruntimesgen_la-lock-tracer.o) has no symbols
/Applications/Xcode8.1-beta1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libmonosgen-2.0.a(libmonoruntimesgen_la-mono-endian.o) has no symbols
[...]
```

That is what is in `libtool`:

```
# Commands used to build an old-style archive.
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
```

`ar` is calling `ranlib`, and then `libtool` calls `ranlib` again. We
cannot control how `ar` calls `ranlib` (that is, we can't tell it to
pass `-no_warning_for_no_symbols`), but we can control to not call it
at all.  Let's to that then.

As a reference, source code of `ar`:
https://opensource.apple.com/source/cctools/cctools-895/ar/ar.c.auto.html
2017-01-05 01:46:37 +01:00
monojenkins 0ef271dcc2 [msvc] Update csproj files (#4204) 2017-01-04 23:50:10 +01:00
Alexander Köplinger 5c4f9d7528 [mcs] Accept and ignore /debug:portable option
We'll just generate a normal .mdb instead.

Decided not to update the help text since
technically we don't support generating a ppdb.
2017-01-04 23:46:03 +01:00
Marek Safar cb2dfe18fd [System] Use GZipStream from corefx 2017-01-04 23:37:19 +01:00
Marek Safar 5f5e06f59c Merge pull request #4202 from marek-safar/compression
[System.IO.Compression] Replaced by corefx implementation
2017-01-04 23:32:36 +01:00
Alexander Kyte 9b02604cc6 [llvmonly] Use right IMT slow path for lazy array interfaces (#4199) 2017-01-04 17:00:34 -05:00
Alexander Köplinger 10dd36e3a8 [System.Core] Fix infinite loop in csproj-local target
This was introduced in 9d5de96b0f since
we would now call the csproj-local target without `intermediate`
being set which results in an infinite loop.

Overriding the target doesn't seem to be necessary anymore, so remove it.
2017-01-04 22:32:53 +01:00
Alexander Köplinger 488b550ac0 [btls] Pass CC and CXX to the BTLS CMake and disable BTLS on older GCC (#4200)
CMake doesn't pick up the compiler from the PATH by default,
it only looks in default locations so without this we might
end up using a different compiler for BTLS than for the main
Mono build which we don't want.

BTLS also requires a fairly new GCC which includes C++11
features, added a quick check for stdalign.h which BTLS
requires and disable it if the header isn't found.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=46712
2017-01-04 19:49:41 +01:00
Marek Safar 5dd56dbe70 [build] Fixes monotouch_tv_runtime build 2017-01-04 17:34:34 +01:00
Marek Safar 87eabe71f4 [build] Fixes monotouch_runtime build 2017-01-04 17:19:49 +01:00
Marek Safar 3f9b2dfd5f [System.IO.Compression] Replaced by corefx implementation 2017-01-04 15:37:40 +01:00
Marek Safar b7f6f7976e Revert "Bump corlib version"
This reverts commit acf7d85971.
2017-01-04 13:46:29 +01:00
Marek Safar 7c09a59ee3 [System] Compression enums from corefx 2017-01-04 13:01:09 +01:00
Marek Safar e12d557e4e [build] Fixes tarball build on systems with old mono 2017-01-04 12:37:12 +01:00
David Karlaš 41bb2b5316 Merge pull request #4196 from DavidKarlas/stepAndCatchException
[Debugger] Fixed step-in and step-out in case of exception + unit tests
2017-01-04 07:49:11 +01:00
Vladimir Kargov d726f624da [jit] Remove the meaningless lokup loop in mono_merge_basic_blocks(), add assertions. 2017-01-03 16:18:08 -08:00
Alexander Köplinger ce68b90aa7 [System] Include common.sources in the tarball 2017-01-04 01:12:58 +01:00
Alexander Köplinger acf7d85971 Bump corlib version
Somehow mcs.exe disappeared from monolite even though it was added
in 68d56e8027 and worked for a while.

See if bumping corlib version (i.e. generating a new monolite) fixes it.
2017-01-04 01:04:32 +01:00
Alexander Köplinger 23dbe0e1d6 [xbuild] Fix test that got broken by 248fded92a 2017-01-03 22:38:09 +01:00
Vlad Brezae 379436fcf5 Merge pull request #4152 from BrzVlad/misc-gc-altstack
[sgen] Reenable gc-altstack test
2017-01-03 21:12:46 +02:00
Marek Safar e1421384bd [System] Warnings cleanup 2017-01-03 17:05:26 +01:00
Marek Safar 09774416fd [System] Keep single MonoPInvokeCallbackAttribute implementation 2017-01-03 16:01:24 +01:00
Marek Safar 208dd1e956 [System] Unify Mono.Security dependency to be same for all profiles 2017-01-03 15:13:57 +01:00
Marek Safar 248fded92a [xbuild] More tweaks for portable debug mode 2017-01-03 11:02:09 +01:00
Marek Safar 19dd86f809 [mcs] Disable more array interpolation on user code. Fixes #51166 2017-01-02 19:12:13 +01:00
Marek Safar 676c45bd3e Merge pull request #4194 from DavidKarlas/bug44974
Bug 44974 - [pdb] stepping over is not working
2017-01-02 19:03:45 +01:00
Marek Safar 9ea10965af Roslyn 2.0 (rc2) upgrade 2017-01-02 18:51:40 +01:00
David Karlaš 9a231cd18e [Debugger] Fixed step-in and step-out in case of exception + unit tests
Before this change step-in and step-out didn’t place breakpoints on catch handlers which caused code to continue execution instead of stopping since it missed all breakpoints…
2016-12-28 21:03:53 +01:00
lateralusX 23b8b5d387 Fix build_init vcxproj to correctly detect changes in config.h.
build_init project doesn't detect changes done in config.h. This is needed in order
for build_init to replace config.h with winconfig.h and backup cygconfig.h. This is
normally an issue if you do a reconfigure and build using make and then msbuild. The msbuild
will then fail, since config.h is still the cygwin version. Solution is to do a rebuild all
that will trigger build_init. This fix will make sure that build_init gets invoked if there has been a change to config.h.

There was also a very old issue with the first copy of config.h -> cygconfig.h. This is only done
if there is no cygconfig.h in the directory. This means that the cygconfig.h will not be update until
deleted and a new build_init has been invoked. This fix will make sure cygconfig.h is always updated
if config.h is the cygwin generated version (not already replaced with winconfig.h).
2016-12-28 16:50:54 +01:00
David Karlaš 7308137e43 Merge pull request #4193 from DavidKarlas/stepinSpeedup
[Debugger] Fixed bug where we loop randomly long(+1) and optimised stepping in(over) non-user code
2016-12-28 15:33:53 +01:00
David Karlaš ad14ebb899 [Debugger] Fixed bug where we loop randomly long(+1 part) and optimised stepping in(over) non-user code 2016-12-28 15:22:11 +01:00
David Karlaš 7996debb67 Bug 44974 - [pdb] stepping over is not working
mcs.exe didn’t emit some NOPs after method calls needed when doing StepOut, now that Roslyn emits this we correctly step out to line that called hence, some unit tests needed correcting
2016-12-28 15:11:02 +01:00
Zoltan Varga f997a6e0de [simd] Enable simd support when 32 bit floats are enabled. 2016-12-27 22:09:52 -05:00
Zoltan Varga 533f6c5675 [llvm] Fix compilation/working with recent llvm versions. This should work with 4d6d2b05a267f9f4e46fdbb302f380add938b0cd from the mono/llvm repo. 2016-12-27 20:08:55 -05:00
Zoltan Varga 8b40ce3f32 Fix a warning. 2016-12-27 18:02:48 -05:00
Aleksey Kliger (λgeek) 972f3c8ced [reflection] Use handles for several more icalls (#4098)
* [runtime] Remove MonoReflectionGenericMethod typedef.

  - It's not used in the runtime,
  - Unlike other defs in object-internals.h it doesn't seem to have a
    corresponding managed object.

* [reflection] Add mono_field_get_object_handle.

  Reimplement mono_field_get_object and mono_field_get_object_checked in
  terms of it.

* [reflection] Add mono_property_get_object_handle

  Reimplement mono_property_get_object and
  mono_property_get_object_checked in terms of it.

* [reflection] Use handles for FieldInfo,MonoPropertyInfo,ParameterInfo.GetTypeModifiers

* [reflection] Use handles for MonoMethodInfo.get_parameter_info

  - Change mono_param_get_objects_internal to use handles

* [reflection] Cleanup in method_object_construct

* [reflection] Use handles for System.Refleciton.EventInfo.internal_from_handle_type

  - Replace mono_event_get_object_checked by mono_event_get_object_handle
    which uses handles.

* [reflection] Use handles for System.Reflection.MethodBase.GetMethodBodyInternal

  - Replace mono_method_body_get_object_checked by
    mono_method_body_get_object_handle

* [reflection] Remove CHECK_OR_CONSTRUCT, it's dead code.

  All former callers now use CHECK_OR_CONSTRUCT_HANDLE

* [reflection] Use handles for FieldInfo.get_marshal_info and MonoMethodInfo.get_retval_marshal

  - Change mono_reflection_marshal_as_attribute_from_marshal_spec to
    return a handle; fix callers

* [metadata] Add mono_metadata_get_canonical_generic_inst utility function

* [reflection] Use handles for System.Reflection.Module.ResolveMemberToken and 3 more icalls

  - ResolveFieldToken
  - ResolveMethodToken
  - ResolveTypeToken
2016-12-27 15:37:18 -05:00
Aleksey Kliger 1fc6bdd1b0 [threadpool] Restore handle stack mark after a worker PerformWaitCallback
If a task calls native code that uses handles before completing, we should
dispose of any handles that it may have used before we park the worker.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=49423
2016-12-27 10:48:29 -05:00
Aleksey Kliger 82bbb8dbd8 [sgen] Assert that skipped threads have empty an HandleStack
If we skip scanning a thread with a non-empty handle stack, we may move an
object but fail to update the reference in the handle.
2016-12-27 10:48:29 -05:00
Aleksey Kliger fd7e072c8d [coop handles] Add mono_handle_stack_is_empty 2016-12-27 10:48:29 -05:00
Aleksey Kliger ed456c195f [coop handles] Add MONO_HANDLE_TRACK_OWNER mode.
If MONO_HANDLE_TRACK_OWNER is defined, each coop handle records the source location
where it was first allocated.
2016-12-27 10:48:29 -05:00
Alexander Köplinger d30ee1904c [System] Fix basic/build profile build
It was broken by 37875ca6f3.
2016-12-22 23:41:18 +01:00
Zoltan Varga faa5d1a9f7 [runtime] Add a few missing object offsets for arm. 2016-12-22 17:32:27 -05:00
Neale Ferguson 213568cf8e [jit] Fix a test which fails on big endian. 2016-12-22 17:11:07 -05:00
Marek Safar 37875ca6f3 [System] Remove duplicated sources info 2016-12-22 19:16:32 +01:00
Marek Safar 4d498e2be3 [System] remove unused file 2016-12-22 19:16:32 +01:00
Alexander Köplinger 045dbc0991 configure.ac: set CSC variable to mcs.exe when using mcs as the compiler
Otherwise it'd still be using Roslyn e.g. in mono/mini as $(CSC)
would continue to point to the Roslyn csc.exe which is wrong.
2016-12-22 18:49:46 +01:00
Aleksey Kliger (λgeek) 87b786ed92 Pump hazard pointer queue in unregister_thread while thread is still alive. (#4183)
Some of the destructors (for example mono_jit_info_table_free) may try to take
a lock, which requires that the current thread should be attached.
2016-12-22 11:41:04 -05:00
faulpeltz 10e1dc5314 Fix MonoBtlsX509StoreManager machine store paths (#4027)
The machineXYZPath fields are initialized with machinePath instead of
userPath which caused the machine stores not to work at all
2016-12-22 14:08:50 +01:00
Zoltan Varga ebf1f1cfd2 Fix a regression introduced by 98d7ad045e. 2016-12-22 07:07:12 -05:00
Marek Safar 815c007826 [build] More mcs hacking 2016-12-22 11:40:47 +01:00
Marek Safar e063415208 [build] install csc aot images from aot folder 2016-12-22 11:37:21 +01:00
Marek Safar 27ab4a8175 [System.Xml] Disable more failing tests on old xslt implementation 2016-12-22 10:38:02 +01:00
Marek Safar 2659724dd3 [System.Xml] Disable failing tests on old xslt implementation 2016-12-22 10:31:22 +01:00
Zoltan Varga 1a75e32112 [build] Pass --aot-path to the runtime when building the tests in tests/. 2016-12-21 20:41:15 -05:00
Zoltan Varga 4fe7a65f4f [build] Generate all aot images for csc into the profile directory instead of next to the corresponding assembly so the external/roslyn-binaries submodule doesn't get dirty. Pass the --aot-path argument to the runtime so it picks up the aot images. 2016-12-21 20:39:01 -05:00
Zoltan Varga 56498ccc8f Fix warnings. 2016-12-21 19:48:43 -05:00
Zoltan Varga 8199f32d3e [runtime] Remove some dead code. 2016-12-21 19:37:57 -05:00
Zoltan Varga 98d7ad045e [aot] Cleanup the AOT loading code a bit. Add a --aot-path= command line option to specify additional directories to search for AOT images. (#4191) 2016-12-21 19:30:27 -05:00
Alexander Köplinger 8027e0bb39 [bcl] Clean up old run-test.bat and *.csproj files
They .bat files haven't been used for a long time and don't work anymore.
The csproj files for the facades have a different name now.
2016-12-22 01:09:38 +01:00
Bernhard Urban 801cc68583 [exceptions] unregister SIGILL handler before calling abort () 2016-12-21 17:25:04 +01:00
Bernhard Urban a27bc024f1 [exceptions] only do SIGSEGV related actions for SIGSEGVs in mono_handle_native_crash 2016-12-21 17:25:04 +01:00
Michael DeRoy 3ceb9543ce Do not free marshaled string conversion buffer on win32 (#4140) 2016-12-21 11:21:47 -05:00
Alexander Köplinger b0ba5b9594 Include Open.snk in tarball 2016-12-21 16:51:47 +01:00
Marek Safar a3f17f8007 Merge pull request #4187 from rolfbjarne/dynamic-method-ios
[test] DynamicMethod isn't available on iOS.
2016-12-21 16:44:54 +01:00
Marek Safar 453e9feace [System.IO.Compression.ZipFile] Switch to corefx implementation 2016-12-21 16:43:42 +01:00
Henric Müller 71275496e8 Renamed profile to winaot (#4190) 2016-12-21 16:41:01 +01:00
Rolf Bjarne Kvinge 36cbe76167 [test] Use FULL_AOT_RUNTIME instead of MONOTOUCH. 2016-12-21 16:32:29 +01:00
Marek Safar e68d46f855 Merge pull request #4188 from Unity-Technologies/missing-internals-visible-to
Add missing InternalsVisibleTo attributes on mscorlib.
2016-12-21 15:58:21 +01:00
Marek Safar 48eeda4314 [build] Update runtime test tools to use correct path 2016-12-21 14:51:46 +01:00
Marek Safar 24d6656cb8 [ilasm] Don't break arguments compatiblity 2016-12-21 14:17:17 +01:00
Marek Safar d82b6dbac5 [ilasm] Clenup warnings 2016-12-21 14:13:30 +01:00
Vlad Brezae 088ea9db6e Merge pull request #4185 from BrzVlad/fix-arm64-finally-abort
[arm64] Fix finally abort
2016-12-21 15:12:44 +02:00
Tautvydas Žilys a970158e0d Add missing InternalsVisibleTo attributes on mscorlib. 2016-12-21 13:45:32 +02:00
Alexander Köplinger c5054e44a6 Merge pull request #4159 from akoeplinger/aot-only-rename
[bcl] Rename aot_only profile to testing_aot_full, aot_hybrid to testing_aot_hybrid
2016-12-21 12:37:35 +01:00
Rolf Bjarne Kvinge 5948e157e8 [test] DynamicMethod isn't available on iOS. 2016-12-21 11:44:10 +01:00
Alexander Kyte b8625e671a [runtime] Always expire a non-resolved hostname's cache
This addresses a regression here:

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

The commits
97e51abfcf and
d35b5d2188

changed control flow such that if the host can't be resolved
and host is set to null, then the later check will return null
for the duration that HasTimedOut is false.
2016-12-21 11:06:03 +01:00
Marek Safar edea0795cf Merge pull request #4184 from madewokherd/roslynaot
Fix roslyn install with AOT disabled.
2016-12-21 10:40:42 +01:00
Marek Safar b674f24074 [System.Core] LINQ from corefx 2016-12-21 10:07:54 +01:00
Vlad Brezae 6bc46fb15e [arm64] Fix finally abort
A try finally set looks like :

try:
   ...
   call finally
E: exit try_block

finally:
   ...
   call E

If we get aborted in the finally block, instead of calling to E, we call to a handler block trampoline which will throw the exception using a context that has the ip at E (since we need to execute the finally block first). We need to make sure that E is not logically part of the try block, otherwise we will end up calling the finally block again when unwinding the stack.
2016-12-21 03:40:16 +02:00
Zoltan Varga efea69ee03 [amd64] Disable boehm on osx64. 2016-12-20 19:44:06 -05:00
Vincent Povirk ba6c212d32 Fix roslyn install with AOT disabled. 2016-12-20 16:45:42 -06:00
João Matos 66d4425f04 Merge pull request #4118 from petertiedemann/fix-bug-48516
Fix bug 48516
2016-12-20 20:38:03 +00:00
Alexander Köplinger 5f885d53e7 [System.Xml] Fix casing of System.dll reference in Xslt compiler
Some XML tests enabled as part of 93e845de16 failed
on Linux because of the lowercased system.dll reference in referencesource:

```
1) CompileNoLineInfoSource (MonoTests.System.Xml.Xsl.MsxslScriptTests.CompileNoLineInfoSource)
   System.Xml.Xsl.XsltException : Script compile errors:
error CS0006: Metadata file `system.dll' could not be found

  at System.Xml.Xsl.XsltOld.Compiler.CompileAssembly (System.Xml.Xsl.XsltOld.ScriptingLanguage lang, System.Collections.Hashtable typeDecls, System.String nsName, System.Security.Policy.Evidence evidence) [0x00229] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Compiler.cs:823
  at System.Xml.Xsl.XsltOld.Compiler.CompileScript (System.Security.Policy.Evidence evidence) [0x00016] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Compiler.cs:749
  at System.Xml.Xsl.XsltOld.Compiler.Compile (System.Xml.Xsl.XsltOld.NavigatorInput input, System.Xml.XmlResolver xmlResolver, System.Security.Policy.Evidence evidence) [0x0009d] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Compiler.cs:200
  at System.Xml.Xsl.XslTransform.Compile (System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver resolver, System.Security.Policy.Evidence evidence) [0x00022] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs:264
  at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver resolver) [0x0000e] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs:82
  at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.IXPathNavigable stylesheet, System.Xml.XmlResolver resolver) [0x0000e] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs:69
  at System.Xml.Xsl.XslTransform.Load (System.Xml.XPath.IXPathNavigable stylesheet) [0x00000] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs:63
  at MonoTests.System.Xml.Xsl.MsxslScriptTests.CompileNoLineInfoSource () [0x00018] in /mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/System.XML/Test/System.Xml.Xsl/MsxslScriptTests.cs:210
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in mnt/jenkins/workspace/test-mono-mainline-linux/label/ubuntu-1404-i386/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
```
2016-12-20 20:41:21 +01:00
Zoltan Varga cf11343eb9 [jit] Allow simple TLS accesses in gsharedvt methods. Properly propagate errors in fill_runtime_generic_context (). Fixes #49056. 2016-12-20 14:19:20 -05:00
Zoltan Varga f3580381e1 [aot] AOT System.Numerics.Vectors when running make fullaotcheck. 2016-12-20 14:19:20 -05:00
Jo Shields 031d79c2c4 [mkbundle] Don't use Path.GetDirectoryName on directory (#4130)
`directory` is already a directory. It's in the name.

`Path.GetDirectoryName ("/path/to/a/thing")` returns `"/path/to/a"`, whether
`thing` is a directory or not. If there's a trailing `/` then it returns
the directory, not the parent - but we don't have a trailing `/`.

This fixes an issue where the path needs to be created by hand before an
SDK can be downloaded.
2016-12-20 20:02:09 +01:00
Alexander Köplinger 35a677b61d Add test profiles as a list on configure.ac summary
Should be easier to extend if we add more such profiles.

Also add the new Xbox profile which was missed.
2016-12-20 19:58:20 +01:00
Alexander Köplinger 342d23b74d [bcl] Rename aot_hybrid profile to testing_aot_hybrid 2016-12-20 19:29:54 +01:00
Alexander Köplinger 4098343789 [bcl] Rename aot_only profile to testing_aot_full 2016-12-20 19:29:54 +01:00
Zoltan Varga ec228cf9a4 [runtime] Add an assert to mono_class_setup_vtable_general () to catch cases when the max_vtsize calculation is incorrect. 2016-12-20 11:49:20 -05:00
Ludovic Henry c0fe371ab1 [build] Fix warning (#4177) 2016-12-20 10:16:01 -05:00
Bernhard Urban b463080174 [coop] switch to GC unsafe state in SIGINT handler as it may throw an exception 2016-12-20 15:40:33 +01:00
Bernhard Urban ee04d9fc68 [coop] switch to GC unsafe state in SIGFPE handler as it may throw an exception 2016-12-20 15:40:33 +01:00
Rodrigo Kumpera 5148ac7e88 Merge pull request #3981 from kumpera/fix_symbolification_issues
This PR adds runtime crash symbolification. It requires runtime and tooling changes.
2016-12-20 12:05:47 -02:00
Marek Safar f3d036a124 [System.Xml] Add support for msxsl format functions. Fixes #50242 2016-12-20 14:46:17 +01:00
Marek Safar 93e845de16 [System.Xml] Enable more tests 2016-12-20 14:46:17 +01:00
Neale Ferguson 37d6cde0ee Implement fast tls for s390x (#4161)
[s390x] Implement fast tls for s390x
2016-12-20 14:56:21 +02:00
Marek Safar 4273e1ef5b [sn] Improve signing error message 2016-12-20 12:02:34 +01:00
Marek Safar 87b020af95 [System.ValueTuple] Don't emit debug symbols 2016-12-20 12:02:34 +01:00
Niklas Therning 92f6ee7bdf Merge pull request #4178 from ntherning/fix-broken-windows-build
Fix broken Windows build due to missing mini-exceptions-native-unwinder.c
2016-12-20 11:23:32 +01:00
Niklas Therning c28deafe6c Fix broken Windows build due to missing mini-exceptions-native-unwinder.c
Commit 41272d634b removed mono/mini/mini-
exceptions-native-unwinder.c from the source tree but didn't update msvc
/libmono-static.vcxproj accordingly causing the VS build to fail.
2016-12-20 11:04:14 +01:00
Marek Safar d2b161ab7b [Facades] Removes duplicate signing info 2016-12-20 10:20:07 +01:00
Bernhard Urban 41272d634b [exception] remove dynamic loading of libunwind/libcorkscrew on Android
we will rely on the output of debuggerd in order to get a native stack
trace.  The arguments to support that:

(a) native stack trace by debuggerd is at least as good as the one we get via
    libunwind (most of the time the trace provided by libunwind is useless?)

(b) we cannot screw up by accident (e.g. we have seen issues with a too small altstack)

(c) we don't need to maintain the libunwind integration into mono (which we
    sort of had to do because of the upcoming dlopen limitation in Android 7.0
    Nougat).

(d) the libmonosgen-2.0.so had about one megabyte more footprint (16mb ->
    17mb). I'm talking about a debug build here though.

See mailing list discussion for more information:
http://lists.dot.net/pipermail/android-devel/2016-December/000026.html
2016-12-20 00:19:20 +01:00
Bernhard Urban 4f1280d588 [external] remove libunwind headers 2016-12-20 00:19:20 +01:00
Zoltan Varga d8743c7a96 [arm] Fix llvm support for HFA arguments. 2016-12-19 17:54:34 -05:00
Rodrigo Kumpera 2360aab8d3 [mono-symbolificate] Add test for nested type arguments and ambiguous matches. 2016-12-19 17:39:20 -02:00
Rodrigo Kumpera ea5c562dad [mono-symbolificate] Add support for runtime generated stacktraces and fix a bug.
First the bug fix.
If we hit a method with a nested type as argument, we would not include the outer types and fail to match.

Now for the big change.
The runtime now includes mvid and aotid in the stacktraces it generates. This makes them symboficatable but
with the side effect that the runtime adopts a more compact and slightly different format. Differences includes:

- short name for primitives (int, object, string, etc)
- <> for generic instances
- / for type nesting
- generics vars are appended with _REF
2016-12-19 17:39:13 -02:00
Zoltan Varga b65d3d76f2 [bockbuild] Disable boehm on osx64. 2016-12-19 13:07:31 -05:00
Rodrigo Kumpera 66fae66334 [mini] Implement callback that gives metadata access to seqpoint information. 2016-12-19 15:57:17 -02:00
Rodrigo Kumpera 0071edc907 [runtime] Include seqpoints, mvid and aotid on runtime generated stack traces. 2016-12-19 15:56:30 -02:00
Rodrigo Kumpera f3fed72782 [runtime] Extract mono_runtime_get_aotid from the icall code. 2016-12-19 15:56:30 -02:00
Rodrigo Kumpera faf9dda1ef [runtime] Use commas for array rank instead of a number when stringifying. 2016-12-19 15:56:30 -02:00
Marek Safar 3bbff5b405 [Facades] Add missing reference 2016-12-19 18:50:58 +01:00
Alexander Köplinger 1f38ad4d93 [Facades] Use the Open.snk key for the System.ValueTuple facade (#4173)
It is one of the libraries that started using this new key for signing:
https://github.com/dotnet/buildtools/commit/141bce1285f36bac7ddcef1947a9f2105953e6e5
2016-12-19 18:25:16 +01:00
Marek Safar 3daf6b7ca1 [build] Add new profile 2016-12-19 16:36:39 +01:00
Bernhard Urban 5247fa62ed [exception] print process map when crashing on Linux 2016-12-19 16:27:33 +01:00
Bernhard Urban c54da4dbf9 [unwinding] set DUMPABLE, so debuggerd can ptrace us 2016-12-19 16:26:19 +01:00
Marek Safar 9d5de96b0f [System.Core] SLE from CoreFX including interpreter 2016-12-19 14:19:30 +01:00
Vlad Brezae 79219ca718 Merge pull request #4155 from BrzVlad/fix-tls-lmf-addr
[runtime] Fix MONO_ARCH_ENABLE_MONO_LMF_VAR
2016-12-19 14:05:19 +02:00
monojenkins e1bc49df99 [msvc] Update csproj files (#4163) 2016-12-19 12:20:27 +01:00
Neale Ferguson 933bda30fd .NET allows each finalizer thread up to 2 seconds to complete and 40 seconds for all threads to complete. However, mono just allows 2 seconds for all finalizers. Some complex applications easily exceed this and this results in thread aborts to be invoked. This fix is simplistic as it simply replaces the 2 seconds with 40 without addressing the 2 seconds per finalizer thread. This problem is more complex but this fix will circumvent the problem until a final option is designed and implemented. (#4162) 2016-12-18 08:08:48 -05:00
Sergei Trofimovich f7ea181e35 configure.ac: import makedev() and friends from <sys/sysmacros.h> (#4170)
Current glibc's <sys/types.h> headers are included into
many C standard headers.

The problem here is that makedev()/major()/minor() macros
defined in <sys/sysmacros.h> leak into C standard headers
and poison global namespace.

The plan is to get rid of <sys/sysmacros.h> inclusion
in <sys/types.h>:
    https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html

On such system without implicit <sys/sysmacros.h> mono fails
to build as:

  CC       libmonoruntime_la-w32process-unix-default.lo
w32process-unix-default.c: In function 'mono_w32process_get_modules':
w32process-unix-default.c:225:12: error: implicit declaration of function 'makedev' [-Werror=implicit-function-declaration]
   device = makedev ((int)maj_dev, (int)min_dev);
            ^~~~~~~

autoconf has a AC_HEADER_MAJOR macro to autodetect
header for major() and friends.

This change switches to AC_HEADER_MAJOR.

Signed-off-by: Sergei Trofimovich <[email protected]>
2016-12-18 06:15:14 -05:00
Ludovic Henry 4d40970f99 [test-runner] Try to dump threads on timeout with lldb and gdb 2016-12-17 09:42:51 -05:00
Ludovic Henry f87d44b29a [mini] Inline only use of mono_runtime_syscall_fork 2016-12-17 09:42:51 -05:00
Ludovic Henry 0d20c88c47 [mini] Factor duplicates mono_gdb_render_native_backtraces 2016-12-17 09:42:51 -05:00
Ludovic Henry d4e61db1fe [threadpool] Remove assertion on RequestWorkerThread failure (#4167)
We observed that this assertion would sometimes be triggered on CI in case of intensive load. This would be possible because we wouldn't necessarily decrease the outstanding_request in a new worker. To decrease resource usage, we also want to limit the amount of new worker we request.
2016-12-17 09:42:18 -05:00
Ludovic Henry 8cbeea4767 [threadpool] Use threadpool->threads instead of threadpool->counters to wait on cleanup (#4146) 2016-12-17 09:41:36 -05:00
Zoltan Varga 99e9881bff [jit] Enable tests for the Vector<T> intrinsics. (#4157) 2016-12-17 07:11:21 -05:00
Zoltan Varga 79eb62822b [llvm] Fix the mapping of simd types to llvm types when using -O=-simd. 2016-12-17 07:08:09 -05:00
Zoltan Varga affa47bb1c [llvm] Add back support for OP_TLS_GET. 2016-12-17 05:56:41 -05:00
Jon Purdy a4d4872884 Fix XMM scanning on Mac x86.
MONO_CONTEXT_GET_CURRENT needed to be updated.
2016-12-16 16:15:55 -08:00
Jon Purdy a6d15bad4f [runtime] Fix Mach ARM assert.
This changes mono_mach_arch_get_thread_fpstate_size to return a value,
rather than asserting. The actual float state isn't used yet. This also
assumes NEON, which may not be correct.
2016-12-16 14:36:56 -08:00
Zoltan Varga f249d39a1d [simd] Fix the exception thrown by Vector<T>.CopyTo () on a failed bounds check. 2016-12-16 14:58:57 -05:00
Vlad Brezae da1e7bb009 [runtime] Fix MONO_ARCH_ENABLE_MONO_LMF_VAR
Using MONO_ARCH_ENABLE_MONO_LMF_VAR requires that we have means of getting the address of a tls variable (which is always the case when using __thread, but not necessarily when using pthread). Make sure that using it is properly guarded.

In the future we might want to remove MONO_ARCH_ENABLE_LMF_VAR and always try to use a tls variable for the lmf. Additionally we should benchmark what combinations work best and stick to them on all platforms. (ex when using fast tls we might consider using lmf_get + lmf_set if possible, when using fallbacks we might always want to use the lmf_addr to void multiple calls, always use lmf_ir etc).
2016-12-16 21:28:47 +02:00
Zoltan Varga 38da415de8 [aot] Bump AOT file format version due to changes to patch infos etc. 2016-12-16 13:47:38 -05:00
Ludovic Henry f4fdfcc714 [threads] Ensure thread is still alive when detaching it
If the compiler optimized it so that we would unregister the thread->thread_pinning_ref GC root before we would destroy the thread fields, we could run into "* Assertion at threads.c:1081, condition 'thread->suspended' not met"
2016-12-16 13:42:38 -05:00
Vlad Brezae b8072d9de0 [runtime] Remove old unused defines/prototypes 2016-12-16 19:39:09 +02:00
Marek Safar fb2a1556fb [build] Remove PEAPI from library profiles 2016-12-16 18:34:47 +01:00
Marek Safar fdafd289aa [build] Update list of aoted images in mcs mode 2016-12-16 16:11:39 +01:00
Marek Safar c221a74532 [System.Numerics.Vectors] Update to the latest CoreFX version 2016-12-16 15:43:58 +01:00
Marek Safar e048a72770 [System.Numerics.Vectors] Enable Vector on desktop profile 2016-12-16 15:26:38 +01:00
Marek Safar f4add65dea Bump corefx 2016-12-16 12:43:57 +01:00
Alexander Köplinger 38b073b9de [corlib] Override virtual DSA.HashData() methods in DSACryptoServiceProvider (#4150)
The methods were added in .NET 4.6 but couldn't be done abstract so instead
they were added virtual which just throws an exception telling you to override
it in the subclass.

We implemented this for RSACryptoServiceProvider in https://github.com/mono/mono/pull/3770
(the methods were already overriden in that case because we moved to referencesource)
but DSACryptoServiceProvider is still using the Mono code so we need to
implement it there too.
2016-12-16 11:53:25 +01:00
Zoltan Varga c1086268ba Fix a warning. 2016-12-15 21:47:55 -05:00
Vlad Brezae 46717b4a55 [sgen] Reenable gc-altstack test 2016-12-16 01:05:51 +02:00
Alexander Köplinger ed1006cd71 Revert "[build] Update list of aoted images in mcs mode"
This reverts commit 59b8a5d3ba.

It breaks the mcs build:

```
20:35:27 MONO_PATH='./../../class/lib/build/' > build_aot.log 2>&1 /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/runtime/mono-wrapper --aot=bind-to-runtime-version,outfile=/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll.so --debug /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll || (cat build_aot.log; exit 1)
20:35:27 Failed to load method 0x6000001 from '/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll' due to Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>.
20:35:27 Run with MONO_LOG_LEVEL=debug for more information.
20:35:27 AOT of image /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll failed.
20:35:27 Mono Ahead of Time compiler - compiling assembly /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll
20:35:27 AOTID 368C895D-F9C7-38E7-C0BA-F9B6964CD1A0
20:35:27
make[7]: *** [/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Reflection.Metadata.dll.so] Error 1
20:35:27 make[7]: *** Waiting for unfinished jobs....
20:35:27 Failed to load method 0x6000001 from '/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll' due to Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>.
20:35:27 Run with MONO_LOG_LEVEL=debug for more information.
20:35:27 AOT of image /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll failed.
20:35:27 Mono Ahead of Time compiler - compiling assembly /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/System.Collections.Immutable.dll
20:35:27 AOTID 368C895D-F9C7-38E7-C0BA-F9B6964CD1A0
20:35:27 make[7]: *** [/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools//System.Collections.Immutable.dll.so] Error 1
20:35:27 Failed to load method 0x600000c from '/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/csc.exe' due to Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>.
20:35:27 Run with MONO_LOG_LEVEL=debug for more information.
20:35:27 AOT of image /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/csc.exe failed.
20:35:27 Mono Ahead of Time compiler - compiling assembly /mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/csc.exe
20:35:27 AOTID 44CBE5F8-37FA-0F68-B472-47E2F4209FC5
20:35:27 System.Collections.Immutable.dll
20:35:27 AOTID 368C895D-F9C7-38E7-C0BA-F9B6964CD1A0
20:35:33 make[7]: Leaving directory `/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/mcs/class/aot-compiler'
20:35:33 make[6]: Leaving directory `/mnt/jenkins/workspace/test-mono-mainline-mcs/label/ubuntu-1404-amd64/mcs/class/aot-compiler'
20:35:33 make[6]: *** [do-all] Error 2
```
2016-12-15 21:36:41 +01:00
monojenkins bcba54064d [msvc] Update csproj files (#4151) 2016-12-15 21:01:12 +01:00
Marek Safar 59b8a5d3ba [build] Update list of aoted images in mcs mode 2016-12-15 19:04:31 +01:00
Marek Safar af10ff717e [System.Core] Add CryptoServiceProviders to mobile 2016-12-15 17:01:43 +01:00
Marek Safar f1408c59c5 [Facades] Move IncrementalHash to System.Security.Cryptography.Algorithms facade
It looks like the type won't be part of .net for anytime soon
2016-12-15 15:23:56 +01:00
Marek Safar dbb4dbcce7 [corlib] Fixes warning 2016-12-15 15:23:56 +01:00
Ludovic Henry 3a185940f9 [process] Fix process-unref-race.exe (#4144)
* [process] Rename MonoProcess to Process as it's not public anymore

* [process] Replace setting process->pid = 0 by process->signalled = TRUE

* [process] Remove processes_mutex lock when unrefing process->handle

We do not need to synchronize it here because we do not modify `processes`, and the only other place where we access process->handle is before adding it to `processes`.

* [process] Fix race condition

Without this memory barrier `process->next = processes` and `processes = process` could be reordered, and when accessing `processes` in mono_sigchld_signal_handler, we could observe a NULL processes->next. This would make us not find a pid in `processes`, and because of the posix API, we would never mark this process as exited.

This would trigger a hang in `process-unref-race.exe` test.

Thank you to @kumpera for the help figuring this out!
2016-12-15 08:18:23 -05:00
Vlad Brezae 8995297d8a [s390x] Fix build 2016-12-15 15:13:56 +02:00
Bernhard Urban dbaca79c47 [aot] fix linker invocation for llvm mode on linux
clang++ should only be used for llvm_only (aka. bitcode) mode.

this is a follow up fix for:
https://github.com/mono/mono/commit/7d238ddd5edeeb42cec5e07b6d6527d16332f921
and
https://github.com/mono/mono/commit/fc5305d2af1b6891b05cb82342bf92d4659546e1

fixes https://bugzilla.xamarin.com/show_bug.cgi?id=46375
2016-12-15 13:49:48 +01:00
Marek Safar d1d54df3ac [tools] Add resx2sr internal tool 2016-12-15 11:23:06 +01:00
Vlad Brezae a650d4d72c Merge pull request #4014 from BrzVlad/feature-tls-refactor
[runtime] thread local storage refactor
2016-12-15 12:22:04 +02:00
Zoltan Varga fa7aecc9e6 [arm64] Mark MONO_CONTEXT_GET_CURRENT () as clobbering x16. 2016-12-15 09:47:34 +01:00
Alexander Köplinger f13551d2d4 Fix build break due to Cecil API change
https://github.com/jbevain/cecil/commit/42db79cc16f1cbe8dbab558904e188352dba2b41
2016-12-14 21:35:31 +01:00
Ankit Jain c952badd43 [xbuild] Bump buildtools to get support for netstandard 1.6
https://github.com/mono/buildtools/commit/9b6ee8686be55a983d886938165b6206cda50772
2016-12-14 14:57:33 -05:00
Sebastien Pouliot faf2a56710 [system] Remove port number from TLS Server Name Identification (SNI). Fixes #46549 (#4120)
The port number should not be included along the host name. Otherwise
the server will refuse the connection (and we'll throw). This is a
problem when servers are not using the default (443) SSL/TLS port.

ref: https://bugzilla.xamarin.com/show_bug.cgi?id=46549

The BTLS provider was fixed but the old MonoTLS (managed) provider had
the same issue.

Another PR will be made to fix AppleTLS in xamarin-macios repo [2]

[1] https://github.com/mono/mono/pull/3939
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=45994
2016-12-14 20:24:41 +01:00
Alexander Köplinger 9b6a2feb20 Bump cecil to get portable pdb fix 2016-12-14 20:16:08 +01:00
Vlad Brezae dc77e02244 [arm] Resurrect inlined fast tls
Only on desktop linux, where we now inline aeabi_read_tp.
2016-12-14 17:52:51 +02:00
Vlad Brezae d30f89875e [arm64] Resurrect inlined fast tls 2016-12-14 17:52:51 +02:00
Vlad Brezae e21c1281c1 [x86] Resurrect inlined fast tls 2016-12-14 17:52:50 +02:00
Vlad Brezae 3552325d9e [runtime] Global debug option for using fallback tls 2016-12-14 17:52:50 +02:00
Vlad Brezae e7e6e6c697 [amd64] Resurrect inlined fast tls
By default all platforms will call into native getters/setters whenever they need to get access tls value. On certain platforms we can try to be faster than this and avoid the call. We call this fast tls and each platform defines its own way to achieve this. Fast tls should normally be inlined, otherwise there is little point to doing anything else in the first place (on linux, __thread access is 2-3 instructions, on mac pthread_getspecific is 2 instructions, other platforms also having decent implementations).  For this, a platform has to define MONO_ARCH_HAVE_FAST_TLS, and provide alternative getters/setters for a MonoTlsKey. In order to have fast getter/setters, the platform has to declare a way to fetch an internal offset (MONO_THREAD_VAR_OFFSET) which is stored in the tls module, and in the arch specific file probe the system to see if we can use the offset initialized here. If these run-time checks don't succeed we just use the fallbacks.

In case we would wish to provide fast inlined tls for aot code, we would need to be sure that, at run-time, these two platform checks would never fail otherwise the tls getter/setters that we emitted would not work. Normally, there is little incentive to support this since tls access is most common in wrappers and managed allocators, both of which are not aot-ed by default. So far, we never supported inlined fast tls on full-aot systems.
2016-12-14 17:52:50 +02:00
Vlad Brezae 7f76306f79 [runtime] Refactor and unify tls access
The purpose of this commit is to unify tls access across all platforms. We had tls information spread out throughout the entire code which was guarded with many defines/capabilities which made very hard to follow what was going on. Also this made switching between pthread and __thread very unstable since there were a lot of dependencies between different pieces of the tls infrastructure. Also it was not very clear what happens if one of the tls pieces failed.

Now we are moving all the tls variables to a single module that provides getters/setters and initialization API. Runtime code now knows that we can always access a tls variable (from managed code, we just do a nowrapper icall into the same global geters/setters). Even though we used to these type of calls all around before, it is worth mentioning that runtime should account for a thread to be in this type of unregistered code without m2n wrapper and no register jinfo.

On average this makes common tls intensive methods (m2n wrappers and managed allocator) 20% slower, with potential for more regression if we use tls getters/setters recklessly. As a consequence we will re-enable the most important pieces of fast tls code in the future.
2016-12-14 17:52:49 +02:00
Bernhard Urban 0b8670e8fb [exception] do not wrap SIGILL into a managed exception
there is not much point in trying to recover from it and even worse,
wrapping it into a managed exception might hide it if the application is
sloppy with exception handling (cf. Pokémon Exception Handling).
2016-12-14 12:43:51 +01:00
Bernhard Urban 1940d5f89b [exception] rename mono_handle_native_sigsegv -> mono_handle_native_crash 2016-12-14 12:43:51 +01:00
Bernhard Urban 1bc7eca560 [exception] pass signal as string already to mono_handle_native_sigsegv 2016-12-14 12:43:51 +01:00
Marek Safar 85b44400c8 Merge pull request #4139 from lambdageek/bug-49686
[sre] Implement DynamicMethod.GetCustomAttributes() and IsDefined() (Fixes #49686)
2016-12-14 11:08:51 +01:00
Vlad Brezae 6a7b2575ba Merge pull request #4110 from BrzVlad/fix-sgen-win32
[sgen] Fix sgen win32
2016-12-14 11:56:08 +02:00
Zoltan Varga ce5bfb1f78 [jit] Add a workaround to avoid a crash in mini_above_abort_threshold () when using bitcode. 2016-12-14 07:13:43 +01:00
Ludovic Henry 5294685b97 [process] Remove useless FIXME 2016-12-13 21:44:46 -05:00
Zoltan Varga f1866eea8e [arm64] Save the fp regs in MONO_CONTEXT_GET_CURRENT (). (#4121) 2016-12-13 17:38:41 -05:00
Ludovic Henry 33ee8becf2 [threadpool] Assert that we do not overflow ThreadPoolCounter starting and working fields (#4138) 2016-12-13 16:58:15 -05:00
Ludovic Henry 8882af17e6 [threadpool] Fix MonoTests.runtime.unload-appdomain-on-shutdown.exe (#4135)
* [threadpool] Increase and decrease refcount when removing domain

* [threadpool] Fix unload-appdomain-on-shutdown.exe

If the threadpool is not initialized, there is no need to initialize it, as no worker is going to start in the domain because mono_domain_is_unloading would return TRUE.
2016-12-13 16:53:03 -05:00
Aleksey Kliger 789fb679be [sre] Implement DynamicMethod.GetCustomAttributes() and IsDefined ()
Per .NET documentation, DynamicMethod does not support custom attributes
exception the MethodImplAttribute pseudo-custom attribute.

Also change GetMethodImplementationFlags to include NoInlining as on .NET

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=49686
2016-12-13 16:34:18 -05:00
Aleksey Kliger 57527cb400 [test] Test for System.Linq.Expressions.MethodCallExpression with a DynamicMethod
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=49686
2016-12-13 16:34:16 -05:00
Vlad Brezae 009f37b26d Revert "[ci] Move mcs switch for Win32 builds into the run-jenkins.sh script"
This reverts commit 2b8d9bdb08.
2016-12-13 22:55:38 +02:00
Vlad Brezae 390fe34cb4 [sgen] Don't suspend thread in wow64 transition
The stack pointer provided by GetThreadContext is not reliable.
2016-12-13 22:55:36 +02:00
Aleksey Kliger 28ed64f543 [test] Test for System.Reflection.Emit.DynamicMethod.GetCustomAttributes 2016-12-13 15:50:13 -05:00
Vlad Brezae 8bdd416663 [sgen] binary protocol on windows 2016-12-13 20:44:05 +02:00
Vlad Brezae 821aabda89 [runtime] Fix prototype of functions
These functions are cast and invoked as a MonoThreadStart (which requires to receive on arg, return one arg and be WINAPI on windwos), which could lead to cconv problems if the prototype is not matching.
2016-12-13 20:44:04 +02:00
Zoltan Varga 339b8a166c Fix a warning. 2016-12-13 17:40:10 +01:00
Zoltan Varga 4bb24e91fd [amd64] Return from the altstack before handling native sigsegvs. This will make backtrace () actually work. 2016-12-13 17:09:54 +01:00
Zoltan Varga 4e34055e62 [jit] Pass '-nx' to gdb when printing native backtraces so it doesn't read .gdbinit, thus making it more deterministic. 2016-12-13 17:09:53 +01:00
Alexander Köplinger 4c826a3c85 Remove the debian-snapshot submodule
Jo said it's no longer used. We're using the following repos now:

https://github.com/mono/linux-packaging-mono
https://github.com/mono/linux-packaging-mono-snapshot
2016-12-13 16:44:48 +01:00
monojenkins 79283363f0 [msvc] Update csproj files (#4136) 2016-12-13 13:52:22 +01:00
Bernhard Urban 9e3bfaf6a5 Revert "Fix a warning."
This reverts commit b498facf7c.
2016-12-13 13:41:32 +01:00
Zoltan Varga b498facf7c Fix a warning. 2016-12-13 07:29:41 +01:00
Ludovic Henry 02f9d26635 [threads] Destroy thread->suspended before removing the GC root to thread (#4133) 2016-12-12 18:57:07 -05:00
Alexander Köplinger e31a8ef27c [build] Print CSC when compiling with roslyn
Reduces confusion about why the log contains lines starting with MCS
even when using roslyn.
2016-12-12 20:46:30 +01:00
Marek Safar a397af33c7 [xbuild] publicsign and delaysign cannot be used at same time 2016-12-12 19:57:25 +01:00
Marek Safar 21e9c71f7b [xbuild] Add a workaround for not yet implemented full /keyfile signing using csc 2016-12-12 18:28:42 +01:00
Bernhard Urban 3baad19c6c [unwind] reduce frame size of mono_unwind_frame ()
on arm32 it goes down from 5120 bytes to 676 bytes in terms of frame
size.
2016-12-12 18:14:58 +01:00
Marek Safar 26c17a5b0f [Microsoft.CSharp] Tweaks 76f97e3073 to not call new API from Microsoft.CSharp. Fixes #47353
This is a workaround for runtime assembly loading bug always preferring local assembly
2016-12-12 17:24:06 +01:00
Marek Safar 0eb84ed455 [xbuild] Convert pbdonly to portable debug mode 2016-12-12 16:02:48 +01:00
Marek Safar cfccb41b25 [System] Always use mcs as CodeDOM backend compiler 2016-12-12 15:48:36 +01:00
Marek Safar 56f1d45100 [build] Add System.ValueTuple to bootstrap facades 2016-12-12 13:42:16 +01:00
Alexander Köplinger d2a93aa672 Don't remove the roslyn binaries in "make dist" for now
Should help fix the package builds on Jenkins.
2016-12-12 12:51:16 +01:00
Shay Rojansky 5612117861 Add unimplemented Transaction.PromoteAndEnlistDurable (#4129)
Which was added to .NET 4.5.2.
2016-12-12 11:05:23 +01:00
Zoltan Varga 8570fb5f6e [simd] Add intrinsics support for Vector<T>.CopyTo (). 2016-12-11 01:14:44 -05:00
monojenkins 487fddd146 [msvc] Update csproj files (#4128) 2016-12-10 17:36:36 +01:00
Alexander Köplinger 3c6fc4fe73 [Facades] Add System.ValueTuple facade (#4125) 2016-12-10 03:59:47 +01:00
Zoltan Varga 2bdea63484 [arm64] Handle fp regs in mono_sigctx_to_monoctx () on linux, recent gcc versions generate code which store object references in them, so sgen now requires this. (#4127) 2016-12-09 19:12:21 -05:00
Ludovic Henry 5e845a3bc9 [threadpool] Split domain and worker management (#4117)
* [threadpool] Remove `-ms` suffix

* [threadpool] Split domain and worker management

This will allow us to use native threadpool more easily: we will simply have to implement a threadpool worker with the specific API.

On windows, we will use the Win32 Threadpool, and on OSX we will explore using GCD (Grand Central Dispatch).
2016-12-09 15:40:28 -05:00
Ludovic Henry fcf7d1f425 [threads] Inline thread_cleanup into mono_thread_detach_internal (#4119) 2016-12-09 11:09:59 -05:00
Alexander Köplinger 549504bdde Expose mono_build_root to mcs build system
In an out-of-tree build the Makefile which contains get-monolite-latest
doesn't exist in the source directory (which $(topdir)/.. would point to)
but in the build directory.

In order to invoke get-monolite-latest we need to actually call the Makefile
in the correct directory which requires exposing the build directory to the
mcs build system.
2016-12-09 16:44:21 +01:00
Bernhard Urban 72ee51eb8a [configure] fix out-of-tree-build with roslyn 2016-12-09 16:44:21 +01:00
Alexander Köplinger dc8231a9d1 [runtime] Add write barriers for FindFirstFile/FindNextFile icalls (#4114)
We were seeing crashes like [1] or [2] after https://github.com/mono/mono/pull/4042 was merged.
While debugging the issue I found out that when instead of using `out data.cFileName` for passing
the string through the the icall I use a temporary field and assign the result to `data` later on
the crash went away. It also worked if I made the `WIN32_FIND_DATA` class a struct instead.

I talked to @ludovic-henry and he was able to figure out what was going on (many thanks!):

> It seems to be a missing wbarrier
> and that would also explains why it would work with a struct, but not with a class
> so it would work with a struct, because `out data.filename` would be a `MonoString**` to the thread stack,
> and that would work because we would always scan the thread stack
> and it wouldn’t work with a class, because `out data.filename` would be a `MonoString**` to the heap
>
> and because we have a generational GC, if `data` is in the “old” heap (and because we are missing this write barrier),
> we would never scan `data`, thus freeing the `data.filename` string object, and as soon as you are trying to access it,
> well you access garbage
>
> with the write barrier, we will make sure to scan the `data` object, and not loose the reference to `data.filename`

[1] https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/5422/parsed_console/log_content.html#WARNING1
[2] https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/5419/parsed_console/log_content.html#WARNING1
[3] https://github.com/mono/mono/blob/dd88ff52e2f130ee188661a34794aa7c7b564fa8/mcs/class/referencesource/mscorlib/system/io/filesystemenumerable.cs#L280
2016-12-09 14:01:06 +01:00
Marek Safar cf3f3aa8d1 [System] Add new test 2016-12-08 17:16:38 -08:00
Alexis Christoforides 47365cd54b [MacSDK] Include 'opt' as a PATH-available binary 2016-12-08 15:15:39 -05:00
Zoltan Varga 49c26ad3d9 [runtime] Use MonoBoolean instead of gboolean in monitor icalls. Add new internal variants for the ones which are exported. (#4109) 2016-12-08 01:30:48 -05:00
Ubuntu a3543c4ac2 Fix bug 48516 2016-12-08 05:37:41 +01:00
Ludovic Henry 6f4d780594 [jenkins] Rename runtime presets to match CI tags 2016-12-07 20:30:04 -05:00
Alexander Köplinger ea519ada8c [ci] Simplify run-jenkins.sh script variables (#4111)
Get rid of WORKSPACE which is set by Jenkins, this allows one to
more easily run the run-jenkins.sh script locally e.g. on cygwin.

The only thing that needs to be passed in is CI_TAGS and label.
2016-12-07 23:54:28 +01:00
Alexander Köplinger f78a4a2a2b [ci] Run aot-test on more platforms (#4108)
* [ci] Run aot-test on more platforms

Now that https://github.com/mono/mono/pull/4096 is merged, we should be able to run it on Linux too.

* [ci] Don't run aot-test on Windows

It's broken there.
2016-12-07 23:53:51 +01:00
Ludovic Henry 01eadce098 [jenkins] Add bitcode CI tag and rename bitcode_aot_only runtime preset to bitcode 2016-12-07 16:35:54 -05:00
Ludovic Henry cb0e0662a8 [jenkins] Add aot_llvm and aot CI tag as well as aot runtime preset 2016-12-07 16:25:10 -05:00
Ludovic Henry 7aa1cac456 [jenkins] Add fullaot_llvm CI tag and rename aot_only to fullaot 2016-12-07 15:53:22 -05:00
Ludovic Henry d78854f3bf [jenkins] Fix order of CI tags 2016-12-07 15:27:22 -05:00
Ludovic Henry 3fe69ba81f [jenkins] Add hybridaot_llvm CI tag and rename aot_preferred to hybrid 2016-12-07 15:15:20 -05:00
monojenkins 01915cb174 [msvc] Update csproj files (#4115) 2016-12-07 19:28:51 +01:00
Marek Safar dd88ff52e2 [build] Add System.Security.Cryptography.Primitives to bootstrap facades 2016-12-07 07:34:47 -08:00
Marek Safar b1f867e4e5 Merge pull request #4102 from marek-safar/bootstrap
[build] Fixes win32 bootstrap in mcs mode
2016-12-07 06:20:26 -08:00
Alexander Köplinger 2b8d9bdb08 [ci] Move mcs switch for Win32 builds into the run-jenkins.sh script
So we can more easily switch it over to roslyn again in a PR.
2016-12-07 13:17:08 +01:00
Ludovic Henry 742b4841c2 [threads] Fix conflicting signal with boehm (#4096)
Boehm would use SIGPWR on linux 32/64bits for its suspend signal, but that would conflict with utils/threads suspend signal.

The fix consists in looking for an available realtime signal in utils/threads, and fallback to the default SIGXFSZ, SIGPWR and SIGXCPU
2016-12-06 20:46:43 -05:00
Rolf Bjarne Kvinge 196a882e02 [llvm] Fix intrinsic Selector.GetHandle support. (#4103)
An OBJC_IMAGE_INFO section must be emitted when we emit the native equivalent
of @selector for Selector.GetHandle, otherwise the Objective-C runtime will
not process the selectors in this image at runtime (and we may end up with
duplicate selectors in memory).

The AOT compiler already does this here: https://github.com/mono/mono/blob/2eda626316fd8f70cd98947af2f89b7ca9b0ebe5/mono/mini/aot-compiler.c#L9657-L9661
2016-12-06 18:50:31 -05:00
Alexis Christoforides 3b3b69dae1 [Mac SDK] Use MSBuild to build IronPython/IronRuby.
Xbuild currently fails with 'CSC: error CS0041: Unexpected error writing debug information -- 'Windows PDB writer is not available -- could not find Microsoft.DiaSymReader.Native.x86.dll'

Xbuild should be passing "/debug:Portable" to csc in order to work. There is a possibly broken attempt to this in 2d08353991.
2016-12-06 16:53:32 -05:00
Roger Vuistiner cd8e84c1f1 [System]: fix certificate validation on Wine/OSX
- the `is_macosx` static field should be false on Wine/OSX, as it is on Windows.
2016-12-06 22:44:09 +01:00
Alexander Köplinger 5b4b1b0737 Revert "[runtime] Use MonoBoolean as the return value of monitor icalls."
This reverts commit 06088609b0.

It was breaking the build on i386 Linux:

```
Unhandled Exception:
 System.ExecutionEngineException: System.Threading.SynchronizationLockException: Object synchronization method was called from an unsynchronized block of code.
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitExpression (Microsoft.CodeAnalysis.CSharp.BoundExpression expression, System.Boolean used) [0x00070] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatement (Microsoft.CodeAnalysis.CSharp.BoundStatement statement) [0x000ad] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatementAndCountInstructions (Microsoft.CodeAnalysis.CSharp.BoundStatement statement) [0x0000c] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitSequencePointStatement (Microsoft.CodeAnalysis.CSharp.BoundSequencePoint node) [0x0002d] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatement (Microsoft.CodeAnalysis.CSharp.BoundStatement statement) [0x00087] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitBlock (Microsoft.CodeAnalysis.CSharp.BoundBlock block) [0x0009d] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatement (Microsoft.CodeAnalysis.CSharp.BoundStatement statement) [0x0007a] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatementList (Microsoft.CodeAnalysis.CSharp.BoundStatementList list) [0x00023] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitStatement (Microsoft.CodeAnalysis.CSharp.BoundStatement statement) [0x000b4] in <8d5a2b6695c6475bb1cb5b9a9f9c8dd7>:0
...
```
2016-12-06 21:30:00 +01:00
Alexander Köplinger 705e1e80f2 [corlib] Put back Directory.GetDirectoryRoot() which was accidentally removed
The mistake happened in https://github.com/mono/mono/pull/4042.
Added a test for the method so we don't do it again.
2016-12-06 20:20:40 +01:00
Niklas Therning 9fa84f129f Fix Microsoft.Build.Engine fail when built with mcs
Fixes the Makefile to not fail if the compiler hasn't generated a pdb file for
the TestTasks dll.
2016-12-06 07:27:49 -08:00
Marek Safar 2d49411dee Revert "Merge pull request #4093 from ntherning/enable-building-bcl-with-mono-4.6-mcs"
This reverts commit d661684b9a, reversing
changes made to 556a4f4565.
2016-12-06 07:21:56 -08:00
Marek Safar 8b440e4f36 [build] Fixes win32 bootstrap in mcs mode
Uses installed mono instead on .NET to run same boostrap check as we
do on other platforms
2016-12-06 07:21:56 -08:00
Ludovic Henry c0c7503ae7 [io-layer] Remove io-layer.h include from as many headers as possible (#4088) 2016-12-06 09:50:26 -05:00
Ludovic Henry de21ecd34f [w32handle] Fix race in foreach and unref (#4089)
It could happen that we unref a handle that we are currently looping over. This could be the case if we are calling Process.GetProcessById (which loops over all handles) and mono_w32handle_unref on a MonoW32HandleProcess handle.
2016-12-06 09:49:32 -05:00
Zoltan Varga 06088609b0 [runtime] Use MonoBoolean as the return value of monitor icalls. 2016-12-06 00:47:32 -05:00
Alexander Köplinger d661684b9a Merge pull request #4093 from ntherning/enable-building-bcl-with-mono-4.6-mcs
Enable building the BCL with mcs from pre-4.8 mono installation
2016-12-06 01:39:19 +01:00
Ludovic Henry 556a4f4565 [threads] Do not switch to GC safe twice, it's already done inside mono_join_uninterrupted 2016-12-05 13:51:02 -05:00
Aleksey Kliger (λgeek) 15aca909f3 [runtime] Use coop handles for the remaining System.Reflection.Assembly icalls (#4082)
* [reflection] Use handles for System.Reflection.Assembly.GetFilesInternal

* [reflection] Use handles for System.Reflection.Assembly.InternalGetType

* [reflection] Use handles for System.Reflection.Assembly.GetManifestResourceNames

* [reflection] Use handles for System.Reflection.Assembly.LoadPermissions

* [reflection] Add mono_method_get_object_handle

  Reimplement mono_method_get_object_checked in terms of the handles one.

* [reflection] Use handles for System.Reflection.Assembly.get_EntryPoint

* [reflection] Use handles for four more icalls in System.Refleciton.Assembly

  That's the lot of them.

    * get_ReflecitonOnly
    * get_code_base
    * get_fullname

* get_global_assembly_cache

* [security] Use handles for System.Security.Policy.Evidence.IsAuthenticodePresent

* [runtime] Use handles for System.Web.Util.Icalls.GetUnmanagedResourcesPtr

* [runtime] Use MONO_HANDLE_GETVAL instead of MONO_HANDLE_RAW in a few places

* [runtime] Use handles for System.AppDomain.ExecuteAssembly
2016-12-05 10:24:10 -05:00
Niklas Therning 54565eaaf9 Enable building the BCL with mcs from pre-4.8 mono installation
This skips passing -runtimemetadataversion when building the BCL with
--with-csc=mcs.
2016-12-05 15:41:50 +01:00
Niklas Therning 786dea24fe Merge pull request #4092 from ntherning/fix-w32process-win32.c-build-failure
Fix build failure in w32process-win32.c
2016-12-05 14:22:22 +01:00
Niklas Therning 68d8a0f087 Fix build failure in w32process-win32.c
Commit 07630fe8c5 broke the build on Windows.
2016-12-05 11:50:07 +01:00
Johan Lorensson 120fb8de40 Merge pull request #3997 from lateralusX/jlorenss/win-api-family-support-safearray
Add possibility to exclude COM SafeArray implementation on some none desktop Windows API families.
2016-12-05 11:45:19 +01:00
vkargov 1e890d8428 A few pretty print fixes for the GDB plugin. (#4001) 2016-12-03 19:41:54 -05:00
Ludovic Henry 8fc79cf5e3 [runtime] Fix build 2016-12-03 18:42:04 -05:00
Ludovic Henry 07630fe8c5 [Process] Remove unused cmd and shell_path variables 2016-12-03 18:13:12 -05:00
Ludovic Henry 31f90b9db6 [Process] Concatenate envirnoment key and value in managed 2016-12-03 18:13:12 -05:00
Ludovic Henry 28d3e31a97 [Process] Rename proc_info to procInfo 2016-12-03 18:13:12 -05:00
Ludovic Henry 43ce530d56 [w32process] Rename MonoW32HandleProcess id to pid and proc_name to pname 2016-12-03 18:13:12 -05:00
Joshua Peterson 971f5ff4ed Don't allow Join to return due to an APC (#3970)
* Don't allow Join to return due to an APC

On Windows, Thread.Join does an alertable wait. If the thread calling
Join gets an APC during the call, Join will incorrectly return. Instead,
the code should handle the APC and continue waiting.

* Do an uninterrupted wait during thread join.

Mimic the behavior of mono_wait_uninterrupted, but for a single thread
that we want to join.

* Make some style changes suggested in the PR.
2016-12-03 17:10:25 -05:00
su21 53fa02470c Socket.AddSockets throw exception with meaningful name (#4086)
fix #48875
2016-12-03 16:34:33 -05:00
monojenkins 238d6fe627 [msvc] Update csproj files (#4087) 2016-12-03 22:21:43 +01:00
Ludovic Henry 55ff3852f5 [io-layer] Remove versioninfo.{c,h} (#4083) 2016-12-03 08:59:47 -05:00
Zoltan Varga 1845e73db4 [runtime] Add locking to mono_gc_compute_gc_descriptor (). (#4084) 2016-12-02 22:44:01 -05:00
Alexander Köplinger f9eae79e15 Fix Makefile issue on Windows
"Makefile:25: *** multiple target patterns.  Stop.", according to web searches
this is because of colons in the file path. install-local always runs so we
don't really need the source files as dependency -> removing.
2016-12-03 03:38:14 +01:00
Miguel de Icaza 22830cfb64 [marshal] Only copy the minimum of size/length, not the full size, fixes #46288 (#4031) 2016-12-02 21:24:25 -05:00
Miguel de Icaza a2bfd33580 [runtime] Provide fallback for Linux systems that lack CPU_COUNT in sched.h, fixes #45683 (#4032) 2016-12-02 21:22:38 -05:00
Alexander Köplinger 9da938a9e2 [build] Another "make dist" fix 2016-12-03 01:38:08 +01:00
Alexander Köplinger 3ddd016856 [ci] Add aot-test step like on Wrench (#4064)
* [ci] Add aot-test step like on Wrench

* [tests] Fix mktemp argument to work on Linux

* [ci] Only run aot-test step on OSX

It seems to crash on linux with the boehm configuration.
2016-12-03 01:18:33 +01:00
Zoltan Varga 0f75df93b3 [runtime] Set klass->inited under the loader lock. 2016-12-02 18:10:29 -05:00
Zoltan Varga c17bc54918 [runtime] Enable thread6.exe test, it should work now. (#4075) 2016-12-02 17:22:16 -05:00
Ludovic Henry 2cc94a2eef [io-layer] Remove FormatMessage (#4055) 2016-12-02 16:52:02 -05:00
Ludovic Henry 0a65f41687 [io-layer] Remove security.{c,h} (#4079) 2016-12-02 15:06:09 -05:00
Alexander Köplinger 713b7fe4ae Fix "make dist" for roslyn assemblies 2016-12-02 20:12:19 +01:00
Marek Safar 19261d8d53 [build] Fixes make dist 2016-12-02 19:58:42 +01:00
Aleksey Kliger (λgeek) d9e73b75b0 Fix clang warning about no argument function prototype. (#4080) 2016-12-02 13:50:24 -05:00
Zoltan Varga b0ad42e210 [runtime] Call mono_class_init () before accessing klass->has_cctor in mono_class_get_cctor (). 2016-12-02 13:33:52 -05:00
Marek Safar ff7a2a5114 [System.Runtime.InteropServices.RuntimeInformation] Updated to reference copied files directly 2016-12-02 18:39:22 +01:00
Johan Lorensson 29de090ea6 Fix windows build error in type-checking.c. (#4078)
Looks like commit f3bbd799f0 that added type-checking.c
to the windows builds broke it since it includes mini.h and ir-emit.h using
<> syntax instead of "". All other include of these files uses "" syntax. Fix
makes sure the includes in type-checking.c uses "" syntax.
2016-12-02 18:23:04 +01:00
monojenkins d29f0045fc [msvc] Update csproj files (#4081) 2016-12-02 18:16:26 +01:00
Marek Safar c36e0aa886 [build] Enable full mcs boostrap for mcs compiler mode 2016-12-02 18:08:41 +01:00
Marek Safar 82953443e1 [build] Fixes wrong dependency moved in 07c20be565 2016-12-02 18:07:22 +01:00
Marek Safar fb7b09c655 [corlib] Cleanup more negative sign cultures with unicode prefixes 2016-12-02 18:07:22 +01:00
Aleksey Kliger (λgeek) 8850a990f8 [runtime] Use mono_assembly_get_object_handle instead of mono_assembly_get_object_checked everywhere in the runtime. (#4061)
* [runtime] Move domain icall declarations to appdomain-icalls.h

* [coop] Use handles for System.AppDomain.GetAssemblies icall

* [coop handles] Add HANDLE_FUNCTION_RETURN_REF macro

* [runtime] Handles for AppDomain.LoadAssemblyRaw and Assembly.LoadFrom

* [reflection] Coop handles for RuntimeTypeHandle.GetAssembly

* [runtime] Change mono_try_assembly_resolve to return MonoAssembly

  instead of managed MonoReflectionAssembly.  Update call sites.

  Also implement it in terms of mono_try_assembly_resolve_handle (which
  also returns MonoAssembly*, not a managed object)

* [runtime] Use handles for System.AppDomain.LoadAssembly

* [reflection] Use mono_assembly_get_object_handle instead of mono_assembly_get_object_checked

  Convert all its callers to use handles and get rid of mono_assembly_get_object_checked
2016-12-02 11:39:39 -05:00
Marek Safar 07c20be565 [build] Add System.Security.Cryptography.Algorithms to monolite 2016-12-02 17:29:11 +01:00
Ludovic Henry 4253746d0f [io-layer] Remove status.h, types.h, timefuncs.h and macros.h (#4069)
* [io-layer] Remove status.h

* [io-layer] Remove types.h

* [io-layer] Remove timefuncs.h

* [io-layer] Remove macros.h
2016-12-02 10:33:22 -05:00
Marek Safar 2a57c92fa0 [Facades] Add System.Security.Cryptography.Algorithms to net_4_x profile 2016-12-02 16:14:11 +01:00
Marek Safar 9cbea50ca5 [mcs] Don't crash on missing forwarded mscorlib 2016-12-02 16:14:11 +01:00
Marek Safar 673f1ba3e1 Merge pull request #4063 from ntherning/fix-culture-info-problem-in-RepeatInfoTest
Ensure the System.Web.UI.WebControls.RepeatInfo_Autogen test runs under en-US
2016-12-02 12:06:53 +01:00
Marek Safar 68d56e8027 [build] Put back mcs to monolite to support boostrap with mcs only 2016-12-02 10:25:30 +01:00
Zoltan Varga e3e699f321 Revert "[build] Put back mcs to monolite to support boostrap with mcs only"
This reverts commit 430e9d64f7.

Revert this as it seems to break the build:
https://wrench.internalx.com/Wrench/ViewLane.aspx?lane_id=2457&host_id=148&revision_id=834314
2016-12-01 21:09:47 -05:00
Zoltan Varga 8d17b4f46c [runtime] Avoid rethrowing ThreadAbortException's from cctors down the stack from where the TAE was first caught. Fixes thread6.cs. (#4073) 2016-12-01 19:07:45 -05:00
Zoltan Varga 8e0443727f [runtime] Change the vtable->initialized bitfield into a byte so its easier to load it from JITted code, the previous version was not using offsets infrastructure so it might not work when cross compiling. (#4068) 2016-12-01 19:04:18 -05:00
Zoltan Varga eca5dbd482 [runtime] Implement support for fixed char arrays. Fixes #48429. (#4072) 2016-12-01 19:02:33 -05:00
Marek Safar 430e9d64f7 [build] Put back mcs to monolite to support boostrap with mcs only 2016-12-01 23:54:14 +01:00
Andi McClure 9910c4b364 Merge pull request #4053 from xmcclure/babysitter_cygwin
Fix babysitter script to work on Windows (Cygwin) builders
2016-12-01 17:01:55 -05:00
monojenkins 36d4145426 [msvc] Update csproj files (#4074) 2016-12-01 22:04:12 +01:00
Zoltan Varga f3bbd799f0 [msvc] Update project files. 2016-12-01 15:53:20 -05:00
Zoltan Varga 7fa00780ad [jit] Fix the DISABLE_REMOTING build. 2016-12-01 15:45:57 -05:00
Zoltan Varga 2d203b2a77 [sdb] Execute the 'assembly_load' test earlier to avoid races when the finalizer thread would load another assembly. 2016-12-01 15:26:30 -05:00
Zoltan Varga c1acb2cee8 [x86] Increase some instruction lengths. 2016-12-01 15:18:33 -05:00
Alexander Köplinger 21f6ffa411 [genproj] Recognize /deterministic and /runtimemetadataversion 2016-12-01 20:59:19 +01:00
Mike Voorhees b6d1320f3e Add embedding API to expose empty string instance (#4067)
* Reuse a single empty string instance

* Undo string empty change to mono_string_new_size_checked and add new embedding api for string empty instead

* Add & use mono_string_empty_checked to fix build error on Linux

* Revert "Add & use mono_string_empty_checked to fix build error on Linux"

This reverts commit 47cafae6573115333fa04776c21e5ddc49fe4b40.

* Remove MONO_RT_EXTERNAL_ONLY to fix build error on linux
2016-12-01 14:53:44 -05:00
Rodrigo Kumpera ce166860ea Merge pull request #4048 from kumpera/iface_casting_cleanup
[mini] Reorg casting code + optimize casting of magic array interfaces.
2016-12-01 11:16:10 -08:00
Andi McClure d7e2c40455 Modify Jenkins scripts to enable babysitter script on Cygwin 2016-12-01 14:08:25 -05:00
Andi McClure 4d4769ed84 Fix babysitter script to work on Windows (Cygwin) builders
The babysitter script used for CI results was previously able to run
either on Windows or standard UNIX. However, the builders run Cygwin,
which turns out to need special support. To make Cygwin work two
changes were made:

1. Paths which are exported to Mono get filtered through `cygpath`.
Paths received back from Mono are filtered in reverse. The script now
tracks two sets of path strings.

2. Under certain circumstances in Cygwin, pgkill() attempts to close a
process group and finds it does not exist. My assumption is that this
is because it has already been closed. I dealt with this by simply
catching the failure and printing a warning.
2016-12-01 14:07:48 -05:00
Ludovic Henry 4e4834f9cd [w32handle] Rename statuscode parameter to abandoned
This parameter is only used to check if a mutex has been abandonned.
2016-12-01 13:34:23 -05:00
Alexander Köplinger aff3d4198b [corlib] Use Directory.GetFiles/GetDirectories implementation from referencesource (#4042)
We already had implementations of the Windows APIs like FindFirstFile/FindNextFile
in native code but we wrapped it with some convenience functions for our implementation.

The referencesource code works directly against those APIs so I added new icall functions
that are just used for passing data to/from native code.

Note that we have the same problem in the DirectoryInfo.GetFiles() implementation.
Right now that one still uses the old Mono implementation, switching it over to
the referencesource implementation will be done in a separate commit.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42715
2016-12-01 17:48:26 +01:00
Alexander Köplinger 69c3bfa45f Merge pull request #4065 from akoeplinger/add-mcs-lane
[ci] Add job configuration for testing Mono with mcs as compiler
2016-12-01 16:53:37 +01:00
Ludovic Henry 7636cb7716 [io-layer] Remove DuplicateHandle 2016-12-01 10:52:05 -05:00
Alexander Köplinger 690452b1bd Fix typo in readme.md
Also format the options without braces like in the other examples.
2016-12-01 16:41:27 +01:00
Aleksey Kliger (λgeek) a713a14521 Merge pull request #4045 from lambdageek/bug-47867
[sre] Ensure generic_context is created before instantiating a TypeBuilder
2016-12-01 10:33:25 -05:00
Niklas Therning 0a53e22631 Ensure the System.Web.UI.WebControls.RepeatInfo_Autogen test runs under en-US 2016-12-01 15:59:45 +01:00
Niklas Therning 0e1a4d8a68 Merge pull request #4051 from Unity-Technologies/registry-bug-fixes
Fix a bug in registry API implementation where had wrong assumptions about possible registry size.
2016-12-01 15:40:40 +01:00
Tautvydas Žilys c2ba35e793 Fix code convention on changed code. 2016-12-01 16:02:12 +02:00
Alexander Köplinger 50de3b0ee4 [ci] Add job configuration for testing Mono with mcs as compiler
To ensure it doesn't break now that we're using Roslyn by default.
2016-12-01 14:49:52 +01:00
lateralusX 94ecf49a0b Enabled possibility to exclude SafeArray implementation on Windows.
SafeArray implementation is not available under all Windows API families. This commit
extracts SafeArray methods making it possible to exclude them under Windows API families
not supporting SafeArrays.
2016-12-01 12:34:58 +01:00
Alexander Köplinger 3bc2b496c5 [acceptance-tests] Use portable pdb for csc 2016-12-01 12:15:21 +01:00
Niklas Therning 256e3ee192 Merge pull request #4033 from ntherning/no-stdcall-for-icalls-on-windows-32-bit
Use __cdecl rather than __stdcall for icalls on Windows 32-bit
2016-12-01 10:42:25 +01:00
Zoltan Varga 0dd9d39a8d [jit] Enable inlining inside gshared methods. (#4059) 2016-12-01 02:10:07 -05:00
Zoltan Varga 52914289b5 Revert "Only allocate 1 empty string instance per AppDomain " (#4062) 2016-11-30 22:28:41 -05:00
Marek Safar 18507ed5c3 [build] Don't use runtime flags on basic boostrap (they are too new) 2016-11-30 23:06:00 +01:00
Mike Voorhees fd36291a48 Only allocate 1 empty string instance per AppDomain (#4047)
* Reuse a single empty string instance

* Undo string empty change to mono_string_new_size_checked and add new embedding api for string empty instead
2016-11-30 16:40:19 -05:00
Alexander Köplinger 5b386e6b28 [ci] Bump timeout in ms-test-suite
Compiling the test exe's is taking longer now with roslyn.
2016-11-30 22:10:44 +01:00
Miguel de Icaza e06e21e754 [configure] Detect endianess and use mcs for big-endian systems.
Renames the flag to be more explicit on the intended purpose.  Also,
document the new configuration flag.

The default will probe the right compiler to use.
2016-11-30 14:53:55 -05:00
Alexis Christoforides d9b58eec84 Bump bockbuild 2016-11-30 14:23:17 -05:00
monojenkins 4b4f9e3078 [msvc] Update csproj files 2016-11-30 19:57:14 +01:00
Aleksey Kliger (λgeek) 94bafb7c55 [tests] Use CSC to compile gc-descriptors test (#4052) 2016-11-30 13:54:21 -05:00
Alexander Köplinger b9e6227efb Merge pull request #4050 from akoeplinger/profile-speedup
[ci] Only build the additional profiles on one arch instead of everywhere
2016-11-30 19:47:47 +01:00
Ludovic Henry 6e4e09dfba [io-layer] Remove wait.h 2016-11-30 13:09:59 -05:00
Ludovic Henry 0b944ffb57 [io-layer] Remove INFINITE 2016-11-30 13:09:59 -05:00
Ludovic Henry 7e79a9cdb0 [io-layer] Extract WaitForSingleObjectEx, WaitForMultipleObjectsEx and SignalObjectAndWait 2016-11-30 13:09:59 -05:00
Aleksey Kliger (λgeek) 32fb6a33cb [reflection] Use mono_module_get_object_handle everywhere (#4010)
* [reflection] Refactor managed object caching

Split up all the mono_XXX_get_object_checked functions into a generic
cache check and a specific construction function that's called if
there's a cache miss.

* [reflection] Add mono_assembly_get_object_handle

* [reflection] Add mono_module_get_object_handle

* [reflection] Use mono_module_get_object_handle everywhere

instead of mono_module_get_object_checked.

Also implement mono_module_file_get_object_handle instead of mono_module_file_get_object_checked
2016-11-30 12:20:30 -05:00
Alexis Christoforides 1fe0f8fb3a Bump bockbuild 2016-11-30 11:47:09 -05:00
Alexander Köplinger e67c011d07 Bump corert submodule 2016-11-30 17:21:00 +01:00
Marek Safar 5b20721b57 [build] Add --with-mcs-compiler config option 2016-11-30 16:53:00 +01:00
Marek Safar 07566447eb [mcs] Fixes runtimemetadataversion option check 2016-11-30 16:53:00 +01:00
Tautvydas Žilys 6dd4137bc0 Fix a bug in registry API implementation where had wrong assumptions about possible registry size. 2016-11-30 16:40:21 +02:00
Marek Safar efbe11145a [build] Prepare roslyn 2.0 bootstrap dependencies 2016-11-30 15:31:41 +01:00
Marek Safar 6dbe62deeb [build] Set monolite path also for Facades 2016-11-30 15:31:41 +01:00
Alexander Köplinger dbd2a1a9cd Merge pull request #3748 from akoeplinger/fix-rng-monotouch
[corlib] Simplify RNGCryptoServiceProvider file name on MT and enable tests
2016-11-30 14:56:51 +01:00
Marek Safar 2d08353991 [xbuild] Add workaround for pre-2.0 csc and convert full to portable debug mode 2016-11-30 14:35:54 +01:00
Alexander Köplinger 962f2a673d [ci] Only build the additional profiles on one arch instead of everywhere
The additional profiles like monotouch, monodroid etc. are normal
managed code anyway and are the same no matter where they're built
so we can save a lot of CI time by not building them e.g. on slower
ARM bots.
2016-11-30 14:31:12 +01:00
Marek Safar 7f4ffa0d8a [build] Use custom nursery size and clean up csc runtime arguments 2016-11-30 09:36:18 +01:00
Alexander Köplinger 1037af0e60 [referencesource] Fix a regression from 47a6f56439
ResourceSets needs to be initialized on Mono.
2016-11-30 02:20:55 +01:00
Rodrigo Kumpera f29547d8b9 [mini] Use the array fast path with array magic interfaces. Do the expensive check in the slow path. 2016-11-29 16:34:33 -08:00
Rodrigo Kumpera 7795f85437 [mini] Cleanup type casting a bit. Unify cast with with cache setup code. 2016-11-29 14:02:42 -08:00
Zoltan Varga bfb14cf4c2 [jit] Add counters for number of JITted method discarded as duplicates and the time spent JITting them. Remove opt set from -v output, it just adds noise. 2016-11-29 16:46:33 -05:00
Marek Safar 8bd65e9d1b Merge pull request #4041 from CyberShadow/pull-20161129-100901
ilasm: Add stub parsing for .data cil attribute
2016-11-29 21:07:54 +01:00
Marek Safar 549b996ac3 Add CoreRT submodule 2016-11-29 19:20:11 +01:00
Marek Safar 47a6f56439 [bcl] Clean up some warnings 2016-11-29 19:16:02 +01:00
Aleksey Kliger 979f07c142 [sre] Do we ever try to instantiate a generic instance? Assert that we don't. 2016-11-29 11:40:20 -05:00
Aleksey Kliger 72d3e86e9e [sre] Throw a TLE if a generic inst is used before the gtd is created.
This can happen if TypeBuilders are used to construct something like
  class S<T> {
    ...
  }
  class R {
    public S<int> SI;
  }

And then CreateType() is called for R and GetField("SI") is called on
  the result before CreateType() is called on the builder for S.
2016-11-29 11:40:19 -05:00
Aleksey Kliger ab9b8967cc [sre] Make sure a generic definition TypeBuilder has its generic_container setup before we try to instantiate it.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=47867
2016-11-29 11:40:18 -05:00
Aleksey Kliger a6716e6d6e [test] Generic typebuilder field in another typebuilder should work.
Even if the generic typebuilder hasn't had CreateType() called on it
yet.

Regression tests for https://bugzilla.xamarin.com/show_bug.cgi?id=47867
2016-11-29 11:40:16 -05:00
Marek Safar 6b0763dd4a Revert "[build] Enable aot for Microsoft.CodeAnalysis.dll/Microsoft.CodeAnalysis.CSharp.dll, as the aot compiler generates smaller images now."
This reverts commit e186dcff2c.
2016-11-29 16:53:21 +01:00
Ludovic Henry e1508c23bd [configure.ac] Rename hybrid runtime preset to aot_preferred 2016-11-29 10:39:38 -05:00
Niklas Therning 7a950a0450 Merge pull request #4040 from ntherning/disable-symbolicate-tests-on-windows
Disable symbolicate tests on Windows
2016-11-29 15:40:27 +01:00
Marek Safar 5a8058f7e4 [System] Report test failure using Assert 2016-11-29 12:01:19 +01:00
Marek Safar 27537cb676 [System] Update ClientWebSocket test to use Setup 2016-11-29 11:44:37 +01:00
Vladimir Panteleev c0b9100de8 ilasm: Add stub parsing for .data cil attribute
The "cil" attribute seems to indicate that the data should be placed
in the .text section, along with the code.

Like the tls attribute, the cil attribute is only implemented insofar
as to recognize it as a valid keyword that can occur in a .data
declaration.
2016-11-29 10:28:21 +00:00
Niklas Therning 4e20db77de Disable symbolicate tests on Windows
We will ignore the failing test-with-aot-msym test for now.
2016-11-29 10:56:08 +01:00
Zoltan Varga a90de75524 [bcl] Fix a regression introduced by 91c68de23f. If a thread was added to (#4038)
blocking_threads twice, then removed once, the corresponding entry in threads_stacktraces was removed,
causing an exception in ReleaseHandle () later.
2016-11-29 03:06:55 -05:00
Zoltan Varga 57fc0b7439 [runtime] Add error handling to mono_get_dbnull_object () it can fail due to a TAE. (#4039) 2016-11-29 03:01:35 -05:00
Johan Lorensson 5d2f0cfa01 Merge pull request #4023 from lateralusX/jlorenss/test-driver-reporter
Adding support to get test results back from TestDriver.
2016-11-29 08:47:12 +01:00
Zoltan Varga e186dcff2c [build] Enable aot for Microsoft.CodeAnalysis.dll/Microsoft.CodeAnalysis.CSharp.dll, as the aot compiler generates smaller images now. 2016-11-29 00:29:18 -05:00
Zoltan Varga a40dc9384b [aot] Only emit instances when using full aot. 2016-11-29 00:22:42 -05:00
Zoltan Varga 548a4dfa19 [runtime] Fix e659982b7b, two callbacks were mixed up. 2016-11-28 21:13:39 -05:00
Alexander Kyte e659982b7b Prevent ThreadAbort from prematurely ending function calls in catch block (#1837)
* [runtime] Fix naming scheme for check if stack grows upward

It was very counter-intutitive to have a file-local preprocessor variable
with a name that sounds like it should have the same truthiness as a given global
preprocessor variable but was defined as the negation of the global variable.

* [runtime] Prevent ThreadAbort from terminating function calls in catch body

ThreadAbortExceptions are special in that if the thread has not
had it's abortion reset, when it reaches the end of a catch block it
must throw.

Consider the situation where a thread has been aborted and the
ThreadAbortException has been caught. If this catch block calls
a method that has a try/catch combination, the current implementation
will throw the ThreadAbortException at the end of the catch in that
function.

Usually you only care that Thread abortions are prompt, but this bug
could result in dramatic program behavior changes when this is combined
with lazy class initialization.

```
Example:
Console.WriteLine inside a thread abort with an uninitialized Console.
```

This fix records the stack pointer when a catch clause is entered, and
only rethrows the abortion if we're exiting a catch clause above or at the
level of the catch clause previously entered.
2016-11-28 21:01:09 -05:00
Zoltan Varga 4f738f8b32 [aot] Bump aot file version after c690636c01. 2016-11-28 20:58:45 -05:00
Zoltan Varga c690636c01 [jit] Call mono_jit_thread_attach () through a GOT slot instead of directly, so the call doesn't go through the trampoline code which wouldn't work if the thread was not attached. (#4037) 2016-11-28 20:57:52 -05:00
Zoltan Varga 950c27dc59 [llvm] Fix a regression introduced by d231b5134d. 2016-11-28 20:14:18 -05:00
Rodrigo Kumpera 9d0c9d6022 add type-checking.c to the build. 2016-11-28 16:05:20 -08:00
Rodrigo Kumpera 00d28f5b50 [runtime] CEE_MONO_CISINST is dead. Removed the type-cast half. 2016-11-28 16:01:25 -08:00
Rodrigo Kumpera e3353ad112 [mini] Remove the need for isinst wrapper for MBRO. 2016-11-28 16:01:25 -08:00
Rodrigo Kumpera 191a5e3731 [mini] Remove the need of the ininst wrapper for interfaces. 2016-11-28 16:01:25 -08:00
Rodrigo Kumpera cd3aad7aae [mini] Remove CEE_MONO_CCASTCLASS. Could not remove from opcodes.def at it weirdly breaks mono/mini/arrays.cs. 2016-11-28 16:01:25 -08:00
Rodrigo Kumpera e8688d4b01 [mini] CEE_MONO_CCASTCLASS is dead. Removed the type-cast half. 2016-11-28 16:01:24 -08:00
Rodrigo Kumpera 569cfcb08e [mini] Avoid the cast wrapper for MBRO. 2016-11-28 16:01:24 -08:00
Rodrigo Kumpera 59df58a1ec Remove dead code. 2016-11-28 16:01:24 -08:00
Rodrigo Kumpera a2a6922840 [mini] Avoid the cast wrapper for ifaces 2016-11-28 16:01:24 -08:00
Rodrigo Kumpera a2d8de9766 [mini] Simplify casting of variant generic interfaces. 2016-11-28 16:01:23 -08:00
Rodrigo Kumpera 1a645892a0 [mini] Extract type checking code into type-checking.c 2016-11-28 15:58:50 -08:00
Rodrigo Kumpera 7adf501b14 Merge pull request #4009 from kumpera/lazy-array-ifaces
[runtime] Implement lazy interface implementation for arrays.
2016-11-28 18:54:03 -05:00
Rodrigo Kumpera c3ba9e9877 [runtime] Remove the eager array interfaces code. Good ridance. 2016-11-28 15:10:30 -08:00
Rodrigo Kumpera f760dcf6e9 [runtime] Clean mono_init_internal hacks. Moved to mono_class_setup_mono_type / mono_class_create_from_typedef. 2016-11-28 15:10:30 -08:00
Rodrigo Kumpera c149ee5b4e [runtime] Fix bad packing in MonoClass. 2016-11-28 15:10:30 -08:00
Rodrigo Kumpera 1b9659a1d2 [runtime] Implement lazy interface implementation for arrays.
We have the following set of problems:

Arrays implement interfaces that are invariant but behave like covariant.
Those are IList`1, ICollection`1, IEnumerable`1

Arrays of primitive types are type equivalent based on their underlying type.
This means int[], uint[] and IntEnum[] are all interchangeable. And so is casting among their interfaces.
Meaning this is valid: `(IList<IntEnum>)(object)new int[1]`.

Finally, the way we implement IEnumerator`1 for arrays forces it to behave just like the other 3 interfaces.

Implementation:

Introduce MonoClass::is_array_special_interface, set for all the above interfaces. This allow fast checking of the interfaces in question.

mono_class_is_assignable_from now includes the array casting rules.

Change mono_class_interface_offset_with_variance to take arrays into account when looking for a candidate iface.

The JIT implements casting of those interfaces using the cast with cache wrapper.

Finally, to handle the weird primitive rules, set the cast_class of sbyte, ushort, uint and ulong to their same-size buddies.
This makes it easier for the casting code to resolve this problem.

Problems:

Casting performance is terrible, anywhere from 60% to 1000% slower on a micro-benchmark.
	Can be improved by extending our casting wrapper to handle those interfaces (probably would have to give up inlining as they would be huge)

The code in domain.c is icky, but not sure where to put it otherwise.

IEnumerator could be solved in Array.cs by not forcing it to be magic as well. Meaning the folowing

```
object array = new int[1];
var a = array as IList<int>;
var b = array as IList<uint>;

a.GetEnumerator().GetType () != b.GetEnumerator().GetType ();
```

The last line is false today but it's harmless to change it to avoid the casting penalty for such central type.
2016-11-28 15:10:15 -08:00
Marek Safar 5e75d4dcab [build] Install also from mcs/packages 2016-11-28 23:30:14 +01:00
Zoltan Varga 5b57dcd52b Revert "[CI] Disable winforms tests on all platforms."
This reverts commit 598183023b.
2016-11-28 14:04:46 -05:00
Zoltan Varga 598183023b [CI] Disable winforms tests on all platforms. 2016-11-28 13:56:37 -05:00
Zoltan Varga e8186bf4b7 Convert MonoClassExt to class properties (#4022)
* [runtime] Store the class failure data as a property.

* [runtime] Store the list of nested classes as a class property.

* [runtime] Move the property relation information from MonoClassExt into a class property.

* [runtime] Move the event relation information from MonoClassExt into a class property.

* [runtime] Move the field_def_values field from MonoClassExt into a class property.

* [runtime] Move the declsec_flags field from MonoClassExt into a class property.

* [runtime] Remove unused MonoClassExt infrastructure.

* [runtime] Add some API docs.
2016-11-28 13:42:16 -05:00
Andi McClure 28046216b2 Merge pull request #4015 from xmcclure/new-threads-collect-fix
Possibly fix hang in sgen-new-threads-collect.exe
2016-11-28 10:37:55 -05:00
Niklas Therning 61c239fb7f Use __cdecl rather than __stdcall for icalls on Windows 32-bit
Mono assumes the same calling convention for icalls as the default P/Invoke
calling convention which is __stdcall on Windows. But none of the icalls are
marked with the required __stdcall attribute on Windows so there will be a
mismatch between the caller and callee.

This is the reason why the System.Web.HttpUtilityTest.JavaScriptStringEncode()
test crashes on Windows 32-bit. It generates a call to an icall
(char.ToString() inlines to new string(char,int)) which is assumed to be
__stdcall while it's actually __cdecl. The caller will decrement ESP as if the
callee was __stdcall resulting in ESP decreasing on each iteration. After a
couple of thousand iterations in the loop in that test the stack guard page is
hit and a stack overflow occurs.
2016-11-28 15:25:01 +01:00
Marek Safar e90eb26993 Merge pull request #2774 from marek-safar/roslyn
Roslyn compiler switch
2016-11-28 14:38:54 +01:00
Vlad Brezae d231b5134d Merge pull request #3973 from mono/small-perf
[Perf] Replace some exhaustive O(n^3) or O(n^2) iterations with O(n)
2016-11-28 14:38:16 +02:00
Marek Safar 0938dfa8e8 Switch to cecil branch with better pdb handling 2016-11-28 08:56:04 +01:00
Marek Safar 4a55ffac62 [build] Bump required bootraping mono version and download it automatically 2016-11-28 08:56:04 +01:00
Marek Safar 3891a89076 [build] Roslyn switch 2016-11-28 08:56:04 +01:00
Miguel de Icaza 700a511bac [marshal] Fix API documentation comment on mono_string_to_byvalwstr 2016-11-27 21:37:54 -05:00
Zoltan Varga c24496dfc8 [runtime] Fix mono_image_load_module_checked () so it actually stores the loaded netmodule in image->modules, not the parent image itself. Fixes #47762. (#4029) 2016-11-27 21:36:48 -05:00
Zoltan Varga b06da6f5e4 [aot] Avoid a crash on class loading failures. Fixes #47152. 2016-11-26 22:45:26 -05:00
Zoltan Varga 560ac752c4 [runtime] Fix a warning. 2016-11-26 17:02:40 -05:00
Zoltan Varga 845b196340 [jit] Fix some SIMD problems on x86. 2016-11-26 16:33:31 -05:00
Alexander Köplinger 51ccfec665 Merge pull request #4028 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-26 19:16:09 +01:00
monojenkins 43cfc13be8 [msvc] Update csproj files 2016-11-26 16:45:55 +00:00
Alexander Köplinger 1562fc6fe5 [Facades] Don't build System.Drawing.Primitives.dll by default for monotouch_watch profile
It needs special logic like the other monotouch profiles in the products
since we don't have a System.Drawing assembly/types for these profiles in Mono
and don't embed the types in the facade anymore after 1074fe91bd.
2016-11-25 20:49:45 +01:00
Marek Safar d717933f7f Merge pull request #4026 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-25 18:24:35 +01:00
Marek Safar 1074fe91bd [Facades] Remove watch special System.Drawing.Primitives, all types are now available in watchos.dll 2016-11-25 18:01:26 +01:00
monojenkins 5e40f8980c [msvc] Update csproj files 2016-11-25 16:51:25 +00:00
Alexander Köplinger a3248942df Merge pull request #4024 from akoeplinger/mkbundle-messages
[mkbundle] Print error message when assemblies couldn't be loaded
2016-11-25 17:07:13 +01:00
lateralusX 0e0c1edaf6 Adding support for get test results in TestDriver.
Added support to pass in an instance of a TestDriverReporter class. If this
an instance of this class is passed in it will get the number of executed, skipped
and failed tests. This could be very useful for external runners that would like
to present the result of TestDriver executed tests.
2016-11-25 13:17:38 +01:00
Alexander Köplinger cea5f28d2c [mkbundle] Print error message when assemblies couldn't be loaded
There were two places in mkbundle where it'd simply exit without printing anything,
leading to confusion such as in https://bugzilla.xamarin.com/show_bug.cgi?id=46479.
2016-11-25 12:40:49 +01:00
Alexander Köplinger fcf4e1b7bf Merge pull request #4020 from akoeplinger/mobile_static-rename
Rename the mobile_static profile to aot_only
2016-11-25 12:03:35 +01:00
Alexander Köplinger 450f5dec0f [corlib] Simplify RNGCryptoServiceProvider file name on MT and enable tests
Also unify xammac and monotouch .sources files.
We're now using the CommonCrypto-based RNGCryptoServiceProvider on xammac too.
2016-11-25 03:53:16 +01:00
Alexander Köplinger 7669c811ff [corlib] Move ComAwareEventInfo stub into System.Core
It was mistakenly added to corlib, it is in System.Core.dll on .NET
2016-11-25 03:38:45 +01:00
Zoltan Varga 73e7f7e156 [jit] Fix more simd+aot issues. Avoid treating the Vector<T> GTD or Vector<T_REF> or Vector<T_GSHAREDVT> as simd types. (#4021) 2016-11-24 17:23:59 -05:00
Bernhard Urban 1fabbf5c9d Merge pull request #4019 from vargaz/get-gclass-locking
[runtime] Reduce the size of the critical section in mono_generic_cla…
2016-11-24 21:57:00 +01:00
Bernhard Urban ca05bb3da7 Merge pull request #4017 from vargaz/get-array-class-locking
[runtime] Decrease the size of the critical section in mono_bounded_a…
2016-11-24 21:54:36 +01:00
Bernhard Urban 2246dd6843 Merge pull request #4018 from vargaz/get-fnptr-locking
[runtime] Reduce the size of the critical section in mono_fnptr_class…
2016-11-24 21:54:01 +01:00
Zoltan Varga e5a8996da2 [runtime] Reduce the size of the critical section in mono_fnptr_class_get (). 2016-11-24 13:09:50 -05:00
Alexander Köplinger 9f5b8c4cf2 Rename the mobile_static profile to aot_only
We decided it's a better name since we're using the profile to
test FullAOT scenarios on desktop (as opposed to the mobile profiles).

While doing the rename I saw that a lot of the #ifdefs were using
MOBILE_STATIC even though the code should actually be included/excluded
in all FullAOT scenarios, e.g. System.Reflection.Emit. I replaced those
cases with FULL_AOT_RUNTIME instead.

For cases where code is specific to this profile, I added a new
AOT_ONLY_DESKTOP define.
2016-11-24 17:40:54 +01:00
Marek Safar 4819f0aad2 [Facades] Add netstandard 2016-11-24 17:14:54 +01:00
Marius Ungureanu a2d76503b1 [Perf] Free process in-place in loop on modules iterations. 2016-11-24 17:17:12 +02:00
Marek Safar 39a04ffccc Bump cecil 2016-11-24 12:14:07 +01:00
Marek Safar 1d6abe9eca [mcs] Count arity correctly for deeply nested types 2016-11-24 11:58:46 +01:00
Zoltan Varga e8ad984ea3 [runtime] Move more callbacks to the RuntimeCallbacks structure. (#4016) 2016-11-23 19:23:10 -05:00
Zoltan Varga 029fe6cfec [runtime] Decrease the size of the critical section in mono_bounded_array_class_get (). 2016-11-23 19:20:00 -05:00
Zoltan Varga 49c62bd1e0 [runtime] Reduce the size of the critical section in mono_generic_class_get_class (). 2016-11-23 17:29:39 -05:00
Andi McClure 24b11d224b Use DateTime.UtcNow not DateTime.Now in test 2016-11-23 16:22:11 -05:00
Zoltan Varga 8c9bc63492 [runtime] Disable the Wformat-zero-length warning. 2016-11-23 15:52:37 -05:00
Andi McClure 27ff5ac5df Possibly fix hang in sgen-new-threads-collect.exe
This test is occasionally taking over 15 minutes to complete. This
could be a hang in the runtime, but the test has a scheduling fairness
issue which could also have the same result (if the GC thread wakes up
much more often than the join thread). Patch slows down the GC rate to
give the join thread a chance to work, and extends the test to a fixed
30 second runtime.
2016-11-23 15:33:27 -05:00
Zoltan Varga 49ba5c7abb [simd] Fix a few AOT problems. 2016-11-23 14:48:29 -05:00
Zoltan Varga d3ad150860 [bcl] Implement Thread.CurrentThread using an icall which calls mono_… (#4011)
* [bcl] Implement Thread.CurrentThread using an icall which calls mono_thread_current () to avoid creating duplicate Thread objects.

* [bcl] Remove unused Thread:CurrentInternalThread_internal () icall.

* [bcl] Optimize Thread:CurrentThread a bit.
2016-11-23 14:43:47 -05:00
Niklas Therning 63caa1998e Merge pull request #4013 from ntherning/fix-assert-in-poll_event_wait-on-WSAENOTSOCK-on-windows-2
Fix assert in poll_event_wait() on WSAENOTSOCK on Windows #2
2016-11-23 18:58:29 +01:00
Marek Safar 9858a95dd1 [System] Don't send response on empty stream write. Fixes #47549 2016-11-23 17:40:49 +01:00
Martin Baulig c8f2e68962 Merge pull request #3962 from mkorkalo/fix_MonoBtlsContext_memory_leak
fix a massive memory leak in MonoBtlsContext
2016-11-23 16:50:09 +01:00
Aleksey Kliger (λgeek) 1020eb345f Merge pull request #3992 from lambdageek/dev-handles-srassembly
[coop] Use handles in System.Reflection.Assembly.{GetReferencedAssemblies,InternalGetAssemblyName}
2016-11-23 09:47:37 -05:00
Niklas Therning abc6614608 Fix assert in poll_event_wait() on WSAENOTSOCK on Windows #2
PR #3998 fixes an error handling issue in poll_event_wait(). This new change
fixes a minor code style problem in that PR, the condition in a ternary wasn't
enclosed in parentheses.
2016-11-23 14:57:45 +01:00
Zoltan Varga ccf49c73f4 [runtime] Filter out duplicate interfaces in mono_class_get_implemented_interfaces (). (#4007) 2016-11-23 08:20:56 -05:00
Zoltan Varga 63db2242eb [runtime] Allocate the temporary vtable array using g_malloc in mono_class_setup_vtable (), alloca can overflow for large vtable sizes. Hopefully fixes #45140. (#4006) 2016-11-22 22:24:38 -05:00
Ludovic Henry 9fb7859dd1 [threadpool] Replace stop by abort for worker thread 2016-11-22 19:05:27 -05:00
Kenneth Skovhede 1e6c680fa2 [Socket] Fix DuplicateAndClose (#3995)
* Fixed issue 47425

This fix simply ensures that the `m_Handle` value is not processed by the GC after a call to `DuplicateAndClose` as that causes the duplicated socket to close.

A potential issue is that this will leak sockets if the sockets are never re-created.

* Implemented ref-counting as suggested by @ludovic-henry
2016-11-22 19:04:57 -05:00
Alexis Christoforides c2e2d0dbfd Bockbuild 2016-11-22 19:01:02 -05:00
Aleksey Kliger 975f6740ea Bump corlib version. 2016-11-22 18:38:50 -05:00
Aleksey Kliger 385d38e60f [reflection] Implement GetReferencedAssemblies in managed
Call out to native to get an array of Mono.MonoAssemblyName* and use
AssemblyName.FillName to create the managed structs.
2016-11-22 18:38:49 -05:00
Alexis Christoforides 7579ea7c42 Bump bockbuild properly 2016-11-22 18:28:52 -05:00
Alexis Christoforides 275f5da19d Bump bockbuild 2016-11-22 17:39:31 -05:00
Zoltan Varga b277bf84af [runtime] Avoid passing a newline to mono_trace (), it adds one automatically. 2016-11-22 15:42:17 -05:00
Zoltan Varga c943fafb41 [jit] Make an assert more informative. Fixes #47152. 2016-11-22 15:12:47 -05:00
Aleksey Kliger 0e7f2016d3 [reflection] Change Assembly.InternalGetAssemblyName to return native MonoAssemblyName
Use managed AssemblyName.FillName to make a
System.Reflection.AssemblyName from a Mono.MonoAssemblyName

Delete native fill_reflection_assembly_name implementation. It's dead code.
2016-11-22 14:40:53 -05:00
Aleksey Kliger c796254173 [metadata] mono_assembly_fill_assembly_name_full
When copyBlobs is true, duplicates the
name, culture and public_key fields of MonoAssemblyName.

If copyBlobs is false, point those fields into the MonoImage.

Change mono_assembly_fill_assembly_name to call the full version with
copyBlobs == FALSE.
2016-11-22 14:40:53 -05:00
Aleksey Kliger 3a7a0a6a2c [coop] Use handles for S.R.Assembly.{GetReferencedAssemblies,InternalGetAssemblyName} 2016-11-22 14:40:53 -05:00
Aleksey Kliger 2d88875c2b [runtime] Add mono_string_handle_to_utf8 2016-11-22 14:40:52 -05:00
Aleksey Kliger f5a91508fe [runtime] mark mono_get_exception_{file_not_found2,bad_image_format2} external only.
Runtime should use
- mono_error_set_assembly_load  for mono_get_exception_file_not_found2
- mono_error_set_bad_image_name for mono_get_exception_bad_image_format2
2016-11-22 14:40:52 -05:00
Alexis Christoforides fee5ece805 Merge branch 'alexischr/nursery-canaries-managed-alloc' 2016-11-22 14:12:53 -05:00
Niklas Therning 22faa8733f Merge pull request #4003 from ntherning/ignore-disconnected-interfaces-in-HttpListenerRequestTest.HttpRequestIsLocal
Ignore disconnected interfaces in HttpListenerRequestTest.HttpRequestIsLocal
2016-11-22 20:03:22 +01:00
Alexander Köplinger 6adffa4edd Merge pull request #4005 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-22 19:26:39 +01:00
Marek Safar 44b95d3d02 [System.Runtime.Remoting] Disable test accidentally re-enabled by nunitlite switch 2016-11-22 18:13:14 +01:00
Zoltan Varga 230e3be56d [runtime] Disable some tests when running with llvm since they take too much time. Reduce the run time of the namedmutex-destroy-race test. 2016-11-22 11:59:59 -05:00
monojenkins d7b958e39d [msvc] Update csproj files 2016-11-22 16:39:46 +00:00
Zoltan Varga edc1e82682 [runtime] Mark the ThreadPool.PerformWaitCallback () method as save_lmf, so ThreadAbortExceptions thrown inside tp worker threads are always caught, otherwise if the TAE arrives while the threads is in native code while executing the callback, the EH will code will abort the thread so the worker thread cleanup code is not executed, causing problems later. (#4002) 2016-11-22 11:24:51 -05:00
Marek Safar 2d189dc93c [mcs] Null coalescing over typed null constants. 2016-11-22 17:02:38 +01:00
Ludovic Henry d8693e0c73 [profiles] Fix MOBILE assemblies and tests compilation + Rename MOBILE to AOT_HYBRID
This only fixes the compilation of the assemblies and the tests. This doesn't fix the failing tests or the crashes.
2016-11-22 10:32:15 -05:00
Ludovic Henry f1decc325f [ci] Add script to run MOBILE profile tests 2016-11-22 10:32:15 -05:00
Ludovic Henry 66d926f926 [utils] Add MonoRefCount to factor ref-counting mechanisms 2016-11-22 10:23:57 -05:00
Marek Safar d0b9c5ebbb [corlib] Update list of known lcids and update CLRD data. Fixes #46456 2016-11-22 14:35:59 +01:00
Niklas Therning 39c699b54a Ignore disconnected interfaces in HttpListenerRequestTest.HttpRequestIsLocal
This test creates an HttpListener for every IP address of all network
interfaces. On Windows disconnected network interfaces have unroutable IP
addresses (169.254.XXX.XXX) and this test fails when it tries to listen to
such an IP address. This patch adds a check to the test to ignore network
interfaces which don't have OperationalStatus == Up.
2016-11-22 14:27:59 +01:00
Niklas Therning 3592a79dc8 Merge pull request #3998 from ntherning/fix-assert-in-poll_event_wait-on-WSAENOTSOCK-on-windows
Fix assert in poll_event_wait() on WSAENOTSOCK on Windows
2016-11-22 11:36:04 +01:00
Zoltan Varga 1ca0e9ae50 [runtime] Add a test for appdomain unload + blocking tp thread. (#4000) 2016-11-21 20:51:05 -05:00
Alexis Christoforides 264e6c4b7c [MacSDK] Fix typo 2016-11-21 17:40:58 -05:00
Zoltan Varga 8979f2786c [runtime] Add back locking around mono_class_layout_fields () to work around https://bugzilla.xamarin.com/show_bug.cgi?id=47156. 2016-11-21 17:28:34 -05:00
Zoltan Varga e83953d02c Threadpool appdomain unload cleanup (#3996)
* [runtime] Move the threadpool related data from MonoDomain to ThreadPoolDomain.

* [runtime] Simplify the waiting for tp threads in the domain unload code. Use a condvar to wait for the active+outstanding number of jobs to reach 0.
2016-11-21 16:59:02 -05:00
Ludovic Henry ead96e0c2c [tests] Rework how we do disabled tests 2016-11-21 09:45:42 -05:00
Aleksey Kliger (λgeek) a4240142a9 Merge pull request #3988 from lambdageek/dev-handles-srmodule
[coop] Use handles in System.Reflection.Module and System.Reflection.Assembly
2016-11-21 09:43:07 -05:00
Niklas Therning 266345b394 Fix assert in poll_event_wait() on WSAENOTSOCK on Windows
On Windows poll_event_wait() in threadpool-ms-io-poll.c checks
WSAGetLastError() when mono_poll() fails. However, mono_poll() sets errno
after converting the WSAXXX error code (e.g. WSAEFAULT->EFAULT). Occasionally
(maybe 1 in 100) the System test suite fails due to mono_poll() returning an
error and poll_event_wait() not handling the error code correctly on Windows.

This patch changes poll_event_wait() to use the same code path which checks
errno on all platforms including Windows. It also fixes a few other places
which used to check WSAGetLastError() rather than errno after a call to
mono_poll(). Also, the Socket.Poll_internal() and Socket.Select_internal()
icalls had to be patched to convert back the errno value to a corresponding
WSAXXX error code by adding WSABASEERR on Windows.
2016-11-21 15:00:41 +01:00
Marek Safar a7de9367ac Revert "[runtime] Default mobile_static AOT type to FullAOT" 2016-11-21 14:40:48 +01:00
Marek Safar cfeadc51e8 Merge pull request #3406 from alexanderkyte/mobile_static_default
[runtime] Default mobile_static AOT type to FullAOT
2016-11-21 09:54:08 +01:00
Zoltan Varga 61e482b928 [runtime] Add even more logging code for the class.c assertion. 2016-11-20 18:01:46 -05:00
Zoltan Varga fc082de6fd Fix the build. 2016-11-20 11:01:47 -05:00
Zoltan Varga 98aa3fd560 Implement SIMD support for the Vector2/3/4 classes in System.Numerics. (#3765)
* [simd] Rename SimdIntrinsc->SimdIntrinsic.

* [ji] Add beginnings of support for the SIMD types in the System.Numerics assembly.

Add intrinsics for the methods marked [JitIntrinsic] in the System.Numerics.Vector2 class. Generalize some code in simd-intrinsic.c
so it works both with System.Numerics and Mono.Simd types.

* [jit] Add support for System.Numerics.Vector4.

* [jit] Add support for System.Numerics.Vector3.

* [jit] Add tests for the JIT intrinsics in System.Numerics.Vectors.

* [jit] Implement System.Numerics.Vector.IsHardwareAccelerated intrinsics.

* [jit] Fix the implementation of System.Numerics.Vector.IsHardwareAccelerated, it should return true.

* [jit] Implement some support for the SIMD intrinsics in System.Numerics.Vector<T>.

* [jit] Disable the usage of the Vector SIMD intrinsics when using r4fp until support for it is implemented.

* [jit] Fix llvm support for the Vector<T> intrinsics.

* [jit] Disable the Vector<T> tests since they don't compile yet.

* [jit] Add an optimization for the typeof(T)==typeof(<concrete type>) construct common in some generics code.

* [simd] Only return true from IsHardwareAccelerated () if simd_supported_versions is non-zero.

* [simd] Add support for add/sub/mul/div operations on Vector<T>.
2016-11-20 10:57:07 -05:00
Marek Safar 82dccb8444 [System] WebClient async request on file streams. Fixes #46538 2016-11-20 11:35:51 +01:00
Zoltan Varga 0ff2675b06 [runtime] Add more debug code to help debug a class.c assert. 2016-11-19 15:23:33 -05:00
Marek Safar 7f765ed410 [corlib] Don't crash when calling Evidence on AssemblyBuilder. Fixes #46739 2016-11-18 23:44:21 +01:00
Jon Purdy 658866d22a [sgen] Fix sgen_qsort.
sgen_qsort sometimes had pathological behavior due to a poor choice of
pivot. This implementation uses the median-of-three strategy, and limits
stack depth by avoiding recursive calls when possible.
2016-11-18 13:52:27 -08:00
Ludovic Henry 25842ac4c6 Revert "[process] Allocate a handle even for non-child processes"
This reverts commit d6928839015effec6358d7bc9c7b1b547645140a.
2016-11-18 16:41:22 -05:00
Zoltan Varga 195b8f074c Revert "[runtime] Change the thread wait code to use cond variables instead o… (#3946)"
This reverts commit 4a1161e2d6.

Revert this, keep the event based code for now.
2016-11-18 15:42:02 -05:00
Zoltan Varga 17c0f93969 Revert "[runtime] Fix the waiting for background threads which got broken by 4a1161e2d6. (#3983)"
This reverts commit dbc63ae672.

Revert this, keep the event based code for now.
2016-11-18 15:42:02 -05:00
Marek Safar 4f2a9766b1 [System] Add range check for empty URI prefix when it also contains unicode character. Fixes #47205 2016-11-18 17:59:32 +01:00
Aleksey Kliger 5f44eb408f [reflection] Use handles for System.Reflection.Assembly.GetTypes
Also change mono_get_exception_reflection_type_load_checked() to use handles.
2016-11-18 10:21:26 -05:00
Aleksey Kliger d66a1722ba [reflection] Use coop handles for 6 icalls in System.Reflection.Module
- Close
- GetGlobalType
- GetHINSTANCE
- GetMDStreamVersion
- GetPEKind
- InternalGetTypes
2016-11-18 10:08:36 -05:00
Aleksey Kliger 9062c51fa5 [coop] mono_type_get_object_handle 2016-11-18 10:08:36 -05:00
Aleksey Kliger 5ea22edbc4 [coop] Add more handle utility functions
- MONO_HANDLE_ARRAY_GETREF
- HANDLE_FUNCTION_RETURN_OBJ
- mono_array_handle_memcpy_refs
2016-11-18 10:08:36 -05:00
Aleksey Kliger e2c41067c8 [coop] Add mono_error_set_exception_handle 2016-11-18 10:08:36 -05:00
Aleksey Kliger (λgeek) 095e791273 Merge pull request #3932 from lambdageek/dev-handles-outargs
[coop handles] Support out args; convert some icalls.
2016-11-18 09:53:59 -05:00
Niklas Therning 9add1a7971 Merge pull request #3985 from ntherning/fix-Mono.Posix-on-windows
Fix Mono.Posix tests on Windows
2016-11-18 14:30:22 +01:00
Henric Müller e264edcf35 Merge pull request #3948 from henricm/fix-pinvoke-utf8-windows
Fix crash on Windows in PInvoke UTF8 tests
2016-11-18 07:11:17 +01:00
Ludovic Henry de1865dad5 [configure.ac] Factor common code for runtime preset 2016-11-17 16:52:53 -05:00
Ludovic Henry ba33a498f1 [configure] Add hybrid runtime preset
It is very close to the Full AOT profile (mobile static), but as the JIT is available, we still allow features like System.Reflection.Emit.
2016-11-17 16:52:53 -05:00
Niklas Therning bddf0f6fc6 Merge pull request #3987 from ntherning/fix-support-stdio-compile-error-on-android
Fixes compile error in support/stdio.c on XA
2016-11-17 22:20:58 +01:00
Niklas Therning 77cec01d04 Fixes compile error in support/stdio.c on XA 2016-11-17 22:14:24 +01:00
Zoltan Varga 586ad14ed1 Fixed arrays pinvoke (#3972)
* [amd64] Use a GArray to collect field information in add_valuetype ().

* [amd64] Fix the marshalling of fixed buffers by treating them as an array of elements.
2016-11-17 14:38:27 -05:00
Zoltan Varga 218e0a8081 [sdb] Error out when trying to obtain objects from unloaded domains, we have to check domain->state as well since the object references become invalid before we received the domain unloaded profiler event. Fixes #44381. 2016-11-17 14:07:11 -05:00
Vlad Brezae 22577feecf Merge pull request #3968 from BrzVlad/fix-monitor-exception
[runtime] Fix monitor exception throwing
2016-11-17 20:40:14 +02:00
Ankit Jain c265b8f9b2 Merge pull request #3979 from radical/fix-xbuild-tgt
[xbuild] Handle a repeat build of a target, when building through ..
2016-11-17 13:22:49 -05:00
Zoltan Varga 0fabf83895 [runtime] Add some printfs to help debug the g_assert (klass->instance_size == instance_size); assert failure. 2016-11-17 13:06:52 -05:00
Marek Safar 2184c18487 [mcs] Fixes user operator extraction from shared list. Fixes #46806 2016-11-17 18:47:46 +01:00
Aleksey Kliger 05c7353dde [coop] Fix mono_stack_mark_pop
We need to restore the old size into the old top chunk, not the current
top chunk.
2016-11-17 11:13:52 -05:00
Aleksey Kliger 4928a3f573 [runtime] Use handles for System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray 2016-11-17 11:13:51 -05:00
Aleksey Kliger efa3dd7f34 [runtime] Use coop handles for System.Enum.GetEnumValuesAndNames 2016-11-17 11:13:49 -05:00
Aleksey Kliger a97f263bca [coop] Marshal out args for icalls using handles. 2016-11-17 11:13:48 -05:00
Aleksey Kliger b30ce960db [coop] Use coop handles for Mono.Runtime.GetNativeStackTrace
Implement mono_exception_get_native_backtrace in terms of mono_exception_handle_get_native_backtrace.
2016-11-17 11:13:47 -05:00
Aleksey Kliger 8a7b68f703 [coop] Functions to convert coop handles to gchandles and back 2016-11-17 10:59:09 -05:00
Alexander Köplinger b17e4c71ec Merge pull request #3965 from akoeplinger/ppc-disable-tests
[ppc64] Disable a few runtime/bcl tests that currently fail
2016-11-17 16:58:00 +01:00
Zoltan Varga dbc63ae672 [runtime] Fix the waiting for background threads which got broken by 4a1161e2d6. (#3983) 2016-11-17 09:49:21 -05:00
João Matos e273739f3d Merge pull request #3953 from rolfbjarne/offsets-tool-autoreclone
[offsets-tool] Make sure to re-clone when the hash for the cpp binaries changes.
2016-11-17 13:29:27 +00:00
Niklas Therning 3df6f5c3f3 Fix Mono.Posix tests on Windows
Cleaned up Mono_Posix_FromSeekFlags() in support/map.c. It didn't properly
handle the case when L_INCR, L_SET, L_XTND aren't available, like on Windows.

Added Mono_Posix_Stdlib_GetLastError() to support/errno.c and changed
Stdlib.GetlastError() use it. Without this Stdlib.GetlastError() wouldn't take
errno in the C runtime used by libMonoPosixHelper.dll into account.

On Windows the Syscall class failed to initialize due to missing functions,
e.g. Mono_Posix_Syscall_get_at_fdcwd(), in libMonoPosixHelper.dll. Those
readonly static fields which were initialized at class initialization have now
been converted to static readonly properties so that the Syscall class can be
initialized despite those functions not being defined.

Cleaned up temp file handling in StdioFileStreamTest to avoid failures due to
sharing violations on Windows.

Fixed a bug in the StdioFileStreamTest.Write() test method when reading back
the batch of bytes written in the second part of the test.

Enabled the Mono.Posix test suite to run on PR builds. This test suite should
from now on be green.
2016-11-17 14:10:49 +01:00
Alexander Köplinger 1bea992099 [ppc64] Disable a few runtime/bcl tests that currently fail
Until someone can investigate those we want to have a clean CI.
2016-11-17 12:59:13 +01:00
Niklas Therning b34a3d6b78 Merge pull request #3966 from ntherning/prevent-multiple-c-runtimes-on-windows
Prevent Mono.Posix from using multiple C runtimes on Windows
2016-11-17 12:49:47 +01:00
Zoltan Varga eb1ae9f8eb [jit] Make mono_print_method_from_ip () work when invoked from threads which are not attached to the runtime. 2016-11-17 00:09:12 -05:00
Alexander Köplinger f0bd6288c3 [corlib] Remove public ctor from IncrementalHash
It doesn't have a public constructor in netstandard/corefx.
2016-11-17 01:55:54 +01:00
Ankit Jain 9572e2a3e3 [xbuild] Handle a repeat build of a target, when building through ..
.. `Project.Build(..)`. For example, in:

```
	<MSBuild Projects="bar.proj" Targets="foo;foo" />
```

The second invocation of `foo`, in the *same* `Project.Build(..)` call,
would get skipped, but BuildTarget assumed that no previous `outputs`
entry existed in the `targetOutputs` dictionary.

System.Exception: MSBuild operation failed ---> System.ArgumentException: Item has already been added. Key in dictionary: 'foo'  Key being added: 'foo'
  at System.Collections.Hashtable.Insert (System.Object key, System.Object nvalue, System.Boolean add) [0x00200] in <94fd79a3b7144c54b4cb162b50fc7761>:0
  at System.Collections.Hashtable.Add (System.Object key, System.Object value) [0x00000] in <94fd79a3b7144c54b4cb162b50fc7761>:0
  at Microsoft.Build.BuildEngine.Project.BuildTarget (System.String target_name, System.Collections.IDictionary targetOutputs) [0x0007e] in <b1524340ac7e4c06b22fac1b2db62c08>:0
  at Microsoft.Build.BuildEngine.Project.BuildInternal (System.String[] targetNames, System.Collections.IDictionary targetOutputs, Microsoft.Build.BuildEngine.BuildSettings buildFlags) [0x00134] in <b1524340ac7e4c06b22fac1b2db62c08>:0
  at Microsoft.Build.BuildEngine.Project.Build (System.String[] targetNames, System.Collections.IDictionary targetOutputs, Microsoft.Build.BuildEngine.BuildSettings buildFlags) [0x0004b] in <b1524340ac7e4c06b22fac1b2db62c08>:0

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=44549
2016-11-16 17:59:12 -05:00
Aleksey Kliger a4dd10aab7 [coop] Use coop handles for Mono.Runtime.GetDisplayName 2016-11-16 16:51:23 -05:00
Aleksey Kliger c6508ecaff [coop] Enter/exit macros for handle-allocating functions
Just setup/clear handle frames
2016-11-16 16:51:22 -05:00
Aleksey Kliger bf6af7c667 [coop] Handle accessor macros
- MONO_HANDLE_IS_NULL
- MONO_HANDLE_GET
- MONO_HANDLE_ARRAY_GETVAL
- mono_array_handle_length ()
2016-11-16 16:51:21 -05:00
Jo Shields fe6e1fdb81 [btls] Download & extract BTLS certs, on Linux builds.
Actually use the correct pathname.  Martin.
2016-11-16 22:01:43 +01:00
Martin Baulig 4adc1028a5 Merge pull request #3956 from directhex/install-btls-certs-in-jenkins
[btls] Download & extract BTLS certs, on Linux builds.
2016-11-16 21:53:20 +01:00
Martin Baulig 75ba28a0bb Merge pull request #3967 from atsushieno/fix-linux-btls
Fix btls build for Linux.
2016-11-16 21:51:27 +01:00
Martin Baulig f6a57ee08a Merge pull request #3950 from mono/work-btls-sni-2
[BTLS]: Add MonoBtlsSsl.GetServerName() and set MonoTlsConnectionInfo.PeerDomainName
(cherry picked from commit e6aa904d9d)
2016-11-16 21:50:36 +01:00
Marius Ungureanu 0e5af42daf [Perf] Replace some exhaustive O(n^3) or O(n^2) iterations with O(n)
Usage of g_slist_count and g_slist_nth are actually O(n) operations by themselves. Nesting them can prove to be CPU intensive.
2016-11-16 20:35:56 +02:00
Rodrigo Kumpera 94b8270e9b Merge pull request #3678 from mono/seq-read
[IO] Implement FileOptions.SequentialScan for Mac/BSD
2016-11-16 10:15:41 -08:00
Ludovic Henry 693bffded3 [mcs/build] Use make functions instead of calling a shell 2016-11-16 11:35:37 -05:00
Ludovic Henry 7ac84e8431 [mcs/build] Factor Q_AOT for future use 2016-11-16 11:35:37 -05:00
Alexander Köplinger d3a72be7e8 [acceptance-tests] Add dependency on nunitlite.dll
nunitlite.dll is not built anymore with a normal Mono build
so we need to depend on it explicitly.
2016-11-16 15:43:38 +01:00
Marek Safar f4ecb2dd06 [acceptance-tests] Specify nunitlite path 2016-11-16 15:22:44 +01:00
Bernhard Urban b26ed1d5d1 Merge pull request #3971 from directhex/longer-longer-longer-longer-longer-lasting-tailcalls
Increase tailcall instruction length on ppc64
2016-11-16 12:38:04 +01:00
Niklas Therning ed892ccf27 Prevent Mono.Posix from using multiple C runtimes on Windows
Since libMonoPosixHelper.dll is linked against ucrtbase.dll the C runtime
wrapper functions in it will call into ucrtbase.dll. Some pinvokes in
Mono.Unix.Native.Stdlib, however, bind directly to C runtime functions in
msvcrt. This is problematic if a resource (heap memory, file pointer, etc) is
allocated using one C runtime and then operated upon using funcitons form the
other C runtime. E.g., Stdlib.malloc() calls into a wrapper in
libMonoPosixHelper so it will use the ucrtbase heap while Stdlib.free() calls
directly into msvcrt's free() which will abort the process since it's called
with a pointer in an unknown heap.

This commit adds libMonoPosixHelper wrappers for all memory and file related
functions in Stdlib to ensure that all such functions use the same C runtime.

Some of the Mono.Posix tests still fail but at least the test suite doesn't
crash after this change. The test failures will be addressed in a future PR.
2016-11-16 09:14:25 +01:00
Jo Shields b5c345c907 Increase tailcall instruction length on ppc64
wrong maximal instruction length of instruction tailcall (expected 120, got 124)
* Assertion: should not be reached at mini-ppc.c:4694
2016-11-16 01:23:33 +00:00
Zoltan Varga 3f6c5c1c93 [runtime] Disable some failing tests until they are fixed. 2016-11-15 16:21:14 -05:00
Zoltan Varga 4a1161e2d6 [runtime] Change the thread wait code to use cond variables instead o… (#3946)
* [runtime] Change the thread wait code to use cond variables instead of events.

Instead of waiting for the thread handles to be signalled, wait for a cond variable signalled which is signalled by the code which calls pthread_join ().

* [runtime] Synchronize access to njoined_threads. Only use the background_change_event on windows.

* Fix a warning.
2016-11-15 15:56:45 -05:00
Alexis Christoforides 7d2a2141e0 Bump bockbuild for helpful CI cleaning fix 2016-11-15 14:03:01 -05:00
Zoltan Varga af553b57ed [jit] Optimize out the early pinvoke address loading done by emit_native_wrapper () when coop+direct pinvokes is enabled, since its not needed, and it generates MONO_PATCH_INFO_ICALL_ADDR relocations which cause pinvoke lookups at runtime on platforms where its not supported like watchos. Fixes #45369. (#3960) 2016-11-15 12:51:54 -05:00
Vlad Brezae ab5d9db4d1 [runtime] Fix monitor exception throwing
mono_monitor_ensure_owned used to throw exception directly and not return. After switching the runtime to use pending exceptions, monitor code would continue running assuming we owned to monitor.

Fixes 46994
2016-11-15 18:05:46 +02:00
Atsushi Eno fe7a97f45b Fix btls build for Linux.
As @baulig suggested us elsewhere.
2016-11-16 01:01:01 +09:00
Marek Safar 4f4c3422cc Remove global ipv6 disabled setting. Fixes #35536 2016-11-15 11:48:34 +01:00
Niklas Therning f3002a1f72 Merge pull request #3963 from ntherning/fix-missing-property-bag-c-file-in-vs-project
Fix missing property-bag.c file in VS project
2016-11-15 11:39:58 +01:00
Niklas Therning 7258af2a53 Merge pull request #3964 from ntherning/fix-vs-linking-error-missing-mono_dl_open
Fix VS error due to missing mono_dl_open()/mono_loader_register_module()
2016-11-15 11:39:22 +01:00
Niklas Therning 95873a47f9 Fix VS error due to missing mono_dl_open()/mono_loader_register_module()
PR #3955 removes mono_dl_open() and mono_loader_register_module() from
msvc/mono.def and msvc/monosgen.def which causes VS linking error. This change
readds the symbols to the def files as a temporary solution to get the VS
builds to build successfully again.
2016-11-15 11:33:02 +01:00
Niklas Therning 256750a9bf Fix missing property-bag.c file in VS project
PR #3936 adds the mono/metadata/property-bag.c file but doesn't add it to
msvc/libmonoruntime.vcxproj, resulting in linking errors when building the VS
solution.
2016-11-15 11:25:56 +01:00
Bernhard Urban 957d4804ab Merge pull request #3961 from akoeplinger/ppc-parallelism
[ci] Reduce make parallelism on ppc64
2016-11-15 08:31:10 +01:00
Mikko Korkalo 7eaf7889a8 fix a massive memory leak in MonoBtlsContext 2016-11-15 08:56:39 +02:00
Alexander Köplinger a493640751 Merge pull request #3952 from akoeplinger/add-tests
[ci] Add missing tests from Wrench
2016-11-15 03:19:21 +01:00
Alexander Köplinger f53186653c [ci] Reduce make parallelism on ppc64
-j4 seems to fail the build.
2016-11-15 03:17:25 +01:00
Rodrigo Kumpera 9d5ff689fc Merge pull request #3936 from kumpera/monoclass_reorg2
More MonoClass reorg, replace 3 fields with a property bag
2016-11-14 17:18:26 -08:00
Alexander Köplinger e7d00de0de [ci] Add missing tests from Wrench
While looking at the Wrench config I noticed there are a few
tests we don't run on Jenkins. This change adds those tests.
2016-11-15 01:53:13 +01:00
Alexander Köplinger 6ef504859c Merge pull request #3958 from akoeplinger/disable-tests
[runtime] Disable certain tests on PRs
2016-11-15 01:50:08 +01:00
Alexander Köplinger 5a5a1ba757 [runtime] Disable certain tests on PRs
This allows us to get back to green builds for PRs
while still keeping track of failing tests in master.
2016-11-15 01:47:04 +01:00
Rodrigo Kumpera ca50502af8 [runtime] Cache marshal info in locals whenever possible. 2016-11-14 14:25:36 -08:00
Rodrigo Kumpera 1abcf8518d Merge pull request #3945 from kumpera/fix-cross-domain-abort
[corlib] Fix cross-domain exception serialization under thread abortion.
2016-11-14 13:59:05 -08:00
Rodrigo Kumpera 80e7d453dc [bcl] Add comment on why the empty try block. 2016-11-14 13:58:40 -08:00
Alexander Köplinger f8763d5245 Merge pull request #3951 from akoeplinger/add-csproj-warning
[msvc] Add warning about autogenerated csproj to genproj
2016-11-14 20:26:47 +01:00
Jo Shields 12bca28936 [btls] Download & extract BTLS certs, on Linux builds. 2016-11-14 19:25:57 +00:00
Rodrigo Kumpera 9f791271c4 Merge pull request #3955 from kumpera/fix-embedding-api
[runtime] Don't add mono-dl.h to loader.h. Move the internal function to an internal header.
2016-11-14 14:03:25 -05:00
Rodrigo Kumpera 2df8d8091e [runtime] Don't add mono-dl.h to loader.h. Move the internal function to an internal header. 2016-11-14 08:04:24 -08:00
Rolf Bjarne Kvinge 30acb7cab9 [offsets-tool] Make sure to re-clone when the hash for the cpp binaries changes. 2016-11-14 16:59:34 +01:00
Ludovic Henry 9852c512ee [w32handle] Make mono_w32handle_ops_* functions private 2016-11-14 10:23:32 -05:00
Ludovic Henry 7af3479338 [w32handle] Compile them in on windows 2016-11-14 10:23:32 -05:00
Ludovic Henry d49734aa5a [w32handle] Remove unused header includes 2016-11-14 10:23:32 -05:00
Ludovic Henry 42f937c33d [os-event] Replace global cond by local cond for each waiting thread (#3941) 2016-11-14 10:08:09 -05:00
Alexander Köplinger 25e52ae81c [msvc] Update .csproj files 2016-11-14 15:34:27 +01:00
Alexander Köplinger b7382f5d6c [msvc] Add warning about autogenerated csproj to genproj
Hopefully reduces the confusion about the csproj files.
2016-11-14 15:33:56 +01:00
Martin Baulig dd99ba6366 [BTLS]: Use host name without port for the Server Name Indication (SNI). Bug #46549.
(cherry picked from commit 20e0914e03)
2016-11-14 15:08:26 +01:00
Henric Müller b8878d4ef0 Enabling pinvoke-utf8.exe test on Windows 2016-11-14 15:00:15 +01:00
Henric Müller 1b327ab61b Fix crash on Windows in PInvoke UTF8 tests
* Making sure `marshal_alloc`and `marshal_free` is used in libtest.c so
memory is allocated/freed with `CoTaskMemAlloc`/`CoTaskMemFree`.
* Now returning correct type for `MONO_NATIVE_UTF8STR` in `mono_type_to_unmanaged`.
2016-11-14 14:32:39 +01:00
Alexander Köplinger fe0b8311e7 Merge pull request #3940 from akoeplinger/deprecate-nunit
[bcl] Deprecate old NUnit 2.4 framework shipped with Mono
2016-11-14 13:43:34 +01:00
Alexander Köplinger f58eb9e642 Merge pull request #3937 from akoeplinger/mph
[msvc] Add Mono_Unix_VersionString to monoposixhelper.def
2016-11-14 00:00:05 +01:00
Marek Habersack d3522160eb Revert "Install utils/{mono-dl.h,mono-compiler.h}"
This reverts commit 397430c7f9.
2016-11-13 22:40:08 +01:00
Alexander Köplinger 7157eaa0fc [msvc] Add Mono_Unix_VersionString to monoposixhelper.def
Fixes the EntryPointNotFoundException when running the Mono.Posix tests on Windows.
This check was introduced in 249ee0686b but the .def file wasn't updated.

With this the tests still crash so switching them off on PRs again for now.
2016-11-13 18:41:22 +01:00
Alexander Köplinger 2d0cf43f3a [bcl] Deprecate old NUnit 2.4 framework shipped with Mono
Print a message when running nunit-console about the deprecation.
Additionally, throw a compilation error if compiling against the
TestFixtureAttribute from old NUnit.

Needed changes in ms-test-suite as well since it was still using NUnit.
2016-11-13 14:00:55 +01:00
Marek Habersack 397430c7f9 Install utils/{mono-dl.h,mono-compiler.h}
These two headers are required by loader.h which is installed in
$prefix/include/mono-2.0/mono/metadata and their lack breaks compilation
of any software that includes loader.h
2016-11-13 00:48:44 +01:00
Niklas Therning e5bf6d7612 Merge pull request #3938 from ntherning/UnicastIPAddressInformation.IPv4Mask-from-refsource
Change UnicastIPAddressInformation.IPv4Mask to work as in refsource on Windows
2016-11-12 08:41:55 +01:00
Rodrigo Kumpera 5a20ab0576 [corlib] Fix cross-domain exception serialization under thread abortion.
RemotingServices::SerializeExceptionData started to fail as TAE was being raised
from within the serialization code and this triggered the completely wrong abort protection code.

This happened because a recent change that made .cctors raise TAE at their end and the stack trace
code would hit System.Reflection.Module's cctor to fetch its GUID for the purpose of symbolification.

The fix is to use the correct protection against aborts, which is to run code from finally blocks.

This fixes multiple failures in the runtime test suite.
2016-11-11 14:48:31 -08:00
Zoltan Varga 6aa99cd1de [runtime] Add back the locking to setup_interface_offsets () to work around crashes in roslyn. 2016-11-11 15:41:36 -05:00
Ludovic Henry d1568db972 [os-event] Replace global cond by local cond for each waiting thread 2016-11-11 13:57:27 -05:00
Alexander Köplinger 86552ed978 Merge pull request #3942 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-11 19:55:36 +01:00
Alexander Köplinger 58504d90fb Fix git submodule url 2016-11-11 19:55:11 +01:00
monojenkins e0026352ea [msvc] Update csproj files 2016-11-11 18:46:04 +00:00
Marek Safar 6145a2d083 Remove extracted linker sources and reuse them via submodule 2016-11-11 18:53:31 +01:00
Ludovic Henry c0a5c44713 [w32handle] Stop returning 0 in every cases for locking/unlocking (#3926)
* [w32handle] Stop returning 0 in every cases for locking/unlocking

* [w32handle] Ensure we lock the signal handle in SignalAndWait
2016-11-11 10:13:38 -05:00
Marek Safar 8d8d7dc061 [mcs] Update better conversion tie breaking rules to cover candidate with longer default parameters. Fixes #45950 2016-11-11 15:55:13 +01:00
Niklas Therning 1e4715d757 Change UnicastIPAddressInformation.IPv4Mask to work as in refsource on Windows
Mono returns null for disconnected interfaces with 169.254.X.X address while
refsources returns 255.255.0.0. This patch copies the relevant pieces from the
refsources to make Mono behave the same.
2016-11-11 15:14:49 +01:00
Joao Matos a1ac272ffe [offsets-tool] Fixed the Makefile to clone into the base directory instead. 2016-11-11 12:59:14 +00:00
Johan Lorensson ced1dce6fb Merge pull request #3809 from lateralusX/jlorenss/win-api-family-support-cleanup
Build mono runtime under none desktop Windows API family, adjustments and cleanup.
2016-11-11 11:43:49 +01:00
Niklas Therning b21be86802 Merge pull request #3930 from ntherning/fix-System.ServiceProcess
Fixes bugs in System.ServiceProcess on Windows
2016-11-11 09:59:05 +01:00
Niklas Therning 49e6222d72 Fixes bugs in System.ServiceProcess on Windows
There was a crash on Windows x64 in Win32ServiceController when enumerating
devices and services. Also fixed the ServiceControllerTest to succeed on .NET
as well Mono on Windows. Had to replace the services used by the test since
most of them have been removed from recent Windows versions.

This PR also enables the System.ServiceProcess tests in Windows PR builds.
2016-11-11 09:37:02 +01:00
Miguel de Icaza 60971c6963 [eglib/mono] Aleksey caught a discrepancy between the semantics of Unix and Windows, our eglib version should always strdup (#3899) 2016-11-10 23:14:03 -05:00
Ankit Jain 387316fed6 [xbuild] Don't reevaluate project when setting metadata in a dynamic ..
.. item.

If we have a project, that sets some properties or items at runtime,
like in a target:

```
        <Target Name="Build">
                <PropertyGroup>
                        <Bar>Bar01</Bar>
                </PropertyGroup>
```

.. such a property can be accessed as `$(Bar)` subsequently.

Then at later point, a target tries to update metadata on an item group
with existing items, like:

```
	<ItemGroup>
		<FooItem Include="xyz" />
	</ItemGroup>

	<Target Name="Foo">
                <ItemGroup>
                        <FooItem>
                                <SomeMetadata>MetadataValue</SomeMetadata>
                        </FooItem>
                </ItemGroup>
```

.. then it is seen that the value for the earlier created `$(Bar)` disappears!
So, if we try to print the value of `$(Bar)` right after that item
group, it would appear as `''`!

The issue is that the metadata update in target `Foo` caused the project
to get re-evaluated, which meant that items/properites created after the
project load were lost! We should not be reevaluating the project when
setting metadata on the basis of dynamic items, like in the target
`Foo`.

These dynamic item groups in a target are represented as
`BuildItemTask`, and these create BuildItems which have their
`IsDynamic` property set. And this is used to avoid re-evaluating the
project in `BuildItem.SetMetadata`.

But when updating metadata (`BuildItem.UpdateMetadata`), we need to
update metadata on the *existing* items, which might not have been
created from such dynamic item groups! So, their `IsDynamic==false`.
Hence, trying to `SetMetadata` on such items would cause the project to
be reevaluated, and thus properties/items like `$(Bar)` would be lost!

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

In this particular case, `Bar` was the `DesignTimeBuild` property, which
was losing it's value when `ProjectReference`'s `AdditionalProperties`
metadata was set in:

```
 <Target Name="BclBuildAddProjectReferenceProperties"
    <ItemGroup>
      <ProjectReference>
         <AdditionalProperties>$(_BclBuildProjectReferenceProperties);%(ProjectReference.AdditionalProperties)</AdditionalProperties>
     </ProjectReference>
    </ItemGroup>
```
2016-11-10 18:20:36 -05:00
Rodrigo Kumpera bc59551adb [runtime] Move MonoClass::ref_info_handle into a property bag. 2016-11-10 14:58:33 -08:00
Rodrigo Kumpera 21d6f20fa9 [runtime] Move MonoClass::marshal_info and MonoClass::ext to use a property bag. 2016-11-10 14:58:05 -08:00
Rodrigo Kumpera 9eb033def8 [runtime] Wrap MonoClass::ext with accessors. 2016-11-10 14:58:04 -08:00
Rodrigo Kumpera 13380df8c7 [runtime] Wrap MonoClass::marshal_info with accessors. 2016-11-10 14:56:34 -08:00
Rodrigo Kumpera 579ff881cf [runtime] Add a simple linearizable property bag implementation. 2016-11-10 14:55:42 -08:00
Bernhard Urban e29e5fd104 [arm64] always assume a cache line size of 4
otherwise we still have the theoretical chance of a race.
2016-11-10 23:34:08 +01:00
Niklas Therning fa83c0c71a Merge pull request #3931 from ntherning/enable-System.Core-tests-on-windows-pr-builds
Enable System.Core tests on Windows PR builds
2016-11-10 21:28:23 +01:00
João Matos d9fdda567d Merge pull request #3927 from tritao/updated_offsets_tool
Updated offsets tool to latest CppSharp.
2016-11-10 18:55:51 +00:00
Marek Safar 00a8ed722d [System.Xml] Add XElement array handling to serialization interpreter. Fixes #12571 2016-11-10 18:43:14 +01:00
Marek Safar ba51c60b57 [system.xml] Enable more tests 2016-11-10 18:43:14 +01:00
Joao Matos 292f5ee377 [offsets-tool] Updated build scripts to handle multiple platforms. 2016-11-10 17:27:00 +00:00
Joao Matos d09eb49b80 [offsets-tool] Fixed whitespace inconsistency. 2016-11-10 17:27:00 +00:00
Joao Matos 7c2c4847fb Updated offsets tool to latest CppSharp. 2016-11-10 17:26:59 +00:00
Niklas Therning 8493ec8617 Enable System.Core tests on Windows PR builds
System.Core is expected to be green now on Windows.
2016-11-10 16:15:21 +01:00
Bernhard Urban e8c3544447 [ppc] clobber r0 in MONO_CONTEXT_GET_CURRENT
r0 can't be the base for a memory acces.
2016-11-10 13:00:36 +01:00
Bernhard Urban 584138b309 [ppc] some 32bit CPUs trap on std, use stw instead 2016-11-10 13:00:36 +01:00
Bernhard Urban eca9ee8003 [ppc] enable MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX on every PowerPC configuration on Linux 2016-11-10 13:00:36 +01:00
Bernhard Urban c330b2cb1d [ppc] use proper calling convention when coming from a signal handler
ELF v2 ABI (aka. ppc64le) defines two entry points per function.
The global entry point (offset 0) sets up the TOC (r2) itself, while the
local entry point (offset 8) is a fast entry point if the TOC is
already set up properly.

When the global entry point is used, the address of the global entry
point is required in r12 according to the ABI.
2016-11-10 13:00:36 +01:00
Bernhard Urban 5d96019cc2 [ppc] disable MONO_ARCH_HAVE_TLS_GET
`--with-tls=__thread` is broken on PowerPC.
`--with-tls=pthread` didn't work on PowerPC, but disabling
MONO_ARCH_HAVE_TLS_GET fixes it.

Instead of guarding the define with `HAVE_KW_THREAD`, let's just
disable it.  We want to get rid of `--with-tls=__thread` anyway.
2016-11-10 13:00:36 +01:00
Johan Lorensson 1c505b45de Merge pull request #3854 from lateralusX/jlorenss/win-clang-toolchain
Switch to Microsoft VS2015 MSVC toolchain for Windows x64 AOT compiler.
2016-11-10 09:37:55 +01:00
Zoltan Varga e7e0b463c7 Method field count (#3907)
* [runtime] Add accessors for method.count and field.count.

* [runtime] Move method/field count to MonoClassDef.
2016-11-09 22:54:29 -05:00
Zoltan Varga 080b4a9b3d [sdb] Avoid asserting when trying to single step on a thread with no managed frames. Fixes #34802. 2016-11-09 21:53:48 -05:00
Zoltan Varga ced8026cb8 [runtime] Fix another race in mono_class_setup_supertypes (). 2016-11-09 18:13:38 -05:00
Ludovic Henry 38a348c991 [threads] Always use the suspended MonoOSEvent for self-suspend (#3915)
* [stw] Refactor to treat error/success cases first

* [threads] Always use the `suspended` MonoOSEvent for self-suspend

The previous self-suspend mechanism was inherently racy:
 - T1 self suspend:
  - T1 calls mono_thread_info_begin_self_suspend, but doesn't call mono_thread_info_end_self_suspend yet
 - T2 suspends T1 <-- the suspend_count is > 0, trigerring the assertion at mono-threads.c:184
2016-11-09 15:59:36 -05:00
Ludovic Henry 723e5a1b07 [threads] Destroy suspend MonoOSEvent when detaching (#3923)
* [threads] Destroy suspend MonoOSEvent when detaching

It could happen that we destroy the managed InternalThread object, before we actually detach the thread (in mono/tests/threadpool-exceptions1.exe for example).

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

* [threads] Close thread handle once done with it
2016-11-09 15:59:24 -05:00
Zoltan Varga 6860a2180a [runtime] Simplify the wait_for_tids () code. (#3920) 2016-11-09 14:51:11 -05:00
Ludovic Henry 3f1bb30d94 [os-event] Make them manual only (#3921)
We only use them as manual reset event in the runtime, and that greatly simplifies the code as well as the way they should be used.
2016-11-09 14:44:29 -05:00
Zoltan Varga f988418693 [sdb] Avoid asserting when trying to single step on a thread with no managed frames. Fixes #34802. 2016-11-09 14:42:21 -05:00
Ludovic Henry a3e6245821 [io-layer] Remove dead code 2016-11-09 14:27:32 -05:00
Alexander Köplinger 10f86fb5fe [System] Fix a few type members on WatchOS
The .platformnotsupported.cs versions of some classes were
inconsistent with their "real" counterparts.
2016-11-09 20:20:27 +01:00
Ludovic Henry d2ad946be6 [process] Allocate a handle even for non-child processes (#3905)
* [w32handle] Inline only use of mono_w32handle_search

* [w32handle] Make special_wait return MonoW32HandleWaitRet

This is to avoid a unnecessary translation from WAIT_* to MonoW32HandleWaitRet

* [process] Use some more referencesource

* [process] Rename mono_processes to processes

* [process] Allocate a handle even for non-child processes

* [process] Create the handle only once the process has started
2016-11-09 08:00:11 -05:00
Ludovic Henry f96f13505a [os-event] Make unix version alertable (#3909)
This fixes `appdomain_unload.exe` test timeout. The following would happen:
 - T1 unload the current domain
  - T1 launch T2 to unload domain
  - T1 waits on T2 to finish
 - T2 tries to abort T1 <-- because the wait on T2 is not alertable, T1 is not going to be aborted
2016-11-09 07:50:12 -05:00
Zoltan Varga a284179696 [runtime] Add locking to mono_class_setup_supertypes () since the 16 bit idepth field cannot be set atomically. Fix a race if mono_field_resolve_type () was called without locking. (#3919) 2016-11-09 02:00:09 -05:00
Zoltan Varga 796d3ea7e8 [x86] Fix max code size of throw trampoline. 2016-11-08 18:55:57 -05:00
Alexander Köplinger d7651411e8 Bump nunitlite for display fixes 2016-11-08 21:25:08 +01:00
Alexis Christoforides e09ef88135 Bump bockbuild 2016-11-08 15:19:41 -05:00
Alexander Köplinger 6d75b73e58 [io-layer] Include sys/types.h header file in wapi.h
Fixes "error: unknown type name 'pid_t'" on Alpine/musl libc.
2016-11-08 20:05:06 +01:00
Alexander Köplinger 941bf17f1b [btls] Include stdint.h header file in btls-time64.c
Fixes "error: unknown type name 'int64_t'" on Alpine/musl libc.
2016-11-08 20:05:06 +01:00
Niklas Therning dab281b88d Merge pull request #3914 from ntherning/mono_context_get_current-on-windows-does-not-save-rsp-properly
mono_context_get_current() on Windows stores registers at incorrect indexes
2016-11-08 18:52:55 +01:00
Alexis Christoforides be95f699da Merge pull request #3773 from mono/bockbuild-integration
Integration of Bockbuild's Mac SDK profile
2016-11-08 11:10:26 -05:00
Alexis Christoforides 8d548bb0f0 Bump bockbuild 2016-11-08 11:10:05 -05:00
Alexis Christoforides 5670128912 Move some more files back to bockbuild repo 2016-11-08 11:09:38 -05:00
Niklas Therning b69a8ab666 mono_context_get_current() on Windows stores registers at incorrect indexes
The indexes must correspond to the values in the AMD64_Reg_No enum in
amd64-codegen.h.
2016-11-08 15:21:36 +01:00
Alexander Köplinger 8784e2e1cb Merge pull request #3913 from omwok/master
column name and ordinal fix.
2016-11-08 13:57:16 +01:00
lateralusX 8ec9b12e53 Switch to Microsoft VS2015 MSVC toolchain for Windows x64 AOT compiler.
In order to reduce dependencies on external toolchains when doing full AOT on Windows
targeting x64 Windows platforms we would like to use what's available in
VS 2015 MSVC toolchain. Mono's full AOT compiler need an assembler and a linker from
available toolchain in order to do different full AOT scenarios, emitting assembler, compile
objects or link complete shared library.

Since the current emitter emits GNU assembler it is beneficial to reuse that assembler
syntax without the need to adopt to a different syntax. In VS2015 Update 1 a new toolchain
option has been released utilizing the Clang parser combined with MSVC code gen. This will
produce object files fully compatible with MSVC linker. It turns out that VS2015 Clang version
also supports GNU assembler and since Mono just uses simple constructs in the assembler
(all code is already compiled and emitted as byte streams in assembler) it is possible to use Clang
for VS to compile our emitted assembler files.

This PR switches to Clang for Microsoft VS2015 and MSVC linker when doing full AOT targeting Windows x64
platforms hosted on a Windows platform. It requires an installation of at least Microsoft VS2015 Update 1
with Clang component selected. NOTE all other scenarios is currently left as is.

This PR also makes adjustments to AOT compiler in order for above scenario to work, supporting asm only output, static output
and regular shared libraries using MSVC linker.
2016-11-08 13:09:00 +01:00
Alexander Köplinger 857b39a58d Merge pull request #3911 from akoeplinger/marshal-cleanuprcw
[corlib] Add Marshal.CleanupUnusedObjectsInCurrentContext() stub
2016-11-08 12:46:44 +01:00
lateralusX b1fe69673c Additional none desktop API families triggered by changes.
* Changes to process.c triggered errors on none desktop API builds.
* Implementation of memory mapped files caused build errors on none desktop API builds.
* Adjustments to disable JIT caused build errors on none JIT builds.
2016-11-08 09:09:03 +01:00
lateralusX 23a69556de Build mono runtime under none desktop Windows API family, adjustments and cleanup.
Continuation work on previous none desktop Windows API family PR's adjusting all
changes to similar patterns used over previous PR's. This PR also move the logic
to silence a MS VS linker warning on empty source files into a macro. It also includes
the use of the macro in a couple of more source files causing linker warnings when build
on none desktop API families excluding JIT support.

Since other Windows API family work is still in progress it also disables build capabilities
for none desktop API families.
2016-11-08 09:04:49 +01:00
Marek Safar b75ef2bf85 Merge pull request #3912 from akoeplinger/marshal-ptrtostrbstr
[corlib] Expose Marshal.PtrToStringBSTR on mobile
2016-11-08 08:55:14 +01:00
Marek Safar 971b7a4e48 Merge pull request #3902 from henricm/fix-rename-lpstr-utf8
Rename fix for lpstr to utf8str on Windows
2016-11-08 08:50:50 +01:00
Alexander Köplinger df1475d95e [corlib] Expose Marshal.PtrToStringBSTR on mobile
The SecureStringHelper from referencesource I added in https://github.com/mono/mono/pull/3887
relies on this to convert from SecureString to plaintext.

It failed on mobile because we always throw a NotImplementedException there,
but we actually have an implementation on the runtime side (even in the DISABLE_COM case).
2016-11-08 01:31:30 +01:00
Alexander Köplinger 05b68a1d35 [corlib] Add Marshal.CleanupUnusedObjectsInCurrentContext() stub
https://github.com/dotnet/standard/issues/94
2016-11-08 00:04:47 +01:00
Zoltan Varga c8ae9af395 [runtime] Fix the ios build. 2016-11-07 17:38:15 -05:00
Zoltan Varga c65847a4ee [jit] Really fix the DISABLE_JIT build. 2016-11-07 15:48:05 -05:00
Aleksey Kliger (λgeek) 64871b1ac0 Merge pull request #3896 from lambdageek/bug-46250
[runtime] Ensure generic type definition arity matches generic context arity
2016-11-07 15:18:08 -05:00
Ludovic Henry d68a5479a7 [threadpool] Fix hang on domain unloading (#3904)
Because we wouldn't return the correct ThreadPoolDomain for the requested domain, we would simply wait on the last inserted MonoDomain. This would lead to a hang when unloading the domain, as we wouldn't wait on the correct domain.
2016-11-07 15:11:22 -05:00
Alexander Köplinger 8e8dcd24e4 Fix tarball build 2016-11-07 20:36:24 +01:00
Martin Baulig 4aa4345ba9 [BTLS]: Use int64_t instead of long in the native API. (#3857)
* [BTLS]: Use `int64_t` instead of `long` in the native API.

* Copy time64.c from Android's source code to get a 64-bit timegm64().

* Rename into btls_timegm64() and remove everything we don't need.

(cherry picked from commit 2365067bda)
2016-11-07 18:25:17 +01:00
Alexander Köplinger 213bce206b Merge pull request #3894 from akoeplinger/fix-actor
[System.ServiceModel] Recognize 'faultactor' in SOAP fault message
2016-11-07 18:24:14 +01:00
Zoltan Varga 54e882c080 [jit] Fix the DISABLE_JIT build. 2016-11-07 11:37:59 -05:00
Rodrigo Kumpera 4c960e1dd5 Merge pull request #2408 from tastywheattasteslikechicken/MoreInterfaceSupport
Enhance maximum number of supported interfaces from 2^16.
2016-11-07 08:04:29 -08:00
Niklas Therning 9f9d6ca94a Merge pull request #3903 from ntherning/fix-NRE-in-Win32-IpcChannel.StopListening-when-no-server-started
Fix NRE in Win32 IpcChannel.StopListening() when no server started
2016-11-07 15:04:54 +01:00
Niklas Therning 0176864293 Merge pull request #3901 from ntherning/Process_GetModules_internal-crash-on-windows
Fix crash in Process.GetModules_internal() on Windows after refactorings
2016-11-07 15:01:39 +01:00
Niklas Therning da894a3527 Fix NRE in Win32 IpcChannel.StopListening() when no server started
This makes the System.Runtime.Remoting test suite fail in various places on
Windows due to the TestFixtureTearDown method in BaseCalls throwing an NRE.
2016-11-07 15:00:05 +01:00
Henric Müller a030ec8904 Rename fix for lpstr to utf8str on Windows
PR https://github.com/mono/mono/pull/3776 renamed `mono_string_to_lpstr`
to `mono_string_to_utf8str` without updating the Windows version.
This fix renames `mono_string_to_lpstr` to `mono_string_to_utf8str` to
make sure the string is allocated using `CoTaskMemAlloc` on Windows
since it will be freed using `CoTaskMemFree`.
2016-11-07 14:46:21 +01:00
Niklas Therning 93040e9d7d Fix crash in Process.GetModules_internal() on Windows after refactorings
EnumProcessModules() is called incorrectly. Also fixes a missing curly braces
pair.
2016-11-07 12:01:43 +01:00
Alexander Köplinger b6588622bc Merge pull request #3900 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-07 02:29:55 +01:00
Zoltan Varga ffc3aaa95c [runtime] Move field.first and method.first to MonoClassDef. Add accessor functions for them. (#3898) 2016-11-06 12:34:45 -05:00
monojenkins 3ac86282de [msvc] Update csproj files 2016-11-06 04:20:14 +00:00
Zoltan Varga 9a4eec2f1f [arm64] Set a flag in MonoContext if the fp regs are saved, and only restore them if they are. These registers are not saved when the context is created from a ucontext. (#3890) 2016-11-04 22:19:25 -04:00
Aleksey Kliger (λgeek) bf95567e69 [mkbundle] Don't free bundled dylibrary directory (#3897)
mkdtemp modifies the template in-place, don't free it.
2016-11-04 21:02:23 -04:00
Rodrigo Kumpera 7bd7446abc Merge pull request #3796 from ntherning/windows-backend-for-MemoryMappedFile
MemoryMappedFile support on Windows
2016-11-04 14:59:47 -07:00
Marek Safar 711f82801d [mcs] Consider method candidates with misplaced named arguments not applicable. Fixes #46190 2016-11-04 18:35:36 +01:00
Marek Safar b43d5089e9 [mcs] Remove debug check 2016-11-04 18:35:36 +01:00
Alexis Christoforides 0c9a8acdf8 Properly configure the bockbuild submodule 2016-11-04 13:34:04 -04:00
Zoltan Varga 9e167696e7 [runtime] Add a few mono mono_class_is_... accessors. (#3891) 2016-11-04 12:34:13 -04:00
Alexis Christoforides 7066e490b9 Fix setting the min. macOS version in the Xamarin profile 2016-11-04 11:31:25 -04:00
Alexis Christoforides 147e97cb6d Rename 'bockbuild' to 'packaging' so that it can be home to other packaging code 2016-11-04 11:31:25 -04:00
Alexis Christoforides befd4fa677 Move the maintained common-use packages back to the bockbuild repo 2016-11-04 11:31:25 -04:00
Alexander Köplinger 69b3397c8e [System.ServiceModel] Recognize 'faultactor' in SOAP fault message
It's an optional element according to [1] and we were simply
throwing a NotImplementedException when encountering it.

Fixed by reading the element value instead. I noticed that we
had a 'details' variable that was never assigned, so the check
for `details == null` was always true and can be removed.
This makes inlining the body of the CreateFault() call easier
since we no longer need to choose different overloads and makes
the code consistent with the CreateFault12 method.
Also added a better exception in case of an unrecognized element.

The CreateFault12 method (handles SOAP 1.2) does not need a similar
fix since actor is not an element in that version [2].

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

[1] https://www.w3.org/TR/soap11/#_Toc478383507
[2] https://www.w3.org/TR/soap12/#soapfault
2016-11-04 16:18:46 +01:00
Aleksey Kliger f59468ec1b [runtime] Ensure generic type definition arity matches generic context arity
Don't instantiate generic type definitions (like Dictionary`2) with too few or too many
type arguments.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=46250
2016-11-04 11:16:01 -04:00
Aleksey Kliger 13492e1111 [tests] Test System.Type.GetType() on generics with wrong arity. 2016-11-04 11:16:01 -04:00
Marek Safar 933d252afc [mcs] More work on debug scopes declared out of order. Fixes #45774 2016-11-04 16:05:07 +01:00
Ludovic Henry 627eaebf94 [os-event] Fix set operation
This is a logic bug where we would only wake up one of the threads that are waiting for the manual MonoOSEvent to be set. This would be a problem only if more than one thread is waiting.
2016-11-04 10:46:19 -04:00
Ludovic Henry 52977849ff [threads] Use MonoOSEvent for Thread.Suspend/Resume (#3881)
* [threads] Refactor how we create Thread and InternalThread in native

* [threads] Add coop support for async call

* [threads] Use MonoOSEvent for Thread.Suspend/Resume

By using a MonoOSEvent we avoid relying on the utils/threads suspend mechanism to suspend a metadata/threads. This reduce coupling between both mechanism, and that would allow us to remove a bunch of code from utils/threads when switching to coop.

This only works with coop suspend, as we need the ability to return from an async call, and that's not possible with preemptive suspend.
2016-11-04 09:41:52 -04:00
Ludovic Henry 4303e10c00 [tests] Remove # to enable tests
Make would consider the files following the first # to be comments, leading to not passing it to the test-runner.
2016-11-04 09:23:40 -04:00
Alexander Köplinger f330fa65cb Merge pull request #3893 from henricm/fix-class-accessor-vsproj
Adding class-accessors.c to VS project
2016-11-04 14:04:43 +01:00
Alexander Köplinger c3b6638688 Merge pull request #3887 from akoeplinger/networkcredential-securestring
[System] Replace NetworkCredential with referencesource
2016-11-04 13:53:06 +01:00
Henric Müller 849c1c80b6 Adding class-accessors.c to VS project 2016-11-04 13:50:41 +01:00
Marek Safar 36e481bdef Merge pull request #3892 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-04 09:04:21 +01:00
monojenkins fd1db0807f [msvc] Update csproj files 2016-11-04 04:31:11 +00:00
Legowo Budianto a741882359 column name and ordinal fix...tested on 10.1 2016-11-04 09:31:56 +07:00
Zoltan Varga 68ff30d53f [jit] Cleanup the usage of DISABLE_JIT a bit so it encompasses the whole mini-codegen.c file, add DISABLE_JIT to mini-llvm.c. (#3888) 2016-11-03 21:43:15 -04:00
Zoltan Varga 4f1b55e520 [runtime] Revert parts of 016709fe52 which seems to cause races until they can be fixed. (#3889) 2016-11-03 21:30:28 -04:00
Alexander Köplinger 3d10e1c039 [System] Replace NetworkCredential with referencesource
Fixes an issue where the Mono implementation wasn't converting
between the SecureString and the plaintext version of the password.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=44109
2016-11-04 00:29:41 +01:00
Alexis Christoforides 8acbd0ddff Added 'mac-sdk-package' Make target 2016-11-03 19:16:44 -04:00
Zoltan Varga 45201f2596 Fix a warning. 2016-11-03 17:50:40 -04:00
Zoltan Varga 0a8a1e5b23 [arm64] Save+restore fp regs from the context in the call filter trampoline, the JITted code doesn't use them, but if the called code throws an exception, the throw context for the inner throw needs to contain the same values as the original throw context. (#3877) 2016-11-03 17:13:35 -04:00
Alexander Köplinger fe1f6c80be Merge pull request #3871 from akoeplinger/mono.posix-windows
[Mono.Posix] Disable Unix-specific tests on Windows
2016-11-03 20:48:54 +01:00
Marek Safar 5b4da36b41 [corcompare] Update custom XI project file to embed cecil sources 2016-11-03 16:12:58 +01:00
Marek Safar ffb18d2326 [mono-api-html] Remove unused cecil reference 2016-11-03 16:12:58 +01:00
Miguel de Icaza bb101a67b4 [mkbundle] Fix the argument order to put the entry point on argv[1] (#3879) 2016-11-03 10:58:36 -04:00
Rodrigo Kumpera 0709929293 Merge pull request #3734 from kumpera/monoclass_reorg
First pass at MonoClass reorg
2016-11-03 06:24:59 -07:00
Rodrigo Kumpera a0be4a06f4 Remove spurious slash. 2016-11-03 06:24:43 -07:00
Zoltan Varga 9458e258f9 [runtime] Fix the exception message to include the proper type name and calling assembly when Type.GetType () fails. Fix some warnings. (#3876) 2016-11-02 21:27:26 -04:00
Alexander Köplinger fe8c019484 Fix tarball
This file is now autogenerated.
2016-11-02 23:43:16 +01:00
Zoltan Varga 98677ae5af Fix some warnings. 2016-11-02 17:14:14 -04:00
Rodrigo Kumpera da3474947e Merge pull request #3867 from kumpera/issues
Fix some issues found by cppcheck.
2016-11-02 14:02:29 -07:00
Zoltan Varga 72799c7657 Fix some warnings. 2016-11-02 15:13:48 -04:00
Alexander Köplinger 948864764d [utils] More Mach ARM build fixes 2016-11-02 19:41:56 +01:00
Alexander Köplinger a21348b96a [utils] Fix mono_mach_arch_thread_states_to_mcontext function declaration
81b0032420 missed updating it in mach-support-unknown.c
2016-11-02 18:53:51 +01:00
Ludovic Henry abe50c6da3 [process] Fix OSX build 2016-11-02 13:31:15 -04:00
Alexis Christoforides 1e66b38d95 Updated symlink in MacSDKRelease profile 2016-11-02 13:21:18 -04:00
Ludovic Henry 7e1fe62cd9 [io-layer] Extract Process runtime support (#3859)
* [process] Separate code for unix and win32

* [process] Extract OpenProcess

* [process] Extract GetCurrentProcess

* [process] Extract GetModuleFileNameEx

* [process] Extract GetModuleBaseName

* [process] Extract EnumProcessModules

* [process] Extract GetModuleInformation

* [process] Extract CloseProcess

* [process] Extract ShellExecuteEx

* [process] Extract CreateProcessWithLogonW

* [process] Extract GetProcessId

* [process] Extract GetExitCodeProcess

* [process] Extract GetProcessWorkingSetSize and SetProcessWorkingSetSize

* [process] Extract GetPriorityClass and SetPriorityClass

* [process] Extract TerminateProcess

* [process] Extract GetProcessTimes

* [process] Extract CreateProcess

* [process] Extract wapi_process_set_cli_launcher

* [process] Extract wapi_process_get_path

* [process] Remove unused #define in processes.h

* [process] Extract _wapi_process_duplicate

* [process] Extract MonoW32HandleOps

* [process] Move the process related icalls to w32process

* [Process] Move platform specific code to dedicated files

* [process] Cleanup function names

* [io-layer] Remove dead code

* [process] Factor common unix and win32 code

* [process] Fix windows compilation
2016-11-02 12:46:47 -04:00
Marek Safar d4ec51a881 [mcs] Remove unknown warnings reporting to match latest csc 2016-11-02 16:54:24 +01:00
Vlad Brezae 5ee7b3fef5 [sgen] Fix sgen with nursery sizes bigger than 4G 2016-11-02 17:21:30 +02:00
Aleksey Kliger (λgeek) 3bda9496ae Merge pull request #3863 from lambdageek/dev-42584-take4
[custom-attrs] Add a low level iterator for custom attributes on assemblies

And use it to check for the reference assembly attribute.

Using the low level APIs means we don't trigger load of referenced
assemblies and we don't need to take locks, so it is safe to call this
during assembly loading.

Follow up work for https://bugzilla.xamarin.com/show_bug.cgi?id=42584
2016-11-02 11:17:55 -04:00
Alexander Köplinger 56e413a81e Merge pull request #3870 from evincarofautumn/fix-xmm-scanning-mac-arm
[runtime] Fix Mach ARM build.
2016-11-02 15:55:55 +01:00
Alexander Köplinger 3e63523421 [Mono.Posix] Disable Unix-specific tests on Windows
They don't make sense there.

Added nunit group to win32.make for excluding, similar to darwin.make
2016-11-02 15:29:24 +01:00
Alexander Köplinger 355923cba6 Merge pull request #3874 from henricm/isolated-file-stream-testscleanup
Making sure opened streams are closed in IsolatedStorageFileStreamTests
2016-11-02 15:18:46 +01:00
Alexander Köplinger 5e37e386cc [bcl] Add back "dot-per-test" progress indicator to nunitlite
The verbose mode can be enabled with TEST_HARNESS_VERBOSE=1 like before.
We now also print the full test name including namespace in verbose mode again.
2016-11-02 15:14:24 +01:00
Henric Müller 166054d230 Making sure opened streams are closed in IsolatedStorageFileStreamTests 2016-11-02 15:13:23 +01:00
Marek Safar d245400442 [build] MonoTouch specific build flags injection 2016-11-02 13:34:28 +01:00
Marek Safar f240b04af6 Merge pull request #3869 from radical/mcs-ignore-arg
[mcs] Accept and ignore command line args supported by csc that we don't
2016-11-02 09:04:44 +01:00
Zoltan Varga ed8f1918b7 [arm] Fix MONO_CONTEXT_GET_CURRENT (), the inline assembly block was using pre-increment addressing instead of post increment. (#3866) 2016-11-02 03:22:57 -04:00
Zoltan Varga 164864252c [runtime] Fix the build. 2016-11-02 00:23:36 -04:00
Zoltan Varga bc66f5a21c [jit] Simplify the code generation for the mkrefany opcode, the same code can handle the aot and non-aot case. The non-aot case was emitting OP_STOREP_MEMBASE_IMM opcodes with 64 bit immediates, and some platforms like arm64 couldn't handle that. 2016-11-01 22:15:46 -04:00
Zoltan Varga 0eda1938a4 [arm] Call the tls get trampoline through a GOT slot instead of directly, since a direct call could go through the trampoline code which would fail if the thread is not attached to the runtime. Fixes #45371. (#3850) 2016-11-01 22:05:54 -04:00
Rodrigo Kumpera 5b11f8ed1b Fix rebase issues. 2016-11-01 17:48:44 -07:00
Jon Purdy 81b0032420 [runtime] Fix Mach ARM build. 2016-11-01 17:45:06 -07:00
Zoltan Varga 6cee4c38ab Revert "[bcl] Compile nunit-lite-console using -d:MONO so it doesn't print the list of ignored tests. (#3865)"
This reverts commit cff2aab0d2.

Revert this as its not needed.
2016-11-01 20:15:05 -04:00
Rodrigo Kumpera d0b87d802e [runtime] Introduce mono_class_is_interface. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera ced456394e [runtime] Introduce mono_class_is_abstract. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera b065c28572 Fix copyright notices. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera b5f7cd65fd [runtime] Add counters for how many times ext, ref_info_handle and marshal_info are set. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera 7ab70ce86d [runtime] Move MonoClass::next_class_cache to MonoClassDef. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera e0aa84b16c [runtime] Add counters for the number of class kinds that are loaded. 2016-11-01 17:14:28 -07:00
Rodrigo Kumpera 96c46ddad4 [runtime] Move MonoClass::generic_container to MonoClassGtd. 2016-11-01 17:13:49 -07:00
Rodrigo Kumpera b6fede3eee [runtime] Move MonoClass::flags to MonoClassDef.
This flag is constant on most types. Now it's on the only place that actually has it as variable.
2016-11-01 17:12:52 -07:00
Rodrigo Kumpera de3b35df91 [runtime] Move MonoClass::generic_class to MonoClassGenericInst.
To make this possible, two accessor functions were added/augmented:

mono_class_get_generic_class: Gets the generic_class and aborts if the MonoClass is of the wrong kind.
mono_class_try_get_generic_class: Gets the generic_class or return NULL if the MonoClass is of the wrong kind.

The bulk of this change is converting all checks for generic_class into calls to mono_class_is_ginst.
2016-11-01 17:11:54 -07:00
Alexis Christoforides 288472465f More refactoring fixes on final bundling commands. 2016-11-01 20:07:45 -04:00
Alexander Köplinger afdb0eef30 Merge pull request #3855 from akoeplinger/shacng-monodroid
[corlib] Map SHA*Cng algorithms to SHA*Managed on monodroid
2016-11-02 00:52:37 +01:00
Sylvan Clebsch 0760eeaff0 Remove exception when using SO_REUSEADDR on Linux (#3856)
SO_REUSEADDR and SO_REUSEPORT are fundamentally different. This
exception seems to have been put in place to address the lack of
the latter on older Linux kernels for TCP. However, the change in
fact raises an exception when SO_REUSEADDR is used, which causes
failures in server applications, which may use SO_REUSEADDR to
avoid WAIT state timeouts.

Description of SO_REUSEADDR and SO_REUSEPORT differences:

http://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t

Some problems caused by raising this exception:

https://github.com/zeromq/netmq/issues/623
https://github.com/zeromq/netmq/issues/592
https://github.com/fsprojects/IfSharp/issues/90
2016-11-01 18:41:46 -04:00
Ankit Jain bf2e774278 [mcs] Accept and ignore command line args supported by csc that we don't
.. support:

	/deterministic+
	/deterministic-
2016-11-01 18:15:05 -04:00
Aleksey Kliger 30faaa5bf2 [custom attr] Iterate over methoddef custom attrs
Make mono_assembly_metadata_foreach_custom_attr iterate over
MethodDef custom attributes in addition to MemberRef.
2016-11-01 18:02:12 -04:00
Aleksey Kliger d24c77f6bb [loader] treat corlib same as other assemblies when checking ReferenceAssemblyAttribute
Now that we're using a metadata-only ReferenceAssemblyAttribute check,
we can treat corlib the same as any other assembly - if we see
ReferenceAssemblyAttribute when loading a candidate assembly, skip it.
2016-11-01 18:02:10 -04:00
Aleksey Kliger 30d1361838 [custom-attrs] Add low-level metadata iterator for assembly custom attributes
And use it to check for the reference assembly attribute.

Using the low level APIs means we don't trigger load of referenced
assemblies and we don't need to take locks, so it is safe to call this
during assembly loading.
2016-11-01 18:01:31 -04:00
Rodrigo Kumpera 1f9b93545a [runtime] Introduce specialized structs for each MonoClass kind. 2016-11-01 14:17:59 -07:00
Rodrigo Kumpera 62b96ad507 [runtime] Introduce kind test functions to cleanup things a bit.
Instead of doing

```
if (klass->class_kind == MONO_CLASS_GTD)
	...
```

Now you do:

```
if (mono_class_is_gtd (klass))
	...
```
2016-11-01 14:17:59 -07:00
Rodrigo Kumpera 4f8d260c67 [runtime] Introduce MonoClass::class_kind and remove is_generic and is_inflated. 2016-11-01 14:17:59 -07:00
Rodrigo Kumpera 81b391fbbd Merge pull request #3764 from evincarofautumn/fix-xmm-scanning-mac
[wip] [runtime] Fix scanning of SIMD registers on Mac.
2016-11-01 12:03:00 -07:00
Rodrigo Kumpera 4471e98bfa Fix some issues found by cppcheck. 2016-11-01 12:00:41 -07:00
Ludovic Henry bfff011734 [threads] Fix Posix async resume (#3861)
If we fail to send the signal, we should not add a pending operation, as the signal handler is never going to answer this operation (via mono_threads_notify_initiator_of_resume).
2016-11-01 14:45:47 -04:00
Marek Safar 26e90ec185 Merge pull request #3864 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-11-01 10:20:37 +01:00
Zoltan Varga cff2aab0d2 [bcl] Compile nunit-lite-console using -d:MONO so it doesn't print the list of ignored tests. (#3865) 2016-11-01 03:47:53 -04:00
monojenkins 1f45c80ead [msvc] Update csproj files 2016-11-01 04:24:32 +00:00
Jon Purdy 273f507b11 [runtime] Fix scanning of SIMD registers on Mac.
Include XMM regs in context. Use names instead of hardcoded offsets.
2016-10-31 15:03:10 -07:00
Zoltan Varga c4762e796c [runtime] Perform the reference assembly attribute check using the low level metadata apis outside of a lock. 2016-10-31 17:52:18 -04:00
Alexis Christoforides c6cfe554ab Bump bockbuild 2016-10-31 16:16:23 -04:00
Alexis Christoforides 8243706038 [bockbuild] Remove broken sanity check in 'mono' package.
The test correctly fails, as the staging code fails to replace some instances of the destination prefix with the staging prefix. This is a benign error that was already there (the test was just not working) so we are ignoring for now. We must however fix this before e.g. shipping mono in arbitrary staged locations.
2016-10-31 16:12:50 -04:00
Alexis Christoforides ab652c0deb Ensure '/etc/paths.d' exists (it doesn't on clean macOS Sierra installations) 2016-10-31 15:49:25 -04:00
Alexis Christoforides ff641b0063 [bockbuild] Fix regex matching on a deploy-time sanity check on the Mono package 2016-10-31 13:29:35 -04:00
Zoltan Varga 758b80e35c [sgen] Move the logic to determine whenever an ip is in a critical method to sgen code. Avoid loading aot info because its not async safe. (#3853) 2016-10-31 13:18:28 -04:00
Alexis Christoforides ecab2ef241 Bump bockbuild 2016-10-31 13:11:37 -04:00
Alexander Köplinger e796ded61a [corlib] Map SHA*Cng algorithms to SHA*Managed on monodroid
This is a followup to e9205142b2.
Monodroid is missing the Cng and CryptoServiceProvider variants of the SHA
algorithms as well so we need to map to the Managed variants there too,
like on monotouch.
2016-10-31 17:35:13 +01:00
Aleksey Kliger (λgeek) bb4b0ff4fc Merge pull request #3802 from lambdageek/dev-reference-attr-take3
[loader] Re-enable the reference assembly attribute check
2016-10-31 10:16:05 -04:00
Alexander Köplinger 1bb10ac895 Bump boringssl submodule to the correct commit
It was accidentally reverted in https://github.com/mono/mono/commit/95b0698304cbc54fdfd2eac00692c9c8c3c8875d
2016-10-31 13:41:57 +01:00
Marek Safar 0226d3397c [corlib] SharedStatics from referencesource. Fixes #46175 2016-10-31 12:56:56 +01:00
Alexander Köplinger 67d9f3e720 Merge pull request #3851 from akoeplinger/nunitlite
Switch BCL testing from nunit to nunitlite
2016-10-31 12:54:49 +01:00
Alexander Köplinger 3bc76b068d [System] Disable a test that reads a file on mobile
We don't have a way to pass the file to our mobile test runners at the moment.
2016-10-31 12:41:13 +01:00
Alexander Köplinger 9614307bfb [System] Fix monodroid build when BTLS is disabled 2016-10-31 02:07:03 +01:00
Alexander Köplinger d749672b0b [nunitlite] Port babysitter work from nunit24
See https://github.com/mono/mono/commit/1dc0598badaed161efa92fd261de7e555d1a2b13
2016-10-29 14:09:43 +02:00
Alexander Köplinger 2dda624df4 [System.ServiceModel] Make looper thread in ChannelDispatcher a background thread and join instead of abort
This showed up when switching to nunit-lite since it runs all tests in the same AppDomain,
meaning it won't exit when any foreground threads are still running. This was the case
with the thread created by ChannelDispatcher which was still waiting on a connection.

Also try to Join() the thread for a bit so it exits gracefully before trying to abort,
might resolve issues like in https://github.com/mono/mono/pull/3819
2016-10-29 14:09:42 +02:00
Alexander Köplinger a0a01df763 [System.Web.DynamicData] Fix references to nunit.mocks
nunitlite.dll does not include namespace NUnit.Mocks and it is not necessary.
2016-10-29 14:09:41 +02:00
Alexander Köplinger 95f9f418e8 [System.Web] Remove Explicit attribute from test
With nunitlite the test is executed even though it's marked as ignored when the attribute is there.
This is probably the same bug as https://github.com/nunit/nunit/issues/741 (we're passing -exclude for some categories to nunit).
2016-10-29 14:09:41 +02:00
Alexander Köplinger e7b54ec1db [WinForms] Disable the ApplicationTest.RestartNotSupportedExceptionTest for now
It causes an infinite loop because nunit-lite restarts itself over and over when running the test
as the tests don't run in a separate AppDomain so the host process is restarted.
2016-10-29 14:09:40 +02:00
Alexander Köplinger 62c1f50cde [Microsoft.Build] Ignore ThreadAbortException in BuildNodeManager
It showed up after test runs with nunit-lite because it caused writes to Console.Error.
2016-10-29 14:09:39 +02:00
Alexander Köplinger 1a89bfde05 [System.Xml/System.ServiceModel/Dataflow] Use more specific type in assert
Apparently nunitlite is more strict here so we need to allow subclasses as well
and test for the more specific type.
2016-10-29 14:09:39 +02:00
Alexander Köplinger fbf1acd698 [System.Xml] Fix embedded assembly name in XmlCodeExporterTests
nunitlite doesn't run the test in a separate AppDomain so we get the name of the console host.
2016-10-29 14:09:38 +02:00
Alexander Köplinger 40c3407ab9 [System.Runtime.Remoting] Fix double call to ChannelServices.UnregisterChannel
It is already called in TestFixtureTearDown, and calling it twice results in an exception in UnregisterChannel
the second time because the channel is no longer registered.
2016-10-29 14:09:37 +02:00
Alexander Köplinger 77bcadb7dd [System.Data.OracleClient] Replace config file lookup of ConnectionString with env var
This is easier with the new nunitlite config file handling.
2016-10-29 14:09:36 +02:00
Alexander Köplinger 892cd52636 [System.Data.Linq] Fix "build" subdirectory to work with nunitlite
TODO: we should refactor this, seems crazy to have a frankencopy of the test machinery in this folder.
2016-10-29 14:09:36 +02:00
Alexander Köplinger 2550144e79 [corlib/System/System.Configuration] Fix tests relying on the current directory to be the test folder
nunitlite runs tests shadow-copied in a temp folder, so looking up the resource based on the current dir doesn't work.
2016-10-29 14:09:35 +02:00
Alexander Köplinger f1ae0bcaae [corlib] Disable a test that is incompatible with how nunitlite runs tests 2016-10-29 14:09:34 +02:00
Marcos Henrich 5913682513 [bcl] Replace deprecated usage of Assertion class and Is.InstanceOfType usages.
nunitlite does not contain Assertion class.

nunitlite does not implement Is.InstanceOfType, replaced usages of:
Assert.That (type, Is.InstanceOfType(typeof(T))) with Assert.IsInstanceOfType.
2016-10-29 14:09:34 +02:00
Marcos Henrich 863dc73d19 [bcl] Add NUnitHelper.cs with API not in nunit-lite
NUnitHelper.cs adds CollectionAssert, FileAssert, StringAssert.

Also adds AssertHelper class with methods that are not part of nunitlite
Assert class.
2016-10-29 14:09:33 +02:00
Alexander Köplinger 01c9543e08 [bcl] Add patching of nunit-lite-console.exe.config file
Because nunit-lite runs everything in the same AppDomain, we can't use dll.config files for settings anymore.
Since a few test suites rely on being able to read those settings we need to patch them into the main
nunit-lite-console.exe.config file instead before the test.

Remove all _test.dll.config files and replace with nunit-lite patcher equivalent
2016-10-29 14:09:32 +02:00
Marcos Henrich a0f51a3803 [bcl] Replace nunit24 with nunit-lite
Get rid of TEST_HARNESS_VERBOSE and enable verbose logging by default

nunit-lite doesn't have the "dot when test runs" progress indicator anymore,
so we need to enable "verbose" output by default otherwise we don't get
any progress until the test run is over.

Also remove the TestResult_$(PROFILE).log and nunit-summary.xsl files,
they're not needed anymore.
2016-10-29 14:09:31 +02:00
Alexander Köplinger 02bdc5ab21 Merge pull request #3852 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-29 13:37:10 +02:00
JensEhrhardt-eOPUS e1afc84bb1 UdpClient.Receive parameter refers to remote EP (#3842)
Instead of listening to a local end point, listen to any remote endpoint answering to our request.
2016-10-29 10:38:35 +02:00
monojenkins 4b9251d1cd [msvc] Update csproj files 2016-10-29 04:24:01 +00:00
Ludovic Henry f588b336fc [threads] Replace use of W32Handle by MonoOSEvent for MonoThreadInfo exited event (#3659)
* [mono-threads] Make thread wait platform specific

* [mono-threads] Replace thread w32handle use by event

This allows use to remove the MonoThreadInfo dependency on the w32handle on posix.

* [w32handle] Move them to metadata

w32handle are purely for managed support, and they shouldn't be used in the runtime.

* [mono-threads] Factor open/close thread handle

* [mono-threads] Factor exit thread

* [mono-threads] Factor platform register/unregister thread

* [mono-threads] Use ThreadHandle on all platforms

* [threads] Fix mutex abandonning for main thread

According to the comment, the intent is to abandon the mutex hold by the current thread. This intent was conveyed by the previous code when the threading code was still in the io-layer.
2016-10-28 17:00:54 -04:00
Aleksey Kliger 0465b3764f [tests] Build AOT prereqs for reference-loader test 2016-10-28 16:38:41 -04:00
Zoltan Varga 016709fe52 More metadata cleanup (#3792)
* [runtime] Introduce a new mono_class_init_sizes () function which initializes only the instance fields without initializing fields if possible. Use it in a few places instead of mono_class_init ()/mono_class_setup_fields ().

* [runtime] Simplify mono_class_has_references (), it doesn't have to special case the init_pending case.

* [runtime] Use a TLS list instead of the 'init_pending' flag to detect recursion in mono_class_init ().

* [runtime] Reduce the size of the critical section in mono_class_init () by doing most of the work outside the lock.

* [runtime] Avoid loading cached class info for pointer etc. types.

* [runtime] Reduce the locking inside setup_interface_offsets ().
2016-10-28 15:51:35 -04:00
Zoltan Varga b06664a292 [sre] Remove some dead code. 2016-10-28 15:29:07 -04:00
Alexander Köplinger d9a4d1e672 Merge pull request #3847 from rolfbjarne/btls-remove-unused-pinvokes
[System] Remove unused BTLS P/Invokes.
2016-10-28 16:03:36 +02:00
Alexander Köplinger 4c8069a5e1 [bcl] Disable BTLS on xammac and xammac_net_4_5 profiles 2016-10-28 15:59:00 +02:00
Alexander Köplinger d1555df244 [btls] Fix library install
We need to ensure the directory is created and doesn't have an extraneous '/' char.
2016-10-28 15:52:27 +02:00
Ludovic Henry 3f78cade58 [threads] Fix suspend on watchos
Because certain platform (such as WatchOS) do not support syscall abort, we need to ensure that it is supported before we call the `mono_threads_suspend_abort_syscall` function.
2016-10-28 09:12:26 -04:00
Alexander Köplinger 34edae78f3 configure.ac: fix incorrect description 2016-10-28 15:11:54 +02:00
Ludovic Henry d6e1e41a81 [gc] Remove mono_gc_set_stack_end (#3845)
* [sgen] Add stress test

This hope to suspend a thread while it is in the process of attaching or detaching.

* [sgen] Fix unified suspend

This would cause a crash with unified suspend: if a thread would be suspended at mono-threads.c:1168, the stack_start would be greater than the stack_end, triggering the g_error at sgen-stw.c:351. The stack_end would initially be initialized in `sgen_client_thread_register`, but it would be overriden in start_wrapper at threads.c:893.
2016-10-28 08:49:23 -04:00
Alexander Köplinger f4d2a54f88 Merge pull request #3846 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-28 12:07:12 +02:00
João Matos 4df4cc49b7 Merge pull request #3844 from tritao/deflate_fixes
[System.IO.Compresion] DeflateStream fixes
2016-10-28 11:06:00 +01:00
Rolf Bjarne Kvinge a5366237de [System] Remove unused BTLS P/Invokes.
They point to internal functions that don't exist, causing compilation
problems for Xamarin.Mac apps.

Example test/compile failure: https://gist.github.com/rolfbjarne/43cf2228816bbe8a863f331da3e07c0d
2016-10-28 08:17:25 +02:00
monojenkins f1695b00b0 [msvc] Update csproj files 2016-10-28 04:24:51 +00:00
Alexander Köplinger 841db2c41b [corlib] Disable a few tests that are not supported on MOBILE_STATIC for now
They were added in 895f3f5ae8.
2016-10-28 03:14:48 +02:00
Zoltan Varga 8ba31bf79d [llvm] Add the 'notail' flag to non-tailcalls when using the 3.9 based llvm. 2016-10-27 18:29:05 -04:00
Joao Matos dd0745f426 [System.IO.Compression] Fixed potential bug when keeping track of total read bytes of input stream.
This didn't manifest as a bug, to to be on the safe side, replicate the behavior
introduced in https://github.com/mono/mono/commit/b4d5016b5e42fec226d93fd13260b6cac80eb384
and use the same approach when calculating the total of the read bytes of the input stream.
2016-10-27 22:01:21 +01:00
Joao Matos 0b94fdf1d3 [System.IO.Compression] Fixed DeflateStream input stream EOF condition.
What was happening is that we set the stream EOF flag to true when we
could not read any more input data, and that made us early out before
fully finishing the processing of the compressed data.

Now the only EOF flag is set to true is if zlib's inflate() has actually
finished processing the data.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=44994#c2.
2016-10-27 22:01:10 +01:00
Aleksey Kliger a81db01598 [coop handles] Don't scan null object references
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=45223
2016-10-27 16:12:28 -04:00
Joao Matos 31f8da0b50 [System.IO.Compression] Fixed DeflateStream inflate() decompression loop.
This reworks the fix from https://github.com/mono/mono/commit/7c4d41a518aaf0370b882f9430752ebcd5544c10.

That fix introduced a regression when handling some inputs, which lead us to ignore
some left-over data from zlib's inflate output buffer.

Now we only break from the loop if inflate() returns Z_BUF_ERROR.

This makes sure all data is fully processed before returning to managed code.

Fixes one of the bugs in https://bugzilla.xamarin.com/show_bug.cgi?id=44994#c2.
2016-10-27 20:44:38 +01:00
Vlad Brezae 86c24e9427 Merge pull request #3769 from evincarofautumn/fix-verify-before-allocs
[sgen] Fix verify-before-allocs.
2016-10-27 20:49:30 +03:00
Zoltan Varga d831fc4ec4 [btls] Remove the statically linked btls code, the dynamic version should work on all platforms. (#3829) 2016-10-27 13:21:09 -04:00
Martin Baulig b0d5b36639 [bcl]: Fix 'Mono.Btls.Interface' build logic.
(cherry picked from commit 43558a209d)
2016-10-27 17:59:53 +02:00
Alexander Köplinger 8fcd9402c5 Merge pull request #3800 from madewokherd/mingwbuild
Use lower-case names for Windows headers.
2016-10-27 12:37:23 +02:00
Abdur Rehman a0cb3e16e6 [man] Typo fixes for the man pages
disco.1: fix typo, closes #3841

csharp.1: fix typos, closes #3840

crlupdate.1: fix minor typo, closes #3839

certmgr.1: fix typos/grammar, closes #3838

ccrewrite.1: fix minor grammatical errors, closes #3837

ccrewrite.1: fix copyright, closes #3836

Following comment changed the copyright:
https://github.com/mono/mono/commit/5a3fb39ca6a46250aec3afef21c85bef30239fc5

Reflect same change in the comments.
2016-10-27 12:19:30 +02:00
Alexander Köplinger 60b660d218 Merge pull request #3826 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-27 02:24:09 +02:00
Marius Ungureanu b8d2428d2c Update io.c 2016-10-27 03:14:04 +03:00
Alexander Köplinger aefc06ddf6 Merge pull request #3831 from rolfbjarne/watchos-fix-defaultproxy-test
[System] Tweak define to exclude System.Net.WebProxy.CreateDefaultProxy and update corresponding test.
2016-10-27 00:32:17 +02:00
Alexander Köplinger 90e87c31d0 Merge pull request #3832 from microMolvi/patch-2
cccheck.1: fix a typo
2016-10-27 00:30:23 +02:00
Zoltan Varga e3717a6441 [runtime] Fix a test so it works with bitcode, stack traces might contain wrapper frames. 2016-10-26 18:10:54 -04:00
Zoltan Varga 29a5474288 [llvmonly] Add gsharedvt out wrappers for icalls, the icall wrappers have a different signature (this/no this). 2016-10-26 16:38:36 -04:00
Abdur Rehman a0c222056c cccheck.1: fix a typo 2016-10-27 01:00:23 +05:00
Ludovic Henry a0d20ebbf7 [suspend] Remove sgen specific suspend code (#3640)
* [suspend] Remove sgen specific suspend code

* [sgen] Remove unused SgenClientThreadInfo->stopped_domain field

* [sgen] Remove unused SgenClientThreadInfo->stopped_ip field

* [threads] Unsplit code for syscall abort

* [threads] Reuse posix suspend signal handler function for abort

* [mono-threads] Move debug printf to separate file

This is to avoid recompiling half of the runtime for every change to these printf.

* [stw] Slightly improve logging

* [mono-threads] Fix unified thread suspend

`mono_threads_suspend_begin_async_suspend` return FALSE iff it coudn't successfully suspend the thread, not if the thread is not in the correct state. The latter is checked by calling `mono_threads_suspend_check_suspend_result` which will return FALSE if we couldn't initialize the state of the suspended thread.

* [mono-threads] Fix unified thread suspend

If we try to suspend a thread that is still attaching, we might suspend it after it allocated the MonoInternalThread and MonoThread, but before it set the current domain or lmf. This would lead us to not scan the thread stack, which would lead to collect the newly allocate MonoInternalThread/MonoThread, leading to a crash. By letting sgen deal with the thread, even if the domain or the lmf is not set, we avoid this bug.

This makes unified suspend have the same behaviour as the previous sgen specific suspend.

* [mono-threads] Fix compilation
2016-10-26 14:57:17 -04:00
Rolf Bjarne Kvinge 92d4f79eac [System] Tweak define to exclude System.Net.WebProxy.CreateDefaultProxy and update corresponding test. 2016-10-26 20:38:33 +02:00
Bernhard Urban 0976d12d67 [mono-config] fix warning (#3820)
```
mono-config.c:324:14: warning: passing 'const char *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                                        g_free (libdir);
                                                ^~~~~~
../../eglib/src/glib.h:125:20: note: passing argument to parameter 'ptr' here
void g_free (void *ptr);
                   ^
1 warning generated.
```
2016-10-26 13:05:06 -04:00
Zoltan Varga fafa1a9662 [llvm] Use the global llvm context instead of creating a new one for each aot module, since the latter seems to cause random memory corruption/crashes. 2016-10-26 12:42:09 -04:00
Zoltan Varga 2b09b5fd6b [btls] Install the btls shared library on make install. (#3825) 2016-10-26 11:54:52 -04:00
Marek Safar a3539b2ecb [mcs] Add pathmap option 2016-10-26 11:53:11 +02:00
Niklas Therning 205a420dae MemoryMappedFile support on Windows
This implements the icalls in file-mmap-windows.c used by MemoryMappedFile.
The implementation has been inspired by the CoreFX MemoryMappedFile
implementation.

This patch also fixes a few incompatibilities between .NET and Mono:

 * The default MemoryMappedFileOptions has been changed from DelayAllocatePages
   to None.
 * mono_pagesize() on Windows now return SYSTEM_INFO.dwPageSize, the same as
   .NET and CoreFX.
 * Added mono_valloc_granule() which returns
   SYSTEM_INFO.dwAllocationGranularity and changed mono-codeman.c to use it
   when trying to allocate adjacent virtual memory.
 * MemoryMappedFileTest has been updated to succeed on .NET.
 * A test has been added to test correct DelayAllocatePages behavior (only
   supported on Mono on Windows, the flag is ignored on other platforms).
 * The posix MemoryMappedFile code has been changed to throw
   UnauthorizedAccessException rather than IOException when trying to create a
   view outside of the bounds of a MemoryMappedFile.
 * Creating a named mapping larger than 4GB on 32-bit systems now throws
   ArgumentOutOfRangeException.
2016-10-26 11:33:50 +02:00
monojenkins c91a014a87 [msvc] Update csproj files 2016-10-26 05:22:19 +00:00
Alexis Christoforides 57442250a9 Bump bockbuild 2016-10-25 19:43:48 -04:00
Zoltan Varga 57b34f6b07 [mobile-static] Increase trampoline limits even more. 2016-10-25 18:51:17 -04:00
Zoltan Varga bbf92a5129 [mobile-static] Increase the number of imt trampolines to 2000 to prevent running out of them in the System.Core tests. 2016-10-25 18:13:07 -04:00
Alexis Christoforides 044d3a68a0 Couple more 'bockbuild split' mixups 2016-10-25 18:12:51 -04:00
Alexis Christoforides 726c95447c 'storage.box.xamarin.com' is now 'xamarin-storage' (internal URL) 2016-10-25 18:12:09 -04:00
Zoltan Varga d8d301140c [runtime] For delegate invoke wrappers, store the generic invoke method in the wrapper info and inflate it when inflating the wrapper. Fixes ipy failure. (#3821) 2016-10-25 18:05:32 -04:00
Alexis Christoforides c42497b8b7 Bumped bockbuild 2016-10-25 17:01:37 -04:00
Alexander Köplinger 6d22e137f5 Merge pull request #3823 from mono/fix-btls-managed
[System] Don't build managed BTLS code on monotouch
2016-10-25 22:29:23 +02:00
Alexander Köplinger 3c26e4e5b9 [bcl] Only build Mono.Btls.Interface and btls tool when BTLS is enabled 2016-10-25 21:26:49 +02:00
Alexander Köplinger db21455da9 [System] Don't build managed BTLS code on monotouch
After 2fb07d6c6d BTLS can be used as a shared lib,
but this caused an issue in some monotouch tools which grepped the P/Invokes for `__Internal`
since these icalls wouldn't resolve on monotouch since BTLS is disabled there.

Instead, we now completely leave out building the managed parts of BTLS when
BTLS is not enabled.
2016-10-25 18:44:33 +02:00
Niklas Therning 416b600657 Fix compilation errors in mono/utils/os-event-win32.c with Mingw/GCC (#3818)
This was introduced in 92be5357d1. The patch
also adds the os-event-win32.c file to the libmonoutils Visual Studio project.
2016-10-25 10:49:50 -04:00
Martin Baulig f5f641ff85 [BTLS]: Fix a ref-counting leak in X509ChainImplBtls. Fixes #45687. (#3811)
* [BTLS]: Fix a ref-counting leak in X509ChainImplBtls.  Fixes #45687.

* Set 'untrusted = null' in Dispose().

(cherry picked from commit c9a67ffc5a)
2016-10-25 15:42:38 +02:00
Marek Safar 95b0698304 [System] Clean up some warnings 2016-10-25 14:28:35 +02:00
Marek Safar 69e4db8a1a [runtime] Ignore bit 14 in typedef export table during verification. It seems to be used by some WinRT predefined types 2016-10-25 12:52:43 +02:00
Alexander Köplinger 493d0aaaa0 Merge pull request #3817 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-25 11:58:06 +02:00
Swaroop Sridhar 3cadcb4d7a MonoLinker: Fix a Typo in the README (#3816) 2016-10-25 01:33:25 -04:00
monojenkins c32705dda3 [msvc] Update csproj files 2016-10-25 04:51:24 +00:00
Marek Safar 118e75023a Merge pull request #3812 from rolfbjarne/watchos-no-cfnetwork
[System] Remove any CFNetwork usage from the watchOS profile. Fixes #45847.
2016-10-24 23:27:39 +02:00
Alexander Köplinger c444c68c9c Merge pull request #3815 from microMolvi/patch-1
caspol.1: fix minor grammatical errors
2016-10-24 23:20:48 +02:00
Zoltan Varga 17e29bc3a2 [x86] Clear the fp stack when exceptions are thrown. Fixes #45841. (#3814) 2016-10-24 16:42:52 -04:00
Abdur Rehman 3a63a287b6 caspol.1: fix minor grammatical errors 2016-10-25 00:15:03 +05:00
Zoltan Varga 5937f444dd [runtime] Fix an assert message. 2016-10-24 14:58:14 -04:00
Rolf Bjarne Kvinge 4b8fc544b0 [System] Remove any CFNetwork usage from the watchOS profile. Fixes #45847.
The MacProxy class uses CFNetwork, but since CFNetwork is not a public
framework on watchOS, we can't use it.

So remove MacProxy completely (it only contains internal classes), and throw
PlatformNotSupportedException in any API that used it (the managed networking
stack is not supported on watchOS anyway, so this should be safe).

https://bugzilla.xamarin.com/show_bug.cgi?id=45847
2016-10-24 20:06:06 +02:00
Ludovic Henry 92be5357d1 [runtime] Add MonoOSEvent 2016-10-24 13:27:03 -04:00
Miguel de Icaza 1fb083d2d4 Make mkbundle use SDKs instead of a single runtime for cross compilation
Make mkbundle use SDKs instead of a single runtime for cross compilation
2016-10-24 11:47:31 -05:00
Aleksey Kliger abe2e95f4e [tests] Missing custom attr on an assembly should not crash mono. 2016-10-24 12:11:07 -04:00
Alexander Köplinger 932ae6cca2 Merge pull request #3801 from akoeplinger/netstandard20-updates
[bcl] Move a few types from the Facades into the framework for netstandard20 compatibility
2016-10-24 16:36:49 +02:00
Johan Lorensson 1de9d6fd55 Merge pull request #3810 from lateralusX/jlorenss/add_missing_assert_include
Explicit include of assert.h.
2016-10-24 16:09:59 +02:00
lateralusX 15213acb7b Explicit include of assert.h. 2016-10-24 15:39:55 +02:00
Alexander Köplinger 1a4e480cca [configure.ac] Only disable -Wno-zero-length-array on clang
The $GCC variable in autoconf will be yes for clang as well [1].

[1] https://lists.gnu.org/archive/html/autoconf/2014-09/msg00023.html
2016-10-24 15:17:54 +02:00
Johan Lorensson 59ddb222e0 Merge pull request #3442 from lateralusX/jlorenss/win-atexit-commands
Add support on Windows to install atexit handler(s) early in bootprocess.
2016-10-24 11:53:15 +02:00
Alexander Köplinger c5ebdef6d4 Merge pull request #3808 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-22 14:23:00 +02:00
Miguel de Icaza 6d37ffdf53 [mono] Add some strong types for a few variables, document some methods (#3777) 2016-10-22 00:36:34 -04:00
monojenkins b3aa48281e [msvc] Update csproj files 2016-10-22 04:28:22 +00:00
Zoltan Varga 2fb07d6c6d [btls] Convert BTLS icalls to pinvokes by invoking them using [DllImp… (#3799)
* [btls] Convert BTLS icalls to pinvokes by invoking them using [DllImport("__Internal")], which will make it easier to redirect them to a separate dylib in the future.

* [btls] Add a --enable-dynamic-btls configure flag to enable compiling btls into a separate shared library instead of embedding it into the runtime.
2016-10-21 17:29:13 -04:00
Andi McClure 20acd5895c There's a G_BREAKPOINT in mini-exceptions.c which could be hit during user execution. This will not be caught by our normal crash reporter, so we should use g_error here instead. (#3791) 2016-10-21 17:28:59 -04:00
Zoltan Varga 27d0ef18f0 [runtime] Fix the native-to-managed marshalling of null blittable arrays. Fixes #45788. 2016-10-21 16:51:01 -04:00
Alexander Köplinger adcc481705 [bcl] Move a few types from the Facades into the framework for netstandard20 compatibility
See https://github.com/dotnet/standard/pull/76.

Also moved IncrementalHash from System.Core.dll to mscorlib.dll as per discussion with Wes.
2016-10-21 22:19:13 +02:00
Aleksey Kliger 9fea3a346a [tests] Re-enable reference-loader.exe test
This reverts commit c08acd2eb4.
2016-10-21 10:30:55 -04:00
Alexis Christoforides fe0a7e6d8c WIP 2016-10-21 10:30:48 -04:00
Aleksey Kliger e10780c24d [loader] Set image assembly before reference attribute assembly check.
In mono_assembly_load_from_full, the call to
mono_assembly_has_reference_assembly_attribute has to come after
image->assembly is set.  This is because image->assembly->base_dir is
used for probing for referenced assemblies, and the reference assembly
attribute check will probe for assemblies referenced by the custom
attributes on the assembly in image being loaded.
2016-10-21 10:30:35 -04:00
Aleksey Kliger ac720981eb [loader] Write fully-qualified field names in mono_field_resolve_type errors. 2016-10-21 10:30:35 -04:00
Aleksey Kliger 7945233379 [custom_attrs] Don't return NULL if a single custom attr is missing.
Add 'ignore_missing' argument to mono_custom_attrs_from_index_checked:
if it is TRUE, a single custom attribute constructor that can't be
resolved to a MonoMethod won't cause the whole method to return NULL.
if 'ignore_missing' is FALSE, use existing behavior.

Updated all the call sites to pass FALSE, except
mono_custom_attrs_from_assembly_checked which also gets a new
'ignore_missing' arg.

Updated 'mono_assembly_has_reference_assembly_attribute to pass TRUE for
ignore_missing.
2016-10-21 10:30:35 -04:00
Alexis Christoforides 4ec89fe356 Bump bockbuild 2016-10-21 10:12:51 -04:00
Alexis Christoforides e55526556d More fixes for the Release ('Xamarin') profile 2016-10-21 09:46:14 -04:00
Alexis Christoforides b92c2208b9 Fixes for the 'xamarin' profile.
Re-renamed profile (now 'MacSDK') to remove hyphen which was prohibiting Python module importing
2016-10-21 09:46:14 -04:00
Alexander Köplinger c08acd2eb4 [tests] Disable reference-loader.exe test for now
The code it's supposed to test was temporarily disabled in 1bf9409629
2016-10-21 13:24:27 +02:00
TautvydasZilys 6d7e40dd90 Changes in class libraries to enable Windows Runtime event support using Mono's mscorlib (#3778)
* Use Windows Runtime event related classes from Reference Source and implement couple missing methods needed for Windows Runtime event suppor

* Add native stubs for newly added icalls.

* Attempt to fix build on non-windows

* Attempt to fix mscorlib build when COM is disabled.

* Revert "Attempt to fix mscorlib build when COM is disabled."

This reverts commit 5befc13b5ee7283fc4f19bd706389496c139790f.

* System.Type::IsWindowsRuntimeObjectProperty is under "FEATURE_COMINTEROP || MONO_COM", so its callers should be under it too.

* Fix build failure due to a semantic merge conflict with b313769878
2016-10-21 13:04:49 +02:00
Niklas Therning 634ab61415 Fix crash in SafePipeHandle.ReleaseHandle() on Windows (#3797)
The ReleaseHandle() methods tries to deallocate the handle as if it was a
pointer to heap memory. But on Windows it's a HANDLE. The call to
Marshal.FreeHGlobal() causes a crash on Windows. It doesn't crash on other
platforms probably due to the emulated handles which are indeed heap allocated
memory objects. But the underlying file descriptor is never closed so there
should be a file descriptor leak on other platforms.

This patch fixes the issue by calling MonoIO.Close() on the handle rather than
Marshal.FreeHGlobal()
2016-10-20 20:52:38 -05:00
Vincent Povirk 1bee4aa4e5 Use lower-case names for Windows headers.
Mingw on Linux is case-sensitive and requires this.
2016-10-20 16:36:18 -05:00
Aleksey Kliger 1bf9409629 [loader] Disable mono_assembly_has_reference_assembly_attribute
It relies on mono_custom_attrs_from_assembly_checked which is not
sufficiently robust to missing assemblies when trying to look for custom
attributes.
2016-10-20 13:51:55 -04:00
Martin Baulig 00f252d01f [System]: Distinguish between empty hostnames and no hostnames for certificate validation.
SecPolicyCreateSSL() distinguishes between an empty string (validation will fail
if the certificate contains host name constraints) and a null pointer (no host name
checking will be performed) for the hostname.

We incorrectly used `string.IsNullOrEmpty (host)` in a few places.
2016-10-20 18:51:03 +02:00
Martin Baulig 7fdd730928 [System]: ChainValidationHelper: always set 'status11' on error. 2016-10-20 18:49:12 +02:00
Martin Baulig 9a073a2929 [boringssl]: Merge latest chromium-stable branch from Google. 2016-10-20 18:48:04 +02:00
Aleksey Kliger (λgeek) 86e44dfdcb Merge pull request #3786 from lambdageek/dev-42584-take2
Check for ReferenceAssemblyAttribute when loading for execution
2016-10-20 11:33:15 -04:00
Miguel de Icaza b313769878 Utf8 (#3776)
* UTF8 Marshaling APIs  (#3736)

Adds support for the new UTF8 marshaling functionality in .NET, there
is support for the new MarshalAs(UnmanagedType.LPUTF8St) as well as a
handful of convenience methods in Marshal.cs

In Mono, this is mostly a pass-through as we have historically only
done UTF8, so this merely adds the constant processing to the runtime.

This fixes a few bugs that the new test suite exhibited: when we
marshaled UTF8 strings, we assumed Chars() == Bytes() and we would end
up chopping when marshaling out, and marshaling in.

There is also an additional behavioral bug that was fixed in
Marshal.cs, unlike the rest of the runtime that treated Ansi as Utf8,
StringToCoTaskMemAnsi behaved as ascii. This brings the API in line
with the rest of the runtime.

The equivalent CoreCLR changes were:

dotnet/coreclr#4793
dotnet/coreclr#6561

This has also surfaced two limitations in Mono's marshaling code,
which is why two sets of tests are disabled: StringBuilder return
types are not handled specially (char * needs to be turned into a new
StringBuilder when present) and StringBuilders with an Out attribute
should update the StringBuilder in place, not make a new copy of it.
2016-10-20 08:19:09 -05:00
lateralusX bdbea3589f Add support on Windows to install atexit handler(s) early in application’s startup.
This is done by adding a new argument to install specific named custom handlers,
--handlers=. There is also an argument to describe the supported handlers on current
platform, --help-handlers.

The supported handlers can be different depending on implementing platform and currently
only Windows uses this feature to install an atexit handler waiting for a keypress
before exiting process. This is however a generic concept that could be used to run handler
code early in the boot process on any platform for other purposes. Adding the argument first
in command line makes it possible to do the installation very early in the boot process, this
is used by the waitkeypress atexit handler in order to be used in cases where the arguments
itself are unsupported or incorrect formatted causing an exit of the process.

When running under Visual Studio debugger the console window will not be kept
open when the debugee process terminates. Normally this is not a problem, but there are scenarios,
especially when having errors in configuration, when you would like the console to be kept open so
you can read the output in order to detect the error.

Normally there is an option to start the console application from within Visual Studio but
not attaching the debugger (CTRL+F5) and by default Visual Studio will then inject a pause
in the execution of the process holding up the console, but for some reasons, having more
complex solutions like mono, this feature stops working, so it is not possible to keep the console
open in that scenario for more complex solutions.

This makes it a little problematic to hold the process when working within the debugger in order
to look for console output and errors. Since mono can exit the process using exit command and not
only by returning from main, the developer needs to set breakpoints on both end of main and in c-runtime
exit methods. Even if that is a possible workaround this option won't work when running the process outside
the debugger (CTRL+F5).

This commit adds a handler argument that can be used on Windows (potential on other platforms as well), atexit-waitkeypress.
The waitkeypress will hold the console and process open until a key is pressed and is very
useful when running and debugging mono from within Visual Studio. Example of output when running mono’s mono-mini-regression-test
with an assembly not found together with –handlers=atexit-waitkeypress command line argument:

failed to load assembly: gshared-nofound.exe
Overall results: tests: 0, 100% pass, opt combinations: 25
Press any key to continue . . .

Currently this is only implemented for Windows, but could be enabled for other platforms,
if similar need exist elsewhere.

Since this is a standard mono command line option it is possible to inject it using the MONO_ENV_OPTIONS environment variable as well.
2016-10-20 12:49:09 +02:00
Zoltan Varga 7d40fd72f6 [runtime] Fix the calculation of the instance size of ptr/var types. (#3790) 2016-10-19 19:29:55 -04:00
Alexander Köplinger b21eb06676 Merge pull request #3787 from AsamK/fix_listview
[MWF] Fix two issues in ListView
2016-10-19 15:30:39 +02:00
Ludovic Henry 1156be7b08 [hybrid-aot] Fix GSharedVT support (#3783)
* [aot-compiler] Cleanup GSharedVT check

* [aot-compiler] Enable partial sharing for hybrid AOT

* [aot] Enable GSharedVT for Android

* [aot] Ensure GSharedVT is supported at runtime as well as compile time

* [aot] Factor aot mode setting
2016-10-19 09:14:59 -04:00
Alexander Köplinger 66fb48c6a5 Merge pull request #3789 from monojenkins/update-csprojs
[msvc] Update csproj files
2016-10-19 13:05:55 +02:00
monojenkins 919824ddd4 [msvc] Update csproj files 2016-10-19 10:17:15 +00:00
Alexis Christoforides a9f06407b2 [bockbuild] Moved Gtk+ files back to main bockbuild repo 2016-10-18 19:19:16 -04:00
Sebastian f9e1c5a686 Add unit tests for ListView bugs 2016-10-19 00:05:23 +02:00
Alexander Köplinger 57d111577f [tools] Fix casing of sqlsharp
The directory is lowercase on disk.
2016-10-18 20:54:37 +02:00
Aleksey Kliger f7bcbec775 [runtime] Check for ReferenceAssemblyAttribute when loading for execution.
An assembly with a System.Runtime.CompilerServices.ReferenceAssemblyAttribute
may be loaded in a reflection-only context, but not for execution.

When loading assembly refs, or when loading assemblies by name (as
opposed to file path), a reference assembly will be skipped over and
other assemblies from the GAC and the load path will be tried.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42584
2016-10-18 14:48:25 -04:00
Aleksey Kliger 9d789e0d70 [loader] Tests for RefereceAssemblyAttribute support
This reverts commit 8612b548ee.

Which itself reverted commit 31de4df835.
2016-10-18 14:48:25 -04:00
Aleksey Kliger d7b886c173 [runtime] Let mono_custom_attrs_has_attr ignore malformed attributes 2016-10-18 14:48:25 -04:00
Aleksey Kliger bf09936e17 [runtime] Don't build temporary array in mono_custom_attrs_get_attr_checked
Just return the first matching attribute as soon as it's found, don't
build a temporary array and then index into it.
2016-10-18 14:48:25 -04:00
Aleksey Kliger 4e38dbf66b [runtime] Mark mono_custom_attrs_get_attr external only
Runtime should use mono_custom_attrs_get_attr_checked.
2016-10-18 14:48:25 -04:00
Aleksey Kliger b7943a94e6 [runtime] Add assembly name to message in FileNotFoundException
when using mono_error_set_assembly_load_simple ()
2016-10-18 14:48:25 -04:00
Sebastian 59f78905ff Fix ArgumentOutOfRangeException exception when removing a not focused item
The code in RemoveAt doesn't update the focused item index, if the focused
item is the last item in the list and another item is removed.
The next time an item is removed, the focused item index is equal to Count
and an ArgumentOutOfRangeException is thrown.
2016-10-18 20:19:45 +02:00
Sebastian b7c10f90f4 Fix IndexOutOfBounds exception, when removing and adding an item to another list
Removing a selected item from one ListView and adding the same item to
another ListView, an IndexOutOfBounds exception was thrown, if the second
ListView has fewer elements than the first one. That's because the
DisplayIndex still contained the index from the first ListView.
2016-10-18 20:14:50 +02:00
Alexander Köplinger b73b0f5351 Bump boringssl submodule 2016-10-18 19:32:52 +02:00
Marek Safar 658d82d87a Fixes System build 2016-10-18 17:20:30 +02:00
Marek Safar 7f06a0910e [System] Implements Socket::ConnectAsync. Fixes #44406 2016-10-18 17:14:59 +02:00
Marek Safar 09f75f011c [mcs] Add new test 2016-10-18 17:14:59 +02:00
Alexander Köplinger 7b2dcdae0d [ci] Add option to not run tests via CI_TAGS 2016-10-18 16:00:49 +02:00
Marek Safar 03356aba0a Merge pull request #3780 from akoeplinger/mcs-error-constant-invariant
[mcs] Use InvariantCulture for GetValueAsLiteral() in constant.cs
2016-10-18 14:58:46 +02:00
Marek Safar e863f9c25e Bump cecil to get recent fixes 2016-10-18 14:09:43 +02:00
Marek Safar 804794a9a9 Merge pull request #3781 from grendello/networkinfo
With Android 7.0 (Nougat) it is no longer possible to read some
2016-10-17 23:30:34 +02:00
Zoltan Varga 1998314ee2 [runtime] Fix a regression introduced by 1be62d5e2a (field loading rewrite). Static field offsets were overwritten with 0 if the mono_class_setup_fields () function was called in parallel. 2016-10-17 17:19:44 -04:00
Alexis Christoforides 92f94eed83 Fix 'mono' package typo 2016-10-17 16:41:34 -04:00
Marek Habersack c439b67887 With Android 7.0 (Nougat) it is no longer possible to read some
information about network interfaces from the /sys filesystem. Google
placed restrictions on two files used by the Mono BCL to read
information about the interface:

      /sys/class/net/[DEVICE]/flags
      /sys/class/net/[DEVICE]/operstate

The information we used to read from `flags` let us determine whether
the interface supports multicast and the `operstate` file provided us
with detailed information on the current device state.

Additionally, it is now impossible to read the hardware MAC address used
by any interface. This bit of information is also unavailable when using
the Java APIs and therefore applications running on devices with API
24 (and possibly newer) will not be able to access this information.

More details about the issue are available from the upstream Android
bug:

      https://code.google.com/p/android/issues/detail?id=205565

In order to obtain the required information, we now need to use the Java
APIs on devices with API 24+ and this commit implements the backend to
retrieve this information. It is done in C in order to avoid overhead of
creating mirror .NET objects when calling Java, thus saving time and
memory during an operation which may be performed by some applications
quite frequently.

This patch implements code that calls into the Xamarin.Android
runtime when runnin under API24 or newer to obtain the information.

Part of fix for https://bugzilla.xamarin.com/show_bug.cgi?id=44296
2016-10-17 22:29:49 +02:00
Alexander Köplinger 51245ed862 [mcs] Use InvariantCulture for GetValueAsLiteral() in constant.cs
Without it mcs would've printed the following error for code like `const int val = 1.42f`
on a system where the decimal separator is not the dot, e.g. German:

```
test.cs(3,18): error CS0031: Constant value `1,42' cannot be converted to a `int'
```
2016-10-17 19:15:00 +02:00
Alexander Köplinger 297c25787b Merge pull request #3779 from akoeplinger/fix-aot-only-reference
[mini] Fix mention of --aot-only option, it no longer exists
2016-10-17 17:56:03 +02:00
Lluis Sanchez 0701399a88 Implement some missing methods in RSACryptoServiceProvider
(cherry picked from commit d4e09f5c35)
2016-10-17 17:47:40 +02:00
Lluis Sanchez a92792300b Implemented System.Security.Cryptography.X509Certificates.RSACertificateExtensions
(cherry picked from commit 04a376b2ab)
2016-10-17 17:47:34 +02:00
Alexander Köplinger 524d79758a [mini] Fix mention of --aot-only option, it no longer exists
It was replaced with --full-aot in ba99fd8334,
but there were still two places left that talked about the old option which leads to confusion.

Also updated the link to Xamarin docs to the current URL.
2016-10-17 17:18:43 +02:00
Alexander Köplinger 03ea8b5a62 [build] Regenerate .csproj files
Note: DISABLE_CAS_USE was removed in ed989a8e9e
2016-10-17 16:34:16 +02:00
Marek Safar c143e55c45 [System] More Socket methods from referencesource 2016-10-17 15:04:39 +02:00
Zoltan Varga 1be62d5e2a [WP] [runtime] Rewrite field loading and layout (#3722)
* [runtime] Improve the locking in mono_class_setup_basic_field_info ().

Compute all the required information outside the lock and install it inside the lock. Remove mono_class_setup_basic_field_info_locking () function which is no longer needed.

* [runtime] Move the special case of no fields from mono_class_setup_fields () to mono_class_layout_fields ().

* [runtime] Move the computation of klass->blittable and klass->element_class/cast_class for enums to mono_class_layout_fields () so it can be used for dynamic types as well.

* [runtime] Make typebuilder_setup_fields () initilize the same data as mono_class_setup_fields ().

* [runtime] Move more common code into mono_class_layout_fields () from mono_class_setup_fields () and typebuilder_setup_fields ().

* [runtime] Avoid infinite recursion in mono_class_setup_fields () by storing the classes under initialization in a TLS list instead of using the racy klass->setup_fields_called flag.

* [runtime] Reduce the amount of locking in mono_class_setup_fields () to the call to mono_class_layout_fields (). Remove mono_class_setup_fields_locking ().

* [runtime] Remove a special case for no fields from mono_class_layout_fields (), the normal code can handle it.

* [runtime] Reorganize mono_class_layout_fields () so it makes all modifications to the MonoClass instance in one place.

* [runtime] Reduce the amounrt of locking in mono_class_layout_fields ().

* [runtime] Remove some compiler context code.
2016-10-16 00:35:16 -04:00
Alexis Christoforides bb8b635634 Bump bockbuild 2016-10-15 19:51:20 -04:00
Alexander Köplinger 056d58cf04 [corlib] Don't emit symbol information in ModuleBuilderTest.GetType()
It doesn't work on Android and the test doesn't need it.
2016-10-15 03:13:59 +02:00
Alexis Christoforides 48878c2420 Cleanup 2016-10-14 19:11:53 -04:00
Alexis Christoforides 7d44a1affe Removed autotools from the shipped distribution 2016-10-14 19:11:30 -04:00
Alexis Christoforides 8cddd4eaaa Bump bockbuild 2016-10-14 19:10:39 -04:00
Alexander Köplinger dcf4ddd097 [System] Fix expected default value in test for ServicePointManager.ConnectionLimit on XA
The default was aligned with XI on https://github.com/mono/mono/commit/d06354174070d01394f5e75ffcfc9c1110a1e7db
2016-10-15 01:09:10 +02:00
Alex Rønne Petersen f729626e72 Merge pull request #3775 from alexrp/main-thread-name
[runtime] Don't change the native name of the main thread.
2016-10-14 23:16:15 +02:00
Miguel de Icaza fb2908ef74 Revert "UTF8, with build fixed"
This reverts commit 50d119be5d.
2016-10-14 14:39:22 -04:00
Alexis Christoforides 7a0d4bc105 Added missing gdk-pixbuf patches 2016-10-14 14:37:21 -04:00
Miguel de Icaza 2ab2feb43f Revert "Revert "UTF8 Marshaling APIs (#3736)""
This reverts commit 2a01bde545a47e287977637a4a08f8f965ca45dc.t push
:
2016-10-14 14:36:42 -04:00
Miguel de Icaza 50d119be5d UTF8, with build fixed 2016-10-14 14:35:46 -04:00
Miguel de Icaza 2a01bde545 Revert "UTF8 Marshaling APIs (#3736)"
This reverts commit 4056e80006.
2016-10-14 14:26:40 -04:00
Miguel de Icaza 4056e80006 UTF8 Marshaling APIs (#3736)
Adds support for the new UTF8 marshaling functionality in .NET, there is support for the new MarshalAs(UnmanagedType.LPUTF8St) as well as a handful of convenience methods in Marshal.cs

In Mono, this is mostly a pass-through as we have historically only done
UTF8, so this merely adds the constant processing to the runtime.

This fixes a few bugs that the new test suite exhibited: when we marshaled UTF8 strings, we assumed Chars() == Bytes() and we would end up chopping when marshaling out, and marshaling in.

There is also an additional behavioral bug that was fixed in Marshal.cs, unlike the rest of the runtime that treated Ansi as Utf8, StringToCoTaskMemAnsi behaved as ascii. This brings the API in line with the rest of the runtime.

The equivalent CoreCLR changes were:

dotnet/coreclr#4793
dotnet/coreclr#6561

This has also surfaced two limitations in Mono's marshaling code, which is why two sets of tests are disabled: StringBuilder return types are not handled specially (char * needs to be turned into a new StringBuilder when present) and StringBuilders with an Out attribute should update the StringBuilder in place, not make a new copy of it.
2016-10-14 14:23:23 -04:00
Alex Rønne Petersen 99a678e72e [runtime] Don't change the native name of the main thread.
This makes it hard to differentiate multiple Mono processes in `top`.

We still report the name of the main thread as "Main" to the profiler.
2016-10-14 18:18:57 +02:00
Marek Safar fbc8e9daaf [System.ServiceModel] Hide only relevant exceptions in TcpChannelListener.cs 2016-10-14 16:24:21 +02:00
Marek Safar d70b715a96 [System] Use mono specific payload type for EndAccept of TCPListener 2016-10-14 16:24:21 +02:00
Alexander Köplinger a1af439223 Merge pull request #3763 from akoeplinger/move-type
[System.ServiceModel] Move a few types into System.IdentityModel
2016-10-14 16:17:39 +02:00
Niklas Therning 429eb3bb96 Merge pull request #3771 from henricm/enable-system-tests-on-windows
Enable System tests for PR builds on Windows
2016-10-14 14:29:31 +02:00
Henric Müller 081610e669 Enable System tests for PR builds on Windows 2016-10-14 10:09:25 +02:00
Alexis Christoforides 99a23f1200 Transfer the Mac SDK bockbuild profiles & resources inside the Mono repository.
This includes all distributable packages,patches etc. Toolchain packages remain part of the bockbuild repository.

The profiles were also renamed:
'mono-mac-release' -> 'mac-sdk'
'mono-mac-xamarin' -> 'mac-sdk-xamarin'
2016-10-14 03:48:28 -04:00
Alexis Christoforides 608f7c89b2 Added Bockbuild as a submodule 2016-10-14 03:48:28 -04:00
Marek Safar d19e5c42a5 [System.Xml] Update supported time formats for mobile version of XML deserializer. Fixes #42843 2016-10-14 09:10:17 +02:00
Marek Safar 398675d21a [System.Xml] Enable more tests 2016-10-14 09:10:17 +02:00
Henric Müller 20c72671c1 Merge pull request #3756 from henricm/named-pipe-alertable-on-windows
Making named pipe connects alertable on Windows
2016-10-14 08:48:39 +02:00
Vlad Brezae 0b65fb9d99 Merge pull request #3766 from BrzVlad/feature-default-conc
[sgen] Switch to default concurrent on desktop
2016-10-14 01:35:49 +03:00
Jon Purdy 72362aefea [sgen] Fix verify-before-allocs.
sgen_check_whole_heap_stw() calls sgen_stop_world(), which assumes the
GC lock is held.
2016-10-13 14:06:25 -07:00
Rodrigo Kumpera d0fb7a1240 Merge pull request #3761 from kumpera/fix-maccore-linking-regression
[icalls] Change get_bundled_machine_config to ICALL_EXPORT so maccore can link it.
2016-10-13 14:24:48 -04:00
Rodrigo Kumpera 85c73568b0 Merge pull request #3716 from vargaz/unbox-stobj-null
[jit] Add a small optimization for unbox.any+stobj called with a null…
2016-10-13 14:00:58 -04:00
Marek Safar 4d3402deed [System] SocketAsyncEventArgs::Dispose does not free any managed resources. Fixes #44757 2016-10-13 16:44:39 +02:00
Bernhard Urban a342bb00ca Merge pull request #3591 from directhex/mono_libdir_fallback
Handle relocatable libMonoPosixHelper.so when --libdir= isn't lib/
2016-10-13 16:39:38 +02:00
Martin Baulig 5109914276 [System]: Move MonoBtlsProvider.IsSupported() -> MonoTlsProviderFactory.IsBtlsSupported() (#3760)
* [System]: Move MonoBtlsProvider.IsSupported() -> MonoTlsProviderFactory.IsBtlsSupported().

Move the intern-call which is used to determine whether we're using BTLS out of MonoBtlsProvider
to allow the managed linker to eliminate the Mono.Btls.* classes when it's not supported.

* Fix Android build.

(cherry picked from commit 90699022b6)
2016-10-13 16:27:08 +02:00
Vlad Brezae 2b08b7c451 [tests] Select sgen major explicitly in tests
On configurations where we were only testing serial (using the default collector), we now explicitly test concurrent to put emphasis on it.
2016-10-13 17:06:59 +03:00
Vlad Brezae 74d6305ac7 [sgen] Enable concurrent gc by default on desktop
Linux (except android), MacOS and Windows.
2016-10-13 16:53:02 +03:00
Alexander Köplinger 213499eb63 Merge pull request #3762 from akoeplinger/fix-ftp-ipv6
[System] Add IPv6 support to FtpWebRequest
2016-10-13 13:48:40 +02:00
Johan Lorensson f458d55ec2 Merge pull request #3738 from lateralusX/jlorenss/win-api-family-support-libmonoruntime
Build libmonoruntime under none desktop Windows API family.
2016-10-13 12:47:29 +02:00
lateralusX 058f4dc12b Build libmonoruntime under none desktop Windows API family.
Initial work to build libmonoruntime under none desktop Windows API families.
2016-10-13 09:41:12 +02:00
Rodrigo Kumpera 1c7fa71a4a [icalls] Multiple fixes to get_bundled_machine_config.
Enviroment::get_bundled_machine_config icall should be ves_icall_System_Environment_get_bundled_machine_config.

Mark all icalls doing get_bundled_machine_config as ICALL_EXPORT so maccore can link them in/out.
2016-10-12 15:30:11 -07:00
Alexander Köplinger 34f6aab87e [System.ServiceModel] Move a few types into System.IdentityModel
They were moved there in MS.NET 4.5. Added typeforwards so existing references continue to work.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=35662
2016-10-12 23:20:57 +02:00
Rodrigo Kumpera b40bfda0e2 Merge pull request #3755 from kumpera/async-reader-hardering-2
[System] Another round of hardening around disposal of Process while doing async reads.
2016-10-12 12:46:46 -04:00
Alexander Köplinger d91796e39c [System] Add tests for IPv6-enabled FtpWebRequest 2016-10-12 18:43:47 +02:00
Alexander Köplinger aebed51257 [System] Add IPv6 support to FtpWebRequest
When connecting to an FTP server we weren't handling the RFC2428
extension to the FTP protocol which allows connections over IPv6
for the data channel.

We'd try to connect via IPv4 and the server would return an error
saying that this protocol is not supported.

The fix is to add handling for the protocol extension, namely
to use EPSV (for passive FTP) or EPRT (for active FTP) when opening
the data channel and send/parse the IPv6 addresses.

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

Note: we're now using the IP address of the the control channel we connected to for the
data channel instead of the address that is returned by the server in the FTP response message.
The reason is that for EPSV there's no IP returned by the server, and it should be
more reliable for normal PASV as well since the server might not know the
correct external address. This is also what MS does in referencesource.
2016-10-12 18:43:46 +02:00
Marek Safar b57f33ba97 [mcs] Handle interpolated strings with escaped quotes. Fixes #45286 2016-10-12 17:31:47 +02:00
Alexander Köplinger 26f23dbde3 [System] Make sure FtpWebRequest processing happens in a background thread
We don't want it to block app shutdown.
2016-10-12 16:16:29 +02:00
Marek Safar 224985a156 Bump ikvm for mcs fixes 2016-10-12 15:51:49 +02:00
Henric Müller bcbe894d3d Enable System.Runtime.Remoting tests on Windows 2016-10-12 15:18:08 +02:00
Henric Müller 0aed701c96 Making named pipe connects alertable on Windows
This fix makes sure that an aborted thread will wake up
a blocking named pipe connect.
2016-10-12 15:07:04 +02:00
Marek Safar 77541d8c1f Merge pull request #3754 from marek-safar/rs-sockets
[System] More Socket types from referencesource
2016-10-12 14:53:16 +02:00
Marek Safar 095701df57 [Mono.Data.Sqlite] Regression introduced by 04162ffbbd which changed _datetimeFormats order. Fixes #40603 2016-10-12 12:06:30 +02:00
Marek Safar eb76ec5782 [Mono.Data.Sqlite] Enable more tests 2016-10-12 12:06:30 +02:00
Vlad Brezae c866c3eefb Merge pull request #3749 from BrzVlad/fix-mips-fix
[mips] Fix mips
2016-10-12 11:56:10 +03:00
Niklas Therning 6271985201 Merge pull request #3753 from henricm/enable-windowsbase-tests-on-windows
Enable WinowsBase tests on Windows
2016-10-12 10:40:09 +02:00
Marek Safar 092279ecd6 [System] Warnings cleanup 2016-10-12 10:19:18 +02:00
Marek Safar c79b08d83c [System] More Socket types from referencesource 2016-10-12 10:14:03 +02:00
Marek Safar e95a1d4a00 Merge pull request #3750 from marek-safar/socket
[System] More Socket pieces from referencesource
2016-10-12 10:09:18 +02:00
Vlad Brezae 95fd910972 [mips] Disable div with mul on 32bit mips 2016-10-12 00:19:48 +03:00
Zoltan Varga 6332448df8 [llvm] Avoid generating invalid IL for valuetypes+vphi+volatile variables in gsharedvt methods. Fixes part of #45270. 2016-10-11 16:04:00 -04:00
Alexander Köplinger 2fdbce718b [corlib] Fix UdpClient tests on watchos
They were reenabled in 1fa85ad4af,
but UdpClient throws PlatformNotSupportedException on watchos.
2016-10-11 21:25:50 +02:00
Rodrigo Kumpera a5fc1343a3 Merge pull request #3715 from kumpera/fix-44707
[corlib] Don't load the machine config file if it's missing. Fixes #44707
2016-10-11 14:31:04 -04:00
Rodrigo Kumpera 879d682775 [System] Another round of hardening around disposal of Process while doing async reads.
This round ensures stream and decoder are protected from dispose and that we properly
bail out to the EOS case.
2016-10-11 11:25:51 -07:00
Martin Baulig fe2dedafba [cert-sync]: Change back to using the '--btls' argument.
Without arguments, 'cert-sync' now operates on the old certificate store
again, like it was before.  To test BTLS, you need to explicitly run it
with '--btls'.

(cherry picked from commit 46379bda6d)
2016-10-11 18:14:51 +02:00
Alexander Köplinger f7b73f070a Merge pull request #3745 from akoeplinger/fix-bug44937
[io-layer] Correctly detect a PE32+ assembly as managed when starting process
2016-10-11 17:28:08 +02:00
Marek Safar 2ed3257a23 [System.ServiceModel] Split unreliable tests 2016-10-11 16:56:16 +02:00
Marek Safar bb0a415101 [System] Set more error details on failed https proxy connect. Fixes #45108 2016-10-11 16:45:22 +02:00
Marek Safar 34fd8d0ff7 [mono] Fixes hardcoded stack limit in EnsureSufficientExecutionStack check 2016-10-11 16:34:14 +02:00
Marek Safar de10cef32c [System] More Socket pieces from referencesource 2016-10-11 15:45:53 +02:00
Henric Müller cdf9d5103b Enable WinowsBase tests on Windows 2016-10-11 14:37:14 +02:00
Henric Müller b1e7cf18a9 Merge pull request #3662 from henricm/fix-windowsbase-on-win
WindowsBase zlib, ZipSharp and Package fixes for Windows
2016-10-11 14:02:10 +02:00
Henric Müller fd76523f6a Making sure stream is closed when exception is thrown
Stream will never be closed if we throw exception in Open
which leads to file being locked in Windows and that we
leak file handles.
2016-10-11 13:25:48 +02:00
Henric Müller 6676f790a8 Setting Culture to en-us for ToStringTest 2016-10-11 13:25:29 +02:00
Henric Müller fe5fceab9c Make ZipSharp work on Windows
This patch adds the zlib functions needed by ZipSharp to the VS
MonoPosixHelper.def export file.

This patch also changes the ZipSharp code to use different code paths
depending on the size of the C long type on the underlying platform. On
gcc/clang the C long type follows the bitness of the targeted architecture,
it's 32-bit on 32-bit systems and 64-bit on 64-bit systems. With the VS
compiler however, the C long type is always 32-bit regardless of the target
architecture. zlib and minizip uses C long in a number of different function
signatures and structs.
2016-10-11 13:09:15 +02:00
Alexander Köplinger 0f3d08adfb Merge pull request #3746 from ntherning/fix-SocketResponder-on-windows
Fix SocketResponder on Windows
2016-10-11 12:22:37 +02:00
Marek Safar 528e5d2ef4 Merge pull request #3747 from marek-safar/updclient
UpdClient from referencesource
2016-10-11 11:23:58 +02:00
Vlad Brezae ea0e95eec1 [mips] Add missing define 2016-10-10 23:27:52 +03:00
Vlad Brezae bd25dd17d8 [mips] Don't assert when decomposing longs
There is no point in asserting if we encounter an unhandled long op. These ops may still get removed, if emulated later on, or maybe from other passes. Asserting happens as a last resort when emitting the native code for the method.
2016-10-10 23:20:15 +03:00
Alexander Köplinger dac829dbe9 [corlib] Add missing constructors to RNGCryptoServiceProvider on monotouch
Those were missed in cb46f78eef because there's a separate
implementation for monotouch in an unrelated file.
2016-10-10 20:13:55 +02:00
Martin Baulig 83aa0a6f39 [System]: Fix a typo in X500DistinguishedName.AreEqual().
(cherry picked from commit 1ac809aad7)
2016-10-10 18:30:39 +02:00
Alexander Köplinger 8d1a65128a [btls] Use UTC for the Unix epoch in the managed BTLS code (#3702)
The epoch is specified as being in UTC, but the DateTime(int, int, int) constructor
creates a DateTime with an 'Unspecified' timezone, which could lead to problems later on.
2016-10-10 18:03:39 +02:00
Martin Baulig bc8582c84d [BTLS]: Correctly handle certificates with negative serial numbers. (#3719)
In mono_btls_x509_get_serial_number(), first call i2c_ASN1_INTEGER()
which takes care of padding and computing the 2s complement for negative
numbers, then reverse the buffer.
(cherry picked from commit 1a55680bfa)
2016-10-10 18:03:00 +02:00
Marek Safar e0be7efd61 [System.Core] Remove unused files 2016-10-10 17:39:33 +02:00
Niklas Therning 9e4a4ff90e Fix SocketResponder on Windows
There seems to be a race in some tests in the System test suite that use
SocketResponder on Windows. Some tests fail with an exception that the socket
has been closed before they get a chance to see the response sent by the
SocketResponder. The same happens occasionally when using SocketResponder on
.NET. This patch changes the order of the Socket.Shutdown() calls and adds a
Socket.Receive() before Shutdown() is called to give the sender a chance to
actually send any data before the responder shuts down and closes its side of
the connection.
2016-10-10 17:06:43 +02:00
Marek Safar 1fa85ad4af [System] Enable more tests 2016-10-10 17:04:31 +02:00
Marek Safar 97901a252d [System] UdpClient from referencesource 2016-10-10 16:52:03 +02:00
Marek Safar 54900936b6 [System.Data] Use same socket family for data receiver as it has its client. Fixes #44624 2016-10-10 16:25:17 +02:00
Vlad Brezae 38f607b059 Merge pull request #3740 from Unity-Technologies/gc-options-command-line
GC debug and params command line options
2016-10-10 16:43:54 +03:00
Alexander Köplinger 68bcbb4b77 [io-layer] Correctly detect a PE32+ assembly as managed when starting process
We weren't checking whether a PE file is in PE32 or PE32+ format,
causing us to use the PE32 offsets on the newer format as well.

This means that using Process.Start() on a managed assembly didn't
always work when a PE32+ file was in play. Such a file is created
when targeting x64 e.g. via the -platform:x64 csc.exe/mcs option.

The reason why we probably didn't notice until now is that in an
assembly produced by mcs there happens to be some data at the PE32
CLR header offset even in a PE32+ file, causing the check to "work".

This doesn't apply to csc.exe/roslyn though and so we couldn't
execute those assemblies via Process.Start() even though they're
perfectly managed. Since the .NET Core project.json toolchain
produces x64-targeted assemblies by default more people ran into
the issue trying to run those on Mono: https://github.com/cake-build/cake/issues/1247

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

PE/COFF spec at https://msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx
2016-10-10 14:00:07 +02:00
Alexander Köplinger 7ca51073c6 Merge pull request #3739 from akoeplinger/add-more-netstandard-api
[bcl] Expose a few more APIs on mobile to match with netstandard
2016-10-10 13:39:06 +02:00
Alexander Köplinger cb46f78eef [bcl] Expose a few more APIs on mobile to match with netstandard
See https://github.com/dotnet/standard/issues/47.
2016-10-10 13:35:33 +02:00
Niklas Therning 082057e3d7 Merge pull request #3653 from ntherning/alertable-socket-wait
Make blocking socket calls on Windows interruptible
2016-10-10 13:30:31 +02:00
Niklas Therning 50d7cf0daf Merge pull request #3744 from ntherning/enable-system-security-tests-in-pr-builds-on-windows
Enable System.Security tests in PR builds on Windows
2016-10-10 13:20:35 +02:00
Niklas Therning 46a3201f93 Enable System.Security tests in PR builds on Windows 2016-10-10 10:27:41 +02:00
Alex Rønne Petersen 044afdad5c Merge pull request #3742 from alexrp/profiler-c9-fixes
[profiler] Start the helper thread before the writer thread.
2016-10-08 13:23:10 +02:00
Alex Rønne Petersen 2ab8d8b692 [profiler] Start the helper thread before the writer thread.
This fixes a regression introduced in 0db428169a
which caused the profiler to not report the correct command port in the file
header on startup.
2016-10-08 11:55:31 +02:00
Zoltan Varga 9a3f1672d2 [SRE] Set the wastypebuilder flag on completed generic param builder … (#3712)
* [SRE] Set the wastypebuilder flag on completed generic param builder classes to remove a workaround from mono_type_get_object_checked ().

* [SRE] Remove unused verify_safe_for_managed_space () function.
2016-10-07 20:43:04 -04:00
Zoltan Varga c47a2991f9 [llvm] Make sure the initlocals_bb is not treated as part of a try block if one starts at IL offset 0, since it could mess up the control flow if it contains calls. (#3718) 2016-10-07 20:42:32 -04:00
Alexander Köplinger a201b2ac42 Merge pull request #3741 from akoeplinger/fix-aot-DoAssemblyResolve
[aot] Fix AppDomain.DoAssemblyResolve runtime invoke wrapper
2016-10-08 00:17:22 +02:00
Alexander Köplinger efd8c822c2 [aot] Fix AppDomain.DoAssemblyResolve runtime invoke wrapper
In https://github.com/mono/mono/pull/1528 the DoAssemblyResolve method was changed
from two parameters to three, but the code in aot-compiler.c was not updated to match.
2016-10-07 22:06:22 +02:00
Jonathan Chambers d602c64c2c Document --gc-debug and --gc-params command line options 2016-10-07 13:54:00 -04:00
Jonathan Chambers 3f234cb6ad Add --gc-params and --gc-debug command line options 2016-10-07 13:31:58 -04:00
Aleksey Kliger (λgeek) e1b0a37135 Merge pull request #3731 from lambdageek/dev-handles-gbmc
[runtime] System.Configuration.InternalConfigurationHost:get_bundled_machine_config  needs HANDLES
2016-10-07 13:13:44 -04:00
Niklas Therning 906bad4382 Merge pull request #3729 from ntherning/fix-failures-in-msbuild-tests-on-windows
Fix failures in MSBuild tests on Windows
2016-10-07 19:08:01 +02:00
Zoltan Varga 7de083be0b [runtime] Fix the blittable flag and the instance size for pointer types. Fixes #45131. (#3735) 2016-10-07 11:37:19 -04:00
Alexander Köplinger 8f181779a7 Merge pull request #3737 from akoeplinger/fix-babysitter
[ci] Set the env var in a new subshell to fix babysitter processing
2016-10-07 15:30:19 +02:00
Niklas Therning 149c4509f1 Fix failures in MSBuild tests on Windows 2016-10-07 15:29:04 +02:00
Marek Safar d3c8ea0191 Merge pull request #3727 from henricm/fix-system-web-on-windows
Fixes for System.Web to work on windows
2016-10-07 15:03:34 +02:00
Henric Müller 08367f0476 Enabling System.Web tests on Windows 2016-10-07 14:45:11 +02:00
Niklas Therning 53af53ae59 Make blocking socket calls on Windows interruptible
This second commit adds functions to socket-io.c which uses
WSAEventSelect()/WSAWaitForMultipleEvents() or overlapped I/O to make
potentielly blocking socket calls interruptible (alertable).
2016-10-07 14:30:28 +02:00
Henric Müller 33263bd790 Calling directly into Win API to get current process exe
On Windows the MonoToolsLocator tries to determine which mono.exe
to use by looking at the current process. Due to problems with
AppDomains and shadow copying (which happens in System.Web) we
could not use this approach. Instead we now call GetModuleFileName
directly using p-invoke to get the exe file of the running process.
This is only used when running on Windows.
2016-10-07 14:23:23 +02:00
Marek Safar 65162fe034 [System] Use default parsing rules for Uri.IsWellFormedUriString. Fixes #45129 2016-10-07 13:56:29 +02:00
Niklas Therning b612056c4e Make blocking socket calls on Windows interruptible
This first commit changes the signatures of the icalls for blocking socket
calls in Socket to propagate whether the socket call should block or not. This
is required since it's not possible on Windows through any native API to
determine whether a socket is in blocking or non-blocking mode.

This commit also adds the necessary RegisterForBlockingSyscall() guards to the
Socket.SendFile_internal() method which takes a WSABUF array. Without this
calls to this method won't be signaled when the Socket is closed.

This commit also fixes the error handling in the Socket.SendFile() method to
not rely on WSAGetLastError(). It's likely to have been overwritten between
when the error is generated and the WSAGetLastError() call from managed code.
2016-10-07 11:45:04 +02:00
Alexander Köplinger d622c39b89 [ci] Set the env var in a new subshell to fix babysitter processing
Setting the MONO_TLS_PROVIDER env var in the testing script makes it opaque to the
babysitter and other processing scripts. By setting it in a new subshell we can
ensure that the scripts see the whole invocation.
2016-10-07 11:08:15 +02:00
Rodrigo Kumpera ff4bc7c445 Merge pull request #3730 from kumpera/async-reader-dispose-hardening
[System] Add some hardening when disposing a AsyncStreamReader as it will have things happening concurrently.
2016-10-06 18:53:15 -04:00
Rodrigo Kumpera bd61765189 [corlib] RemotingConfiguration now try to use the bundled machine.config first. 2016-10-06 15:04:48 -07:00
Aleksey Kliger (λgeek) a4c8184708 Merge pull request #3660 from lambdageek/bug-42271
[coop] Switch to GC SAFE for backtrace() and backtrace_symbols()
2016-10-06 17:53:33 -04:00
Aleksey Kliger 636ba50ff7 [runtime] give get_bundled_machine_config ves_icall_Class_Method-style names 2016-10-06 16:58:46 -04:00
Aleksey Kliger 4315e43278 [runtime] System.Configuration.InternalConfigurationHost:get_bundled_machine_config
needs HANDLES

The method (which also goes by
System.Configuration.DefaultConfig:get_bundled_machine_config) was
converted to use coop handles earlier, but we missed this declaration.
2016-10-06 16:35:55 -04:00
Rodrigo Kumpera ddfb6bab08 [System] Add some hardening when disposing a AsyncStreamReader as it will have things happening concurrently. 2016-10-06 13:19:59 -07:00
Zoltan Varga cb17a4f8fd [SRE] Fixup the tokens in subtypes too. (#3721) 2016-10-06 16:12:23 -04:00
Niklas Therning 67f9c76caa Merge pull request #3725 from ntherning/fix-symbolicate-tests-stack-trace-diff-on-windows
Fix symbolicate tests stack trace diff on Windows
2016-10-06 20:04:32 +02:00
Aleksey Kliger c033a02e8a [mempool] Fix indentation in mono_backtrace () 2016-10-06 13:54:40 -04:00
Aleksey Kliger b1e13dd3c9 [coop] Switch to GC SAFE for backtrace() and backtrace_symbols()
Fixes [#42271](https://bugzilla.xamarin.com/show_bug.cgi?id=42271)
2016-10-06 13:54:39 -04:00
Marek Safar 0a515cf13b [corlib] Add ValueTuple 2016-10-06 17:52:23 +02:00
Niklas Therning c467c938dd Fix symbolicate tests stack trace diff on Windows
The symbolicate tests compare stack traces generated by the mono-symbolicate
tool against expected stack traces. The expected stack trace files have been
preprocessed to remove absolute paths and the Makefile does the same with the
output from the tool. However, the preprocessing doesn't take different
directory separator characters into account. This patch adds a 'tr' command to
the Makefile which converts \ -> / before the absolute paths are filtered out
from the actual output from the tool to make the comparison succeed on Windows
as well.
2016-10-06 14:22:49 +02:00
Henric Müller 629da62c52 Ignoring CR in WebControls tests 2016-10-06 11:20:28 +02:00
Johan Lorensson 390697c8b2 Merge pull request #3707 from lateralusX/jlorenss/win-api-family-support-libmonoutils
Build libmonoutils under none desktop Windows API family.
2016-10-06 09:07:41 +02:00
Niklas Therning 5022f7de41 Merge pull request #3720 from ntherning/fix-monodoc-tests-on-windows
Fix monodoc tests on Windows
2016-10-06 08:40:30 +02:00
Zoltan Varga 6ead72475f Fix a typo. 2016-10-05 17:59:29 -04:00
Rodrigo Kumpera 57d37f690e Merge pull request #3714 from kumpera/fix_process_stream_dispose
[System] Fix Process::Dispose resource leak due to RS import.
2016-10-05 14:54:41 -07:00
Rodrigo Kumpera 67d44f8ebf [System] Dispose all streams in Process::Close if they were not exposed to the user. Fixes a RS import regression.
RS takes the stance that redirected streams should not be closed by the Process class because they might
be referenced from the outside.

That would be ok if it was true. If you use Process::BeginOutputReadLine, the output stream becomes inaccessible
with no way to dispose them by any mean but GC.Collect. You get an exception when accessing Process::StandardOutput
once async reading starts.

This change addresses the case where the streams are not accessible. This is tracked by the *StreamReadMode variables
that are set on stream getters or Begin*ReadLine.
2016-10-05 14:51:01 -07:00
Zoltan Varga 69045343ca [jit] Use MONO_INS_IS_PCONST_NULL () macro in more places. 2016-10-05 12:22:33 -04:00
Marek Safar 73e95c3863 [System.Net.Http] Wrap certain exceptions into HttpRequestException. Fixes #44978 2016-10-05 17:56:56 +02:00
Aleksey Kliger (λgeek) 6dd95a6fdf Merge pull request #3684 from lambdageek/dev-monoerror-poolbox
[runtime] Use boxed MonoError for class failure.
2016-10-05 11:09:49 -04:00
Niklas Therning 8fcad5b4bd Fix monodoc tests on Windows
These tests are sensitive to differences in line endings between Windows and
other platforms. This patch changes the diff commands used on Windows to
ignore changes in whitespaces at end of lines.
2016-10-05 16:40:43 +02:00
Johan Lorensson e09aab25bd Merge pull request #3692 from lateralusX/jlorenss/win-api-family-support-libmono
Build libmono under none desktop Windows API family.
2016-10-05 16:10:10 +02:00
Marek Safar 7ddb079a47 [mcs] Don't report version mismatch error for FX assemblies 2016-10-05 15:02:44 +02:00
Alexander Köplinger 7d8ef14d5b Merge pull request #3709 from rolfbjarne/linker-mark-nested-types
[linker] We need to mark nested types even if the declaring type isn't marked.
2016-10-05 13:51:00 +02:00
Alexander Köplinger a394a0e9b6 [ci] Test System.dll with both the legacy and btls TLS provider 2016-10-05 13:19:06 +02:00
Martin Baulig dd03bb0abe [BTLS]: Certificate cleanups and fixes. (#3706)
* [BTLS]: Allow fallback to MX.X509Certificate in X509CertificateImplBtls.

* [BTLS]: Fix X509Certificate2.MonoCertificate.

* X509Certificate2Impl.FallbackImpl: make abstract.

* X509Helper2.GetMonoCertificate(): new internal helper method.

* X509Certificate2.MonoCertificate: use X509Helper2.GetMonoCertificate().
  This is only used by X509ChainImplMono; we should investigate whether we
  could implement the missing APIs in BTLS.

* [BTLS]: Fully implement X509CertificateImplBtls.Import() and use correct semantics.

.NET's X509Certificate2.Import() uses several implicit fallbacks which we previously
did not handle in BTLS.

* you may provide a (unused) password when importing an unencrypted PKCS#8.

* when using null as password, it will attempt to use string.Empty if importing
  without password fails.

* [BTLS]: Implement X509CertificateImplBtls.PrivateKey.

* [BTLS]: Implement X509CertificateImplBtls.Export().

* [BTLS]: Implement X509CertificateImplBtls.Verify().

* [BTLS]: Fix X500DistinguishedName quoting.

* MonoBtlsUtils: don't quote special chars in UTF-16 strings.

* X500DistinguishedName: don't decode raw data when passed in a name.

* [ci] Test System.dll with both the legacy and btls TLS provider

* [ci] Only run the additional btls System.dll test run on OSX for now

Otherwise we might run it on platforms where btls isn't supported yet and get errors.

(cherry picked from commit 9638ee9ece)
2016-10-05 13:07:21 +02:00
Marek Safar f2e0fc3f7f [System.Net.Htpp] Add test for large content range headers 2016-10-05 10:18:09 +02:00
Cinerar fe6fb22691 Nowdays Content-Range From could be much more than 2147483647 2016-10-05 10:16:14 +02:00
Zoltan Varga 952a8d634d [jit] Add a small optimization for unbox.any+stobj called with a null on the stack. 2016-10-04 23:51:58 -04:00
Rodrigo Kumpera 10aae2da45 [corlib] Don't load the machine config file if it's missing. Fixes #44707 2016-10-04 18:16:23 -07:00
Vlad Brezae d6f7d6199c Merge pull request #3705 from BrzVlad/fix-sgen-internal-alloc
[sgen] Fix block size computation for allocation size
2016-10-05 03:30:26 +03:00
Alexander Köplinger ead4213eaf Merge pull request #3697 from directhex/fix-make-dist-missing-basic.exe
When basic.exe isn't in DISTFILES, it gets excluded from `make dist`
2016-10-05 01:23:36 +02:00
Alexander Köplinger 7af506b0c3 Merge pull request #3711 from akoeplinger/fix-fullaot-tests
Fix two test failures in the FullAOT Jenkins job
2016-10-05 00:55:07 +02:00
Rodrigo Kumpera d60084ccdc [runtime] Don't do logging from a signal handler. It's not signal safe.
I found this while trying to MONO_LOG_LEVEL=debug an process way bug and the removed log statements
would hang mono in a matter of seconds.
2016-10-04 15:53:36 -07:00
Aleksey Kliger 3a9e18e540 [MonoError] Don't overwrite computed TypeLoadException message with empty string
Fixes [#44729](https://bugzilla.xamarin.com/show_bug.cgi?id=44729).
2016-10-04 17:24:05 -04:00
Aleksey Kliger 0a73f4eef4 [loader] Add descriptive error messages to class failure.
In cases where a class fails to load due to a related class failure,
extract the message from the related failure.
2016-10-04 17:08:15 -04:00
Aleksey Kliger e77ba5ed3d [runtime] Change how class failure is represented.
Use a single bit MonoClass::has_failure to represent whether a class has
failed.  Store detailed error message in MONO_CLASS_PROP_EXCEPTION_DATA property
in the MonoImage of the class.
2016-10-04 17:08:12 -04:00
Alexander Köplinger ff8af9c12b Fix two test failures in the FullAOT Jenkins job
Disable WebOperationsContextTest.Current like on monotouch, it relies on dynamic code generation.
The namedmutex-destroy-race.cs runtime test doesn't work on mobile_static since we don't have named Mutexes.
2016-10-04 22:25:42 +02:00
Alexander Köplinger 844b800098 Add mono-package-runtime to EXTRA_DIST
The file was added in 15b6ef60e4
2016-10-04 20:25:53 +02:00
Marek Safar a5971ec78c [corlib] Enable more RuntimeHelpers tests 2016-10-04 18:53:51 +02:00
Rolf Bjarne Kvinge 2d5815183c [linker] We don't need to mark nested types more than once. 2016-10-04 18:52:26 +02:00
Alexander Köplinger f16c0866a8 Merge pull request #3693 from rolfbjarne/watchos-simplify-http-message-handler-selection
[System.Net.Http] Simplify default http message handler for watchOS since there's only one valid value.
2016-10-04 18:39:18 +02:00
Alexander Köplinger 9ca4e133ed Merge pull request #3704 from rolfbjarne/watchos-servicepointmanager
[System] Add back a few ServicePointManager properties that can be used by multiple networking stacks.
2016-10-04 18:35:48 +02:00
Rolf Bjarne Kvinge 35cbe54378 [linker] We need to mark nested types even if the declaring type isn't marked. 2016-10-04 18:16:53 +02:00
Aleksey Kliger 016b3b9a06 [loader] Make mono_class_get_failure static in class.c 2016-10-04 11:21:53 -04:00
Aleksey Kliger 5fbda1ee6e [loader] Add mono_class_set_type_load_failure ()
- Hide mono_class_set_failure as a static function in class.c
- Use a MonoErrorBoxed to represent a MONO_EXCEPTION_TYPE_LOAD.
2016-10-04 11:21:53 -04:00
Aleksey Kliger e45f8166ba [loader] Use MonoErrorBoxed for mono_class_set_failure (..., MONO_EXCEPTION_INVALID_PROGRAM, ...)
Use a MonoErrorBoxed to represent an invalid program class failure.
2016-10-04 11:21:53 -04:00
Aleksey Kliger 6c86e9794d [MonoError] add mono_error_vset_type_load_class function
A variant of mono_error_set_type_load_class that takes a va_list
argument instead of varargs.
2016-10-04 11:21:53 -04:00
Aleksey Kliger 1392837288 [MonoError] Add MonoErrorBoxed for mempool-stored errors.
The usual MonoError is suitable as a short-lived stack-allocated error
with a lifetime confined to a function call.
Internally it performs allocations using g_malloc/g_free.

The MonoErrorBoxed is a mempool-allocated error whose lifetime is tied
to the lifetime of a MonoImage.

We provide two operations:

1. MonoErrorBoxed* mono_error_box (MonoError *ierror, MonoImage *image);

  Creates a new boxed error in the given mempool from MonoError.
  It does not alter ierror, so you still have to clean it up with
  mono_error_cleanup or mono_error_convert_to_exception or another such function.

2.   gboolean mono_error_set_from_boxed (MonoError *oerror, MonoErrorBoxed *from_box);

  Sets the error condition in the oerror from the contents of the given
  boxed error.  Does not alter the boxed error, so it can be used in a
  future call to mono_error_set_from_boxed as needed.  The oerror
  should've been previously initialized with mono_error_init, as usual.
2016-10-04 11:21:53 -04:00
Vlad Brezae 5a13c41a36 [sgen] Fix block size computation for allocation size
The block size for a slot size is the minimum block size that can fit two slots. Make sure the computation accounts for the fact that even though a slot size might fit twice in the block, it still has to be allocated at aligned addresses, so it can end up using a higher block size.

Fixes 44922.
2016-10-04 18:18:49 +03:00
Aleksey Kliger (λgeek) 633af27d68 Merge pull request #3686 from lambdageek/dev-format-printf
Add MONO_ATTR_FORMAT_PRINTF macro
2016-10-04 10:05:33 -04:00
lateralusX 72a43d3355 Build libmono under none desktop Windows API family.
Initial work to build libmono under none desktop Windows API families.
2016-10-04 15:36:00 +02:00
lateralusX 5233231e65 Build libmonoutils under none desktop Windows API family.
Initial work to build libmonoutils under none desktop Windows API families.
2016-10-04 14:45:43 +02:00
Jo Shields 6843f6d61d Add EXTRA_DIST listing all the files from btls
Apparently there's no way to get CMake to just spit out its own uncached variables, so we can't do this programatically.
2016-10-04 12:27:01 +01:00
Jo Shields 503b18e07f Remove useless BTLS_DEPS variable 2016-10-04 10:48:07 +01:00
Rolf Bjarne Kvinge e41db94cb1 [System] Add back a few ServicePointManager properties that can be used by multiple networking stacks. 2016-10-04 11:13:11 +02:00
Niklas Therning 1e7e96e941 Merge pull request #3695 from ludovic-henry/fix-thread-test
[tests] Fix p/invoke test on windows
2016-10-04 10:35:14 +02:00
Zoltan Varga a6ea12ab4c [sdb] Avoid adding the first file name in the debug info to the list of file names if a method has no seq points. Fixes #44982. (#3696) 2016-10-03 23:10:31 -04:00
Alex Rønne Petersen 95117516f7 Merge pull request #3700 from alexrp/profiler-c9-fixes
[profiler] Fix a regression that caused all buffers to have a zero thread ID.
2016-10-04 04:58:37 +02:00
Alex Rønne Petersen 4a2dc82a42 [profiler] Use macro constants instead of passing a bunch of bools. 2016-10-04 04:28:26 +02:00
Alex Rønne Petersen 00754f933c [profiler] Update a stale comment. 2016-10-04 04:07:27 +02:00
Alex Rønne Petersen a5f75c0462 [profiler] Add some asserts. 2016-10-04 04:07:26 +02:00
Alex Rønne Petersen 5a5875bac0 [profiler] Simplify send_log_unsafe (). 2016-10-04 04:07:25 +02:00
Alex Rønne Petersen a081b99c55 [profiler] Fix a regression that caused all buffers to have a zero thread ID.
This was introduced in 928b840dad.
2016-10-04 04:07:18 +02:00
Zoltan Varga 4df80bc164 [SRE] Remove more dead code. 2016-10-03 22:00:31 -04:00
Zoltan Varga 0c11be9585 [SRE] Remove more unused icall declarations. 2016-10-03 21:17:25 -04:00
Zoltan Varga cea0756ebe [SRE] Remove more unused icalls. 2016-10-03 20:45:42 -04:00
Alexander Köplinger 65c849b377 [btls] Add missing icall definition for mono_btls_x509_revoked_get_revocation_date 2016-10-04 02:39:01 +02:00
Zoltan Varga cf3c15b416 [SRE] Small code cleanup. 2016-10-03 20:16:10 -04:00
Zoltan Varga 7efe967c24 [SRE] Remove unused icall from inside a DISABLE_REFLECTION_EMIT block. 2016-10-03 19:33:55 -04:00
Alex Rønne Petersen a49db8f1c6 Merge pull request #3698 from alexrp/profiler-c9-fixes
More C9 profiler fixes
2016-10-04 00:12:34 +02:00
Zoltan Varga 30c55b9343 [SRE] Delay the creation of the MonoClass for dynamic types until CreateType () is called. Remove some icalls. (#3687) 2016-10-03 17:04:34 -04:00
Ludovic Henry 607278bf6b [tests] Fix thread-native-exit test on windows 2016-10-03 22:25:51 +02:00
Martin Baulig eb0d26e11f [metadata]: Unconditionally enable ves_icall_Mono_Btls_Provider_IsSupported().
The MonoBtlsProvider.IsSupported() icalls ves_icall_Mono_Btls_Provider_IsSupported()
needs to be available whether BTLS is available or not because it is used at
runtime to decide whether or not to enable BTLS.

(cherry picked from commit 7b2a96fbd3)
2016-10-03 22:04:56 +02:00
Alex Rønne Petersen d88f911a87 [profiler] Fix BYTE_SIZE macro conflict on OS X. 2016-10-03 22:02:46 +02:00
Alex Rønne Petersen 820faaee2d [profiler] Fix PROF_TLS_FREE () on pthread TLS systems. 2016-10-03 21:53:59 +02:00
Rodrigo Kumpera 2947739179 [profiler] Fix the build on Android (missing fcntl.h include). 2016-10-03 21:47:52 +02:00
Martin Baulig 7129235d3c Oops, actually correctly revert that commit.
(cherry picked from commit 04379d5d73)
2016-10-03 21:22:00 +02:00
Martin Baulig 0debd082cc [System]: Temporarily switch the default TLS provider back to "legacy".
Also revert the Jenkins commit in c462f4e603.

(cherry picked from commit cd1b0b8edf)
2016-10-03 21:16:09 +02:00
Jo Shields bfa1a309b9 When basic.exe isn't in DISTFILES, it gets excluded from make dist 2016-10-03 20:08:17 +01:00
Marek Safar 67a454ffab [Mono.Debugger.Soft] Move TypeLoadClass types to new file to improve testing 2016-10-03 18:36:54 +02:00
Rolf Bjarne Kvinge 0c6036bcdf [System.Net.Http] Simplify default http message handler for watchOS since there's only one valid value. 2016-10-03 18:22:12 +02:00
Alexander Köplinger 993f805cb7 [ci] Temporarily switch back to legacy TLS provider 2016-10-03 17:10:49 +02:00
Marek Safar 0034b230e8 [Mono.Debugger.Soft] Tweak ClassLocalReflection test 2016-10-03 16:10:57 +02:00
Niklas Therning 2107695a7a Merge pull request #3691 from ntherning/enable-tests-in-pr-builds-on-windows
Enable tests in Windows PR builds
2016-10-03 14:56:26 +02:00
Rolf Bjarne Kvinge 5780d872ad [System*] Throw a PlatformNotSupported exception when using the managed networking stack on watchOS. (#3683)
* [System.Data] System.Data.SqlClient is not supported in watchOS.

System.Data.SqlClient is not supported in watchOS, because it depends on a
working managed networking stack, which we don't have on watchOS.

* [System] Throw PlatformNotSupportedExceptions in the networking stack for watchOS.

* [System] Don't reference/build Mono.Security.dll when building for watchOS.

This means we can't build Mono.Data.Tds.dll either, since it uses
Mono.Security.dll extensively. In any case Mono.Data.Tds.dll is useless
without a working networking stack, and since it's a Mono-only dll (i.e. not
part of netstandard or facades), just remove the entire assembly from the
watchOS profile.

System.Security.dll uses Mono.Security.dll as well, but the required classes
are available inside mscorlib.dll (as internal classes), so just open up
mscorlib internals to System.Security.dll.

* [System] Update tests after API change for watchOS.

* [System.Data] Update tests after API change in watchOS.

* Revert "Fix build break from 81fb20737f810def6dde88d87a1b2f23cdb736c3"

This reverts commit f4475ff013.

* Fix missing trailing newline in monotouch_watch_System.dll.sources 

It breaks the build on Linux if the newline is missing.
2016-10-03 13:00:16 +02:00
Niklas Therning 72c700801d Enable tests in Windows PR builds
Also run the test suite in Windows PR builds. We disable all the test suites
in Windows PR builds that are known to fail.
2016-10-03 11:10:42 +02:00
Marek Safar 166830635e [System] Server property of HttpWebResponse should never be null 2016-10-03 09:38:23 +02:00
Alexander Köplinger aad01ff4db [btls] Fix i386 build on Linux by setting -arch on Darwin only
The -arch option is an Apple extension, it caused failures on i386 Linux: "unrecognized command line option '-arch'"
2016-10-03 00:33:15 +02:00
Alex Rønne Petersen 16e6b7770f Merge pull request #3689 from alexrp/profiler-c9-fixes
Profiler fixes for Cycle 9 (#2)
2016-10-02 21:59:26 +02:00
Alex Rønne Petersen fa4ea4cc55 [profiler] Fix GC finalize object end event not getting invoked. 2016-10-02 21:55:29 +02:00
Alex Rønne Petersen 00b1ceb8ff Revert "[domain] Report domain unloads to the profiler when finalizing the domain."
This reverts commit c8b2029080.

This caused ordering problems with app domain events: https://bugzilla.xamarin.com/show_bug.cgi?id=44552

Conflicts:

	mono/metadata/gc.c
2016-10-02 21:53:09 +02:00
Alex Rønne Petersen 30754eef7e Merge pull request #3688 from alexrp/profiler-c9-fixes
Profiler fixes for Cycle 9
2016-10-02 21:10:58 +02:00
Alex Rønne Petersen 958919f568 [profiler] Bump profiler version to v1.1. 2016-10-02 19:03:18 +02:00
Alex Rønne Petersen c42acf8bf2 [profiler] Don't emit enter/leave events in onlycoverage mode. 2016-10-02 19:03:09 +02:00
Alex Rønne Petersen 61d6684f27 [profiler] Add a nocounters option. 2016-10-02 18:56:27 +02:00
Alex Rønne Petersen cf076ebd1d [profiler] Address a couple of FIXMEs in the counters sampling code. 2016-10-02 18:56:17 +02:00
Alex Rønne Petersen d3ff7dca3e [profiler] Use eglib alloc/free functions everywhere. 2016-10-02 18:56:02 +02:00
Alex Rønne Petersen ffbf540457 [profiler] Warn if we can't detect the CPU count. 2016-10-02 18:55:50 +02:00
Alex Rønne Petersen 76c2b67207 [profiler] Use the native thread wrapper functions to manage threads. 2016-10-02 18:55:36 +02:00
Alex Rønne Petersen d78ba0e327 [utils/threads] Add and export a mono_native_thread_join () function. 2016-10-02 18:55:09 +02:00
Alex Rønne Petersen 7883db95e3 [utils/threads] Export all native thread functions. 2016-10-02 18:55:02 +02:00
Alex Rønne Petersen 36cb2ec977 [profiler] Access in_shutdown atomically. 2016-10-02 18:54:55 +02:00
Alex Rønne Petersen e998d8808f [profiler] Drop support for perf events on Linux. 2016-10-02 18:54:04 +02:00
Alex Rønne Petersen a6f95ab511 [utils/lfa] Add a missing #include to fix the profiler build. 2016-10-02 18:53:52 +02:00
Alex Rønne Petersen 3e9a0d4575 [profiler] Disable GC move events when allocation events are disabled.
They serve no purpose when allocation profiling is enabled, and just make log
files bigger than they have to be.
2016-10-02 18:53:36 +02:00
Alex Rønne Petersen b5205f797c [profiler] Clean up and improve the helper thread code.
* Don't invoke undefined behavior if an fd is >= FD_SETSIZE.
* Allow multiple command sockets.
* Close the command socket(s) on shutdown.
* Properly run cleanup logic on shutdown.
2016-10-02 18:53:20 +02:00
Alex Rønne Petersen 9127dfaf88 [profiler] Process requests in method_jitted (). 2016-10-02 18:53:00 +02:00
Alex Rønne Petersen a22f5779d2 [profiler] Remove the need to pass a MonoProfiler argument to some functions.
This is now available on the MonoProfilerThread structure.
2016-10-02 18:52:52 +02:00
Alex Rønne Petersen 1e4e265ba5 [profiler] Fix the way the profiler frees hazardous data on shutdown. 2016-10-02 18:52:08 +02:00
Alex Rønne Petersen 99af8b644b [profiler] Replace a check with an assert in coverage_filter (). 2016-10-02 18:51:36 +02:00
Alex Rønne Petersen 96f9415c5b [profiler] Add messages to most assertions. 2016-10-02 18:51:22 +02:00
Alex Rønne Petersen f9ad9d913c [profiler] Remove the ign_res () hack. 2016-10-02 18:51:08 +02:00
Alex Rønne Petersen 82f2c9bcca [profiler] Clean up the #include mess in mono-profiler-log.c.
Half of these aren't even needed - get rid of those. Sort the rest.
2016-10-02 18:51:00 +02:00
Alex Rønne Petersen b73e63c5dc [profiler] Remove mono_threads_attach_tools_thread () declaration.
We get this from mono-threads.h now.
2016-10-02 18:50:55 +02:00
Alex Rønne Petersen 9f7349c7c1 [profiler] Remove some broken, commented-out code from register_method_local (). 2016-10-02 18:50:48 +02:00
Alex Rønne Petersen 2a45034926 [profiler] assert () -> g_assert (). 2016-10-02 18:50:41 +02:00
Alex Rønne Petersen d4374ae1c3 [profiler] Always enable the helper thread.
We need it in all cases now that we use it to periodically flush all buffers.
The only platforms it was disabled on was NaCl, which we haven't bothered to
support in a while anyway.
2016-10-02 18:50:35 +02:00
Alex Rønne Petersen 99aa56a5b1 [profiler] Encapsulate some common logic in the ENTER_LOG/EXIT_LOG macros.
This also has the nice effect of reducing the amount of times we attempt to
take the reader lock. Now we take it and release it once for a single event.
2016-10-02 18:50:29 +02:00
Alex Rønne Petersen f802cbb584 [profiler] Add a missing deinit_thread () call to the helper thread. 2016-10-02 18:50:07 +02:00
Alex Rønne Petersen 51a03a7313 [profiler] Fix several race conditions in accessing MonoProfilerThread.buffer.
Only in very few situations is it okay to access this field without first
taking the reader lock or exclusive lock.

Fixes some crashes observed in the profiler stress tests.
2016-10-02 18:46:21 +02:00
Alex Rønne Petersen 4533cd91b2 [profiler] Don't flush empty log buffers. 2016-10-02 18:44:55 +02:00
Alex Rønne Petersen 348688ad75 [profiler] Add an extra assert. 2016-10-02 18:44:51 +02:00
Alex Rønne Petersen 4acc3dfeed [sgen] Always report object moves on the GC thread.
This avoids exposing the SGen worker threads through the profiler APIs. Doing
so had two main problems:

* It's easy for a user of the profiler API to accidentally mess with the state
  of the worker thread in all sorts of ways, which could break the GC.
* It's been a long-standing guarantee that any profiler API callback will be
  invoked on a thread that is, at the very least, attached to the runtime via
  the mono-threads infrastructure. This is not the case for SGen workers.

This fixes a deadlock in the log profiler when using major=marksweep-conc.
2016-10-02 18:44:41 +02:00
Alex Rønne Petersen bb1813cca6 [profiler] Rename decode.c to mprof-report.c. 2016-10-02 18:44:21 +02:00
Alex Rønne Petersen 5640531d0b [profiler] Rename proflog.{c,h} to mono-profiler-log.{c,h} for consistency with other profilers. 2016-10-02 18:44:12 +02:00
Alex Rønne Petersen f1c948536d [profiler] Remove utils.c/utils.h, move the code to proflog.c/decode.c, and clean it up.
* Drop support for fast/null timers.
* Use Mono runtime functions for getting the thread ID and allocating buffers.
2016-10-02 18:44:03 +02:00
Alex Rønne Petersen a2f06128c6 [acceptance-tests] Improve the profiler-stress test runner.
* Emit an NUnit test report file.
* Set a timeout of 6 hours per test.
* Do a thread dump for timed-out tests.
* Don't print stdout/stderr for passing tests.
2016-10-02 18:30:34 +02:00
Alex Rønne Petersen 77bf968f69 [ci] Bump the timeout of the profiler stress test suite to 24 hours. 2016-10-02 18:30:25 +02:00
Alex Rønne Petersen e9a95b9b3f [sgen] Remove bogus mono_profiler_events assert.
This variable can be changed at any time by any thread. It makes no sense to
assert that it has a particular flag.
2016-10-02 18:29:58 +02:00
Alex Rønne Petersen 39080bf5f0 [utils] Move MONO_DEPRECATED to mono-publib.h and make it imply MONO_API + MONO_RT_EXTERNAL_ONLY.
Also make it work with MSVC.
2016-10-02 18:29:15 +02:00
Alex Rønne Petersen c4f5bc9402 [profiler] Remove the long-obsolete hsmode option.
Also refactor the heap walk code a bit.
2016-10-02 18:28:24 +02:00
Alex Rønne Petersen 129560cb97 [profiler] Document and fix the onlycoverage option. 2016-10-02 18:28:04 +02:00
Alex Rønne Petersen 4199952108 [profiler] Remove the countersonly option.
It was never documented and is no longer functional.
2016-10-02 18:27:57 +02:00
Alex Rønne Petersen b9d7a08f26 [man] Update mprof-report.1 to indicate the correct default maxframes value. 2016-10-02 18:27:48 +02:00
Alex Rønne Petersen b334afdbd0 [profiler] Use the signal shutdown logic for the sampling thread for more cases. 2016-10-02 18:27:29 +02:00
Alex Rønne Petersen b6518ecfb8 [profiler] Remove some indirection in setting up GC events.
* mono_gc_enable_events: This did nothing for SGen and we called it
  unconditionally for Boehm. So no point in having it around.
* mono_gc_enable_alloc_events: The performance difference between checking
  a static alloc_events variable versus checking mono_profiler_events is
  marginal at best and doesn't justify the indirection, especially now that
  we support managed allocators while profiling.
2016-10-02 18:25:20 +02:00
Alex Rønne Petersen 46b3f65045 [profiler] Lift profiler limitation in mono_class_get_allocation_ftn ().
This has not actually been necessary since allocation reporting was moved into
the GC implementations.
2016-10-02 18:24:41 +02:00
Alex Rønne Petersen 03d6935654 [profiler] Don't leak counter data structures on shutdown. 2016-10-02 18:24:15 +02:00
Alex Rønne Petersen 0db428169a [profiler] Simplify counters initialization. 2016-10-02 18:24:04 +02:00
Alex Rønne Petersen d933617f69 [profiler] Don't emit a perf counters sample event if none are registered. 2016-10-02 18:23:49 +02:00
Alex Rønne Petersen ae0828fcee [profiler] Fix the code that synthesizes thread end events.
It could previously fail to process a newly allocated buffer.
2016-10-02 18:23:37 +02:00
Alex Rønne Petersen a91319333f [profiler] Add counters for all event types. 2016-10-02 18:23:28 +02:00
Alexander Köplinger 066372dc08 [metadata] Fix FullAOT build
The function was renamed in https://github.com/mono/mono/commit/a0ad8154f7cdca706802aa196d95686e0f8d3b7b#diff-9a532ce56888ac899468740a872fd7e0L1814, but this stub was missed.
2016-10-02 17:24:22 +02:00
Alexander Köplinger 1958bb8b34 [btls] Fix bashism in create-object-library.sh
Found by checkbashisms(1) as "unsafe echo with backslash". Some shells don't expand embedded \n in a string by default,
which broke the build on systems like ArchLinux or Alpine where /bin/sh points to those shells because the generated .lo
file contained just a single line instead of two.

Thanks to @JustArchi for researching this on the Mono Gitter channel, it made fixing the issue a lot easier!
2016-10-02 17:12:45 +02:00
Martin Baulig 8245417cb6 [System]: ChainValidationHelper: ignore port number when validating a certificate's host name.
(cherry picked from commit 4d28eb4b88)
(cherry picked from commit 7c88bf755e)
2016-10-01 21:34:01 +02:00
Martin Baulig ac9d969e40 [BTLS]: Ignore port number when validating certificates.
(cherry picked from commit baebc1d8c0)
2016-10-01 21:33:31 +02:00
Martin Baulig 7cbd69d8ea [BTLS]: Send server name extension on the client.
(cherry picked from commit 2602c52de4)
2016-10-01 21:33:22 +02:00
Alexander Köplinger f4475ff013 Fix build break from 81fb20737f
The HttpWebResponse stub that is used e.g. on the monotouch_watch profile was missing an overload that this commit was using.
2016-10-01 02:42:24 +02:00
Alexander Köplinger f057c1c071 [corlib] Fix a warning 2016-10-01 02:23:52 +02:00
Alexander Köplinger 186ab05987 Fix build break from efd53c8e2f
The new/renamed TypeBuilderInstantiation wasn't available with FULL_AOT_RUNTIME,
breaking the monotouch profile build.
2016-10-01 02:23:32 +02:00
Aleksey Kliger da859cdc93 [sgen] Fix printf-like format warnings 2016-09-30 18:54:19 -04:00
Aleksey Kliger 5ffa156af5 [runtime] Fix printf-like format warnings. 2016-09-30 18:54:17 -04:00
Aleksey Kliger d933c59c19 [runtime] Add MONO_ATTR_FORMAT_PRINTF macro
Expands to __attribute__((format(printf,X,Y))) with gcc and clang.

Use it to check that printf-like format strings get the correct number
and type of arguments.
2016-09-30 18:31:14 -04:00
Marek Safar 81fb20737f [System] Fill more WebException details when CONNECT fails. Fixes #19594 2016-10-01 00:11:23 +02:00
Zoltan Varga 6ddedbfc6d Bump corlib version for efd53c8e2f. 2016-09-30 17:27:46 -04:00
Martin Baulig 067d2f98c2 [scripts]: Add 'btls-cert-sync' script.
(cherry picked from commit 30fabaedd3)
2016-09-30 22:50:54 +02:00
Martin Baulig 1987e8217d [System]: Fix MonoTlsProviderFactory.TryDynamicLoad() logic.
If the MONO_TLS_PROVIDER environment variable is missing, use "default".

(cherry picked from commit 7002264dd2)
2016-09-30 22:47:14 +02:00
Zoltan Varga efd53c8e2f [SRE] Rename MonoGenericClass to TypeBuilderInstantiation to match MS. (#3679) 2016-09-30 13:45:30 -04:00
Zoltan Varga 44364e507d [runtime] Fix a warning. 2016-09-30 13:35:11 -04:00
Martin Baulig 069a1e4f78 [System]: Make BTLS the default TLS Provider on Desktop. 2016-09-30 17:36:50 +02:00
Martin Baulig ecdc3ef482 [cert-sync]: Make the new store the default and add '--legacy' for the old one. 2016-09-30 17:28:52 +02:00
Martin Baulig aa320774ed [BTLS]: Remove some debugging methods. 2016-09-30 17:11:09 +02:00
Alexander Köplinger e698a15af7 Merge pull request #3681 from rolfbjarne/fix-monotouch-build
[System] Fix monotouch* build.
2016-09-30 17:02:57 +02:00
Rolf Bjarne Kvinge 3870c7bab2 [System] Fix monotouch* build. 2016-09-30 16:28:00 +02:00
Martin Baulig 0b045d2b6e [System]: Enable AndroidPlatform.CertStoreLookup().
Uses reflection to call into AndroidEnvironment.CertStoreLookup()
(which as been added in https://github.com/xamarin/xamarin-android/pull/246).
2016-09-30 16:24:38 +02:00
Alexander Köplinger 2417bf1861 Bump boringssl to fix the build 2016-09-30 16:13:02 +02:00
Alexander Köplinger bd1d7650ec [btls] Only use cmake policies CMP0026/CMP0042 if cmake supports it
Some older cmake versions don't.
2016-09-30 15:57:45 +02:00
Martin Baulig f8c6505ad3 [System]: AndroidPlatform.CertStoreLookup(): add to the build, but return null.
This needs to have support added to xamarin-android before we can enable it.

(cherry picked from commit 9e46b5744b)
2016-09-30 15:18:03 +02:00
Alexander Köplinger 12db41477b Merge pull request #3676 from chamons/SignalHandlerAPI_XM45
Add Mono.Runtime to XM 4.5 profile
2016-09-30 14:56:38 +02:00
Martin Baulig 0f8f0c543c [BTLS]: Add managed BTLS sources.
* external/boringssl: unmanaged code from Google (added earlier).

* mono/btls: unmanaged BTLS lives here (added earlier).

* System/Mono.Btls: managed BTLS lives here.

* Mono.Btls.Interface: The purpose of this assembly is to allow test suites
  such as xamarin/web-tests to test parts of the BTLS APIs without making
  System.dll's internals visible.  It is not a stable and maintained API.
2016-09-30 14:07:26 +02:00
Martin Baulig fb93be4490 [Mono.Security]: Add the new certificate store.
BTLS uses a different format and naming scheme for the local certificate store.

Before using BTLS for the first time on desktop, you need to convert the local
certificate store by either using the new `btls-cert-sync` tool (which will convert
your existing certificate store to the new new format) or `cert-sync` with the
`--btls` argument.

The new format and naming scheme is identically to what you'll find in
'/system/etc/security/cacerts/' on an Android device.  It stores the certificates
in PEM format (with a human-readable text section added) using filenames which
are based on the certificate's subject name hash.

Previously, Mono stored the certificates in binary DER format, using a filename
based on either the Subject-Key-Identifier (if available) or the thumbprint.

We cannot access this from BTLS because computing these filenames requires
reading the entire X509 certificate (including the X509v3 extensions), but
their native lookup code only gives us the SubjectName.

This transitioning won't affect Android users as we're using the system
certificate store (including the user certificate store, via a Java callback).

* Mono.Security.X509.X509Store and X509Stores:
  Support both the old and the new format.  Using the new format requires BTLS.

* Mono.Security.X509.X509StoreManager:
  Add `NewCurrentUserPath` and `NewLocalMachinePath` properties for the
  new path names (~/.config/.mono/new-certs).

* Mono.Security.X509.X509StoreManager:
  Add `NewCurrentUser` and `NewLocalMachine` properties.  Requires BTLS.

* tools/security/cert-sync:
  Add new `--btls` argument to use the new store.
2016-09-30 13:38:44 +02:00
Martin Baulig 52b290680c [System]: Add AndroidPlatform.CertStoreLookup().
This is conditional to HAVE_BTLS and needs to have support added
to xamarin-android first.
2016-09-30 13:03:42 +02:00
Martin Baulig d88ce91459 [System]: New X509Helper2 APIs for BTLS.
The managed HAVE_BTLS conditionals will be removed once BTLS itself has landed.
2016-09-30 13:03:42 +02:00
Marek Safar f460c9bb83 [System.Core] Cleanup more warnings 2016-09-30 12:09:02 +02:00
Marek Safar 225ea9235f [System.Data] Cleanup warnings 2016-09-30 12:09:02 +02:00
Marek Safar aebd704d79 [System.Data] Implements SqlClient async readers. Fixes #44843 2016-09-30 12:09:02 +02:00
Martin Baulig c950be01ac [BTLS]: Add the native BTLS sources. 2016-09-30 11:46:46 +02:00
Johan Lorensson 03cf658591 Merge pull request #3663 from lateralusX/jlorenss/win-api-family-support-libgcmonosgen
Build libgcmonosgen under none desktop Windows API family.
2016-09-30 11:40:53 +02:00
lateralusX 3e6a602dd1 Build libgcmonosgen under none desktop Windows API family.
Initial work to build libgcmonosgen under none desktop Windows API families.
Changes are mainly related to header files included by libgcmonosgen sources and shared
by other libraries.
2016-09-30 08:48:00 +02:00
Zoltan Varga a0ad8154f7 Sre cleanup9 (#3661)
* [SRE] Assign pseudo tokens to SRE objects in the BCL instead of doing it in the runtime.

Real tokens are assigned after the dynamic types they depend on have been created, by creating the corresponding finished reflection object
(i.e. a MonoMethod for a MethodOnTypeBuilderInst etc.) and obtaining its token.
In Save mode, this is done in ModuleBuilder.Save ().
In Run mode, this is done on-demand when the JIT tries to resolve a token into its corresponding metadata object, by the runtime calling
the RuntimeResolve () method on the builder object.

* [SRE] Remove dead code.

* [SRE] Remove the MonoGenericMethod/MonoGenericCMethod classes, they have not needed.

* [SRE] Delay the creation of MonoClass-es for MonoGenericClass/GenericTypeParameterBuilder/SymbolType until its needed.

* [SRE] Small code cleanup.

* [SRE] Remove the TypeBuilder.IsGenericParameter () icall, it should return false.

* [SRE] Unify the calling of the various RuntimeResolve () methods by adding a RuntimeResolve () method to ModuleBuilder, and calling that from native code.

* [SRE] Remove unused TypeBuilder::get_event_info () icall.

* [SRE] Remove more unused/empty icalls.
2016-09-29 23:53:22 -04:00
Marius Ungureanu d252071247 [IO] Implement FileOptions.SequentialScan for Mac/BSD
The F_RDAHEAD define seems to be introduced in BSD, being the equivalent of POSIX_FADV_SEQUENTIAL.
This should improve sequential scanning speed by having the read ahead buffer doubled.
2016-09-30 02:34:14 +03:00
Martin Baulig 2d86893ee6 [Mono.Security]: Cleanup the MonoTlsProvider's certificate validation code. (#3674)
* [Mono.Security]: Remove Mono.Security.Interface.IMonoTlsContext.

This interface is not actually used anywhere anymore, so we can also
just get rid of it.

* [System]: Removed unused private TLS classes.

* [Mono.Security]: Cleanup the MonoTlsProvider's certificate validation code.

Each TLS Provider now has its own certificate validator and there is no
automatic fallback anymore.  We only have three different TLS Providers,
"legacy", "appletls" and "btls" - and legacy is the only one which used
the managed validator.  Both AppleTls and BTLS provider their own validator,
which invokes some native API.

All of the following were internal APIs.

* MonoTlsProvider.HasCustomSystemCertificateValidator has been removed.

* MonoTlsProvider.InvokeSystemCertificateValidator() has been renamed
  into ValidateCertificate() and is now abstract.

(cherry picked from commit 63c0803b2b)
2016-09-29 22:52:10 +02:00
Marek Safar 3e735a6171 [mcs] Branch visited labels cache for conditional block. Fixes #44751 2016-09-29 22:39:47 +02:00
Chris Hamons 0c64f16bcb Add Mono.Runtime to XM 4.5 profile
- Extends https://github.com/mono/mono/pull/3624
2016-09-29 14:53:32 -05:00
Miguel de Icaza f133e22342 [mkbundle] Add diagnostics, fix crash, fix registered path to match runtime name on embedded MonoImages (#3669) 2016-09-29 15:13:41 -04:00
Aleksey Kliger (λgeek) 41a25a6aab Merge pull request #3670 from lambdageek/dev/mempool-loader-error-msg
[loader] Store MONO_EXCEPTION_TYPE_LOAD error strings in mempools
2016-09-29 14:10:52 -04:00
Henric Müller d5c972a97b Comparing pid instead of handles in GetModules_internal (#3575)
Process handles can be different for same process id.
Therefore make sure we compare the process ids instead.
2016-09-29 11:19:43 -04:00
Niklas Therning f2896fe33f Merge pull request #3671 from rolfbjarne/pr-fix-system-tests
[System] Fix tests that regressed in e6536dd.
2016-09-29 13:25:07 +02:00
Johan Lorensson 6f7798530e Merge pull request #3664 from lateralusX/jlorenss/extern-test-driver-usage
Enable reuse of eglib native test framework and test driver source.
2016-09-29 12:08:31 +02:00
Rolf Bjarne Kvinge ad6f78afec [System] Fix tests that regressed in e6536dd.
* I got confused between [TestFixtureSetup] and [Setup], so fix tests whose
  [Setup] methods were changed/removed to properly clean up after each test
  (using a [TearDown] method) so that the next time the on-demand creation of
  objects works as expected (i.e. objects created in the [Setup] method should
  be created on-demand once for each method instead of once for each class).

* Also fix SocketAcceptAsyncTest, the change to properly catch exceptions on
  background threads was incorrect.
2016-09-29 12:01:49 +02:00
Ludovic Henry ae4b2d859a [threads] Assert that every thread is detached when exiting (#3620) 2016-09-29 08:49:35 +02:00
Miguel de Icaza 15b6ef60e4 [scripts] Add script to package the basic runtime to reuse by mkbundle 2016-09-28 22:32:18 -04:00
Martin Baulig f08c2659e7 [System]: Rename MonoLegacyTlsProvider into LegacyTlsProvider. (#3666)
LegacyTlsProvider now lives in the 'Mono.Net.Security' namespace
(previously 'Mono.Net.Security.Private') and derives directly from
the public 'Mono.Security.Interface.MonoTlsProvider'.

This allows it to be used by products, for instance replacing
xamarin-macios/src/Security/Tls/OldTlsProvider.cs.

The idea is to have all 'MonoTlsProvider' implementations inside
System.dll and not access any of the private APIs from outside of it.
(cherry picked from commit 9437553e54)
2016-09-29 01:10:39 +02:00
Martin Baulig 1055069416 [configure] Add configure.ac checks for BTLS. (#3668) 2016-09-29 00:53:33 +02:00
Marek Safar 486748776c [corlib] Improve test added in 54ea12e4fa 2016-09-29 00:28:57 +02:00
Aleksey Kliger 4cc2b45bed [runtime] Use mono_error_set_for_class_failure in more places
Also assert if we see anothing other than MONO_EXCEPTION_TYPE_LOAD or
MONO_EXCEPTION_INVALID_PROGRAM in a class failure.
2016-09-28 18:25:33 -04:00
Marek Safar 0987545404 [build] Make monolite output path configurable 2016-09-28 23:34:36 +02:00
Aleksey Kliger a13dd1bdf0 [loader] Use mempool memory for MONO_EXCEPTION_TYPE_LOAD messages.
Prevent memory leaks by storing the error message strings in the same
mempool as the failing class.
2016-09-28 17:25:36 -04:00
Aleksey Kliger 6b60fb6c77 [image] Check mempool of mono_image_property_insert value
When adding an image property, check that the value belongs to the same image.

Ensure that we don't leak the values when the property hashtables are destroyed.
2016-09-28 17:24:14 -04:00
Aleksey Kliger 1e41338e8d [checked] Add CHECKED_METADATA_STORE and CHECKED_METADATA_STORE_LOCAL
When running a checked build with metadata checking enabled, these
macros check that values written to ptr occupy the apropriate mempool.
2016-09-28 17:22:31 -04:00
Aleksey Kliger 56a50a3029 [image] Add mono_image_strdup_printf and mono_image_strdup_vprintf 2016-09-28 17:21:53 -04:00
Aleksey Kliger 276c2c2588 [mempool] Add mono_mempool_strdup_printf and mono_mempool_strdup_vprintf 2016-09-28 17:21:09 -04:00
Marek Safar 9d8e1631b7 [System] Reduce duration of SendGenericExceedBuffer test 2016-09-28 18:12:23 +02:00
Martin Baulig 3c2a11dc91 [System]: Cleanup the internal MobileTlsContext.
* Add SelectClientCertificate().
* ValidateCertificate() now returns bool.
* Add ValidateCertificate() overload.

(cherry picked from commit 0d07c695b5)
2016-09-28 13:52:07 +02:00
Martin Baulig 0bdaa8421c [Mono.Security]: Cleanup the internal ICertificateValidator2.
(cherry picked from commit fcc570920d)
2016-09-28 13:52:00 +02:00
Martin Baulig 6d46c3ec0b Remove all MONO_FEATURE_NEW_TLS conditionals.
(cherry picked from commit c155563d1e)
2016-09-28 13:51:52 +02:00
Martin Baulig 3e751052f1 Cleanup; with the removal of 'PrebuiltSystemAlias', we don't need to use XX509* anymore.
(cherry picked from commit 5b412212cd)
2016-09-28 13:51:43 +02:00
Martin Baulig fa22808b26 [System]: Make Test/System.Net.Sockets compile.
(cherry picked from commit c2e7ca6c99)
2016-09-28 13:37:30 +02:00
lateralusX d4ea732e74 Enable reuse of eglib native test framework and test driver source.
In current eglib test framework there is no mechanism to specify where
the include file describing all tests is located. Current implementation also assumes it is the main
entry point of the process since it defines the main symbol. There are several scenarios
where it could make sense to reuse eglib test framework and its driver in other native unit test projects
unit testing native code. In those scenarios it would be nice to include existing driver.c
from eglib/test (no copy) and use toolchain capabilities to include needed header with test descriptions
and change main symbol name, since main will most likely be defined elsewhere.

This can be achieved by two simple defines that can be set when embedding eglib test framwork in other
native binaries. By default these defines will not be set and current behavior will be preserved.
2016-09-28 12:01:08 +02:00
Marek Safar 94cc2dea31 [build] Update bootstrap info text 2016-09-28 08:43:27 +02:00
Johan Lorensson 2c48afbc63 Merge pull request #3626 from lateralusX/jlorenss/win-api-family-support-eglib
Build eglib under none desktop Windows API family.
2016-09-28 08:40:30 +02:00
Rodrigo Kumpera 8bdce50379 Merge pull request #3658 from kumpera/fix-ios-logging
[logging] Fix logging on iOS. We lost asl redirection and it was sending to stdout instead.
2016-09-27 20:11:23 -04:00
Ludovic Henry 3ae9e2c971 [threads] Signal the w32handle later in the thread destruction process (#3652) 2016-09-27 23:44:51 +02:00
Rodrigo Kumpera 65a4d35202 [logging] Fix logging on iOS. We lost asl redirection and it was sending to stdout instead. 2016-09-27 14:39:24 -07:00
Aleksey Kliger (λgeek) 76b32f3ee3 [coop handles] Add some memory fences (#3617)
When running with async suspend (ie, not coop), a user thread might be
suspended while its manipulating the coop handle stack.  In that case,
we want to present a consitent view to mono_handle_stack_scan () by
adding memory fences to code that updates the stack chunks.  In
particular we want to ensure that the chunk size is increased after
the new slot has a valid (null) value.  Also when creating new chunks
make sure their size is initialized before the chunk stack is updated.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43921 (at least the
one stack trace observed in [comment 1](https://bugzilla.xamarin.com/show_bug.cgi?id=43921#c1)).
2016-09-27 17:02:18 -04:00
Martin Baulig fd6108736c [Mono.Security.Interface] Cleanup and simplify MonoTlsProviderFactory.
The "global" TLS Provider (returned by MonoTlsProviderFactory.GetProvider())
may only be modified at application startup (before any of the TLS / Certificate
code has been used).

* MonoTlsProviderFactory.HasProvider has been removed.

  This property used to initialize the TLS Subsystem without throwing any
  exceptions.  However, properties with side-effects is a bad design principle.

* Add MonoTlsProviderFactory.IsInitialized.

  Does not have any side-effects.

* Add MonoTlsProviderFactory.Initialize() and Initialize(string).

  May only be called at application startup and explicitly initializes the
  TLS Subsystem.

* Rename MonoTlsProviderFactory.GetDefaultProvider() into GetProvider()
  and removed MonoTlsProviderFactory.GetCurrentProvider().

  We do not distinguish between a "default" and a "current" provider anymore;
  there is only one "global" provider.

* Add MonoTlsProviderFactory.IsProviderSupported(string).

  Checks whether a specific TLS Provider is supported, without having side-effects.

* Make the old APIs [Obsolete] until products have been updated.

* Add some documentation to MonoTlsProviderFactory.

(cherry picked from commit 7c3ae83b31)
2016-09-27 22:23:10 +02:00
Zoltan Varga 80950a920f [llvm] Enable support for large basic blocks again.
llc has some performance problems with large basic blocks so we have to break them up into smaller ones. Use some hacks to prevent opt/llc from merging them back again.
2016-09-27 15:25:40 -04:00
Marek Safar ed8d5f669d Merge pull request #3656 from marek-safar/bootstrap
[build] Bootstrap extension for roslyn
2016-09-27 21:24:11 +02:00
Aleksey Kliger a02d938818 [runtime] Fix MonoMethod.get_base_method when abstract methods are not overridden
When there is an abstract class in the middle of an inheritance
hierarchy that doesn't override a method, get_base_methods needs to search
the parent class instead aborting early.

Example:

```
abstract class Root {
  public abstract void Foo ();
}
abstract class Abs : Root { }
class Derived : Abs {
  public override void Foo () { }
}
```

If we ask for the base method of Derived.Foo we used to get Derived.Foo
back because Abs did not provide an override.  Instead we should skip
abs and look in Root.
2016-09-27 15:00:21 -04:00
Marek Habersack 79b828c66d Fix trace logging on Android
Introduction of the structured trace logger accidentally broke Android
logcat logging. The reason for this is that the default logging handler
defined in eglib (in goutput.c) for Android was never called, instead it
was superseeded by the log file logger defined in mono-logger.c

The net effect was that Mono tried to write the messages to some file on
Android leaving logcat devoid of any trace of life :)

This commit fixes the issue by introducing a set of structured logging
functions for Android.

As a side note - file logging on Android is not that useful. Writing to
a file on external storage medium requires app permissions and writing
to a location on internal storage medium, while allowed, might be
subject to space limitations and should not be used for possibly
voluminous data. It's therefore not very practical on Android.
2016-09-27 20:31:19 +02:00
Marek Safar 4d17bdc54e [build] Bootstrap extension for roslyn 2016-09-27 14:27:11 +02:00
Rolf Bjarne Kvinge e6536dd5e1 [System*] Throw a PlatformNotSupported exception when using the networking stack on watchOS. (#3606)
* [System] Fix line endings for a few files.

Best reviewed by not showing whitespace changes (should be empty diff in that case).

* [System] Fix potential crash in CookieParserTests.

Socket.EndAccept can throw an exception, which will crash the process if it
happens on a threadpool. So handle any exceptions when calling
Socket.EndAccept, and propagate those exceptions out of any threadpool code.

* [System.Net.Http] Throw a PlatformNotSupported exception when using HttpClientHandler on watchOS.

* [System.Net.Http] Tweak tests after watchOS API change.

Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.

* [System] Extract the HttpListenerResponseHelper class to a separate file.

Extract the HttpListenerResponseHelper class to a separate file so that it's
easier to replace the HttpListenerResponse implementation by using a different
file.

* [System] Throw a PlatformNotSupported exception when using the networking stack on watchOS.

* [System] Tweak tests after watchOS API changes.

Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.

* [System] Fix potential crash in SocketAcceptAsyncTest.

Fix potential crash in SocketAcceptAsyncTest by catching any exceptions in
code executed on the threadpool so that we never end up with unhandled
exceptions (which may terminate the process).

* [System] Avoid logic in SetUp attributes in tests.

Any type of exception in [SetUp] attributes causes all tests to fail with that
exception.

This even happens for tests that do not need the logic in the [SetUp]
attribute.

So rewrite tests a bit to not use [SetUp] when we can reasonably avoid it, and
instead instantiate class-level variables on first use. This ensures that any
exceptions that occur when initializing those variables are attributed to the
corresponding test, and not all of them.

* [System] Make exception handler (for test) catch more exceptions to avoid unhandled exceptions causing process termination.

* [System] Remove Obsolete attribute on API that throws PNSE.
2016-09-27 13:13:38 +02:00
Rolf Bjarne Kvinge 59b6fde1b3 [corlib] Add API to uninstall/reinstall signal handlers.
This API is provided to be used by libraries providing crash reporting, so
that those libraries can install signal handlers and at the same time not
interfere with Mono's signals.

The intended pattern is this:

    Mono.Runtime.RemoveSignalHandlers ();
    InstallThirdPartySignalHandlers ();
    Mono.Runtime.InstallSignalHandlers ();

This ensures that Mono is always notified first of any signals, and will then
chain to the third-party signal handlers if the signal did not originate in
managed code.

Mono's signals must first be removed, so that if third-party signal handler
does signal chaining, we don't end up in Mono's signal handler again.

Mailing-list thread: http://lists.dot.net/pipermail/macios-devel/2016-September/000016.html [Signal-chaining & crash reporters]
Example usage: https://github.com/rolfbjarne/HockeySDK-Xamarin/commit/862721199f1adec210bfc7b1943f975ffb8048a9
2016-09-27 12:35:14 +02:00
Rolf Bjarne Kvinge 14bb051f36 [mini] Provide a free function to the saved signal handler hash table.
This makes the cleanup code simpler, and also makes it easier to
replace saved signal handlers without having to worry about
leaking memory.
2016-09-27 12:35:14 +02:00
Vlad Brezae 4df88aea4b Merge pull request #3647 from BrzVlad/fix-sgen-internal-alloc
[sgen] Fix sgen internal alloc
2016-09-27 13:10:01 +03:00
Martin Baulig 61d76d9642 [Mono.Security]: Cleanup Mono.Security.Interface.CertificateValidationHelper.
* CertificateValidationHelper.GetDefaultValidator(): rename this internal method into
  GetInternalValidator() (keeping the old as [Obsolete] until products have been updated).

* CertificateValidationHelper.GetValidator(): remove the 'provider' argument.

This is part of a set of cleanups and simplifications for the upcoming BTLS integration.
2016-09-27 11:39:07 +02:00
lateralusX 109d34b9c0 Build eglib under none desktop Windows API family.
Initial work to build eglib under none desktop Windows API family. Classic
Windows API have been split into families and partitions in order to support
different subsets on different Windows platforms. In order to build against
other Windows targets/platforms Mono needs to follow these families/partitions
in order to successfully build where API’s have been removed/replaced. Since most
Mono platforms uses the Windows API signatures a new defined has been added to all
platforms, HAVE_CLASSIC_WINAPI_SUPPORT, used to decide what implementation to include.
On none Windows platforms this is always defined and on Windows platforms it follows the
winapifamily.h. In order to keep down regressions, the existing API’s are kept for HAVE_CLASSIC_WINAPI_SUPPORT
even if there are more modern replacements available.
2016-09-27 11:28:57 +02:00
Ludovic Henry 1f15519152 [w32handle] Ensure we initialize begore the gc attach the current thread (#3644) 2016-09-27 10:43:59 +02:00
Marek Safar a064ce84e0 Merge pull request #3643 from marek-safar/bootstrap
[build] Bump mono bootstrap dependency to Mono 4.0+
2016-09-27 08:20:05 +02:00
Miguel de Icaza aae997259a [mini] Add some documentation comments to some IR generating macros 2016-09-26 22:16:49 -04:00
Vlad Brezae 43f369a107 [sgen] Untag the vtable during concurrent mark
For now, concurrent mark runs concurrently with bridge during minors. Since bridge processing might tag object vtables, make sure we don't crash when we scan such objects.
2016-09-27 00:38:43 +03:00
Vlad Brezae 837d12bfc6 [sgen] Fix internal allocation
After recent header size change in 883e0a2d89, we had some slot sizes unaligned which was leading to unaligned memory allocation and therefore SIGBUS-es on some ARMs.

We used to have all allocators use 16k blocks and slot sizes optimized for this. After we switched to allocating in 4k, 8k and 16k blocks the slot sizes were not optimized for the new format.

This commit fixes unaligned problems, at the same time optimizing the size of allocator slots.
2016-09-27 00:38:41 +03:00
Zoltan Varga 8994ce8a09 [aot] Make sure generic wrappers are unique by creating shared versions of the them in the same order that AOT creates them (shared method -> wrapper). 2016-09-26 14:54:45 -04:00
Marek Safar 8a7ff203c8 [System] Fixes SendGenericExceedBuffer test 2016-09-26 20:46:28 +02:00
Zoltan Varga 628d9dac90 [aot] Fix the linux bitcode build. 2016-09-26 13:24:51 -04:00
Marek Safar cbd4cff826 [build] Bump mono bootstrap dependency to Mono 4.0+ 2016-09-26 19:19:23 +02:00
Marek Safar 1306fa1237 [System] Revert copyright change in 8e4a52a374 2016-09-26 16:56:19 +02:00
Marek Safar 8e4a52a374 [System] netstandard compatible Process collections 2016-09-26 16:52:25 +02:00
Alexander Köplinger 3687b18b3d Restructure and update build status section in README
Add links to Windows/OSX builds on Jenkins.
2016-09-26 15:46:03 +02:00
Alexander Köplinger 7fd68f813d Remove appveyor.yml from repository
We now have our own set of Windows bots on our Jenkins CI for building and testing Mono on Windows.

Special thanks to AppVeyor for providing us with build capacity over the last two years <3
2016-09-26 15:45:03 +02:00
Zoltan Varga 43ba3b7a22 [runtime] Make a copy of the wrapper date when instantiating generic wrapper methods, to be able to store a different WrapperInfo for them. (#3634) 2016-09-26 01:21:58 -04:00
Ludovic Henry 13c15c25fb [Socket] Use SemaphoreSlim instead of Queue (#3633)
This uses the same approach as corefx's FileStream. This simplifies the code, as well as make the intent of the queue clearer.
2016-09-25 19:54:07 +02:00
Alexander Köplinger 3a3d080e17 [corlib] Remove unnecessary net_4_x_corlib.dll.sources
It only imports corlib.dll.sources, removing the file has the same effect.
2016-09-25 17:01:55 +02:00
Alexander Köplinger 4d325a0674 [System] Add ISupportInitialize on mobile FileSystemWatcher
The interface was missing on the mobile stub.
2016-09-25 13:59:53 +02:00
Alexander Köplinger 566f0a78b0 [System] Remove obsolete HttpWebRequest/Response constructors again
They were removed from a later revision of netstandard2.0 so we don't need to add them.
2016-09-25 13:02:48 +02:00
Zoltan Varga 47561c7053 [jit] Resurrect the Monitor.Enter () v4 optimization. (#3632) 2016-09-25 03:15:48 -04:00
Alexander Köplinger 015de5d245 Merge pull request #3631 from slide/bz44714
Fix issue with VB projects
2016-09-25 01:54:27 +02:00
Alexander Köplinger 3d0799107b Fix tarball build 2016-09-25 01:45:21 +02:00
Ludovic Henry c5df7e9669 [referencesource] Import parts of System.Net.Sockets.Socket (#3618) 2016-09-24 20:10:01 +02:00
Alexander Köplinger 6a82e9a890 Fix tarball build
The file was removed in 18ada43d3d.
2016-09-24 19:17:16 +02:00
Alex Earl d6bb144980 Fix issue with VB projects
Fixed GenerateFullPathToTool for Vbc task to match behavior of the Csc
task. This allows VB.NET projects to build successfully.

See https://bugzilla.xamarin.com/show_bug.cgi?id=44714
2016-09-24 08:44:33 -07:00
Zoltan Varga 972b78f8bf [SRE] Implement the ModuleBuilder:create_modified_icall () in managed code. Use user types instead of creating derived types of unfinished typebuilders. (#3629) 2016-09-24 09:41:14 -04:00
Alexander Köplinger d0d6b2a33a Bump corlib version
18ada43d3d didn't bump the corlib version and this breaks building with monolite.
2016-09-24 12:20:40 +02:00
Marek Safar a8c8cc7a3f Merge pull request #3625 from slide/master
Fix 16628
2016-09-24 09:33:19 +02:00
Martin Baulig 2cc1b887c1 [AppleTls]: Flush the write queue before finishing the handshake.
It is possible for SSLHandshake() to return SslStatus.Success while we're still
having a pending write (AsyncOperationStatus.WantWrite).

This is because our managed write callback must never return 'WouldBlock', so
SSLHandshake() things that all data have been sent while we still have them in
our write queue.

When this happens, we currently flush the write queue then call SSLHandshake()
again via AsyncOperationStatus.WantWrite -> AsyncOperationStatus.Continue.

This returns SslStatus.Protocol on iOS 10.
2016-09-24 07:38:18 +02:00
Vlad Brezae f726e1bcf0 [gc] Warn if we fail to switch gc 2016-09-23 23:15:44 +03:00
Zoltan Varga 0faf536739 [aot] Fix aot support on android.
Disable the binary writer in llc since it doesn't seem to work. Use $tool_prefix/ld for linking if the tool prefix is set.
2016-09-23 15:40:48 -04:00
Alexander Köplinger 112631f5c6 [bcl] Add missing APIs for netstandard parity and expose a few APIs on mobile
This ensures we're compliant with the upcoming netstandard2.0 API surface area.
2016-09-23 17:50:06 +02:00
Alexander Köplinger fa986f1e36 [bcl] Add CLSComplaint(false) to a few types/methods that aren't compliant 2016-09-23 17:17:59 +02:00
Alex Earl bde7699722 Fix 16628
This changes the IL parser to have the same behavior as ilasm.exe from
MS

https://bugzilla.xamarin.com/show_bug.cgi?id=16628
2016-09-23 07:47:35 -07:00
Zoltan Varga 91014ffb91 [llvm] Add static rgctx trampolines to array access methods in the aot+llvm case too. (#3616) 2016-09-23 09:49:51 -04:00
Alexander Köplinger 7f51d473ef Merge pull request #3622 from rolfbjarne/remove-stray-file
Remove stray file.
2016-09-23 14:31:43 +02:00
Marek Safar 4ec076ab6b [corcompare] More hacks to make breaking change not too disruptive 2016-09-23 14:17:55 +02:00
Rolf Bjarne Kvinge ef972deb08 Remove stray file. 2016-09-23 14:14:47 +02:00
Marek Safar 775c082236 [System.Core] Fixes warnings 2016-09-23 13:36:41 +02:00
Marek Safar 8c7f99a8fe Merge pull request #3621 from kloun/patch-9
fix Another Typo
2016-09-23 13:29:03 +02:00
kloun e9b9b53811 fix Another Typo 2016-09-23 14:26:51 +03:00
Marek Safar 7ba748c8b8 [bcl] Base type update to match netstandard apis 2016-09-23 12:10:11 +02:00
Marek Safar b1b62469da [mono-symbolicate] Include pdb debug symbols support file 2016-09-23 10:27:30 +02:00
Marek Safar 2cba858cb7 Merge pull request #3615 from kloun/patch-8
fix typo, "j-j"
2016-09-23 08:47:21 +02:00
Marek Safar e297a5d2b6 Merge pull request #3614 from kloun/patch-6
fix identical sub-expressions
2016-09-23 08:46:36 +02:00
Zoltan Varga c0e91ae252 [arm64] Handle thunks with ARM64_B relocations as well. 2016-09-22 19:29:53 -04:00
Marek Safar cdf0a4c29f Merge pull request #3613 from kloun/patch-4
fix another ERIC
2016-09-22 23:37:47 +02:00
kloun 90601ba4cf fix typo, "j-j" 2016-09-23 00:24:37 +03:00
kloun ad48ddf483 Update generic.cs 2016-09-23 00:17:38 +03:00
kloun f14f87f1cd Update generic.cs 2016-09-23 00:15:47 +03:00
kloun 7eeb7a9e61 fix identical sub-expressions 2016-09-23 00:12:05 +03:00
Marek Safar b1b28a15d6 Merge pull request #3603 from ninjarobot/socket-write
Send all data to a socket before exit from Socket.Send.
2016-09-22 22:58:57 +02:00
kloun 11022626f0 fix another ERIC 2016-09-22 23:54:36 +03:00
Alexander Köplinger dbb7547576 Merge pull request #3611 from kloun/patch-2
Fix copy-paste error in WinForms DataGrid
2016-09-22 22:29:21 +02:00
kloun fe0643cb31 fix copy-paste ERIC error) 2016-09-22 23:22:54 +03:00
monojenkins 2b26601921 Merge pull request #3609 from xmcclure/checked-imageset
Fix outstanding failures in "metadata" checked build mode

Fix two problems with the checked build metadata mode which were causing spurious failures, one a bug introduced by my last commit, one of which has been present since the start:

- Check assemblies in `references[]` are non-NULL before looking up their images
- A "from" imageset only needs to reference every image in the "to" imageset, it does not need to actually contain every image.

Also added support for a checked build jenkins lane.
2016-09-22 22:15:03 +02:00
Ludovic Henry 828045d259 [mono-threads] Move platform unregister after detach (#3604)
This is important as platform unregister is where we signal the thread handle, and that should be done as late as possible, but still before we switch the thread state to DETACHED and remove it from the thread list.

The fact that we do under the suspend lock shouldn't be an issue as we shouldn't call in any other code than w32handle code.
2016-09-22 22:09:29 +02:00
Andi McClure a3a93f69d1 New run-jenkins tags to allow a checked build job and fix partial checked build support in the coop job 2016-09-22 14:31:58 -04:00
Andi McClure 6ae1985688 Fix imageset->imageset audits in checked-build "metadata" mode
An imageset can reference another imageset if every image in the "to"
imageset is referenced by some image in the "from" imageset.
Previously the checked build code was requiring the stricter criteria
of every image in the "to" imageset being present in the "from"
imageset, which was not only inconsistent with image->imageset and
imageset->image reference checking, but lead to spurious failures.

An example of a scenario where the previous check logic would fail is:
Assembly A:
	class ClassA<T>
Assembly B:
	class ClassB<T> extends ClassA<T>, ClassB2
Attempting to run the constructor for ClassB<ClassB2> would result in
a pointer to memory in imageset [A,B] being written into a structure
located in imageset [B]. This is valid since B references A, however
the MONO_CHECK_MODE=metadata checker would flag it as an error.
2016-09-22 14:27:23 -04:00
Marek Safar 9ed7ac5125 [corcompare] Another try to make breaking change not too discruptive 2016-09-22 20:13:44 +02:00
Zoltan Varga e0f96a41c6 [sdb] Add a SetThis () method to StackFrame which can be used to set the fields of the receiver for valuetype instance methods. Fixes #44341. (#3605) 2016-09-22 10:05:52 -04:00
Henric Müller e2602e1d4a Merge pull request #3600 from henricm/fix-win-network-info-tests
Fix NetworkInformation tests on Windows
2016-09-22 15:57:26 +02:00
Joshua Peterson 087c016f5c Try to use an IPv4 address first for TCP remoting (#3507)
* In the .NET implementation of TcpServerChannel, if IPv4 is supported, the address for the host will use the first IPv4 address.
* Even if the first address is an IPv6 address, it should be skipped, as the server side will expect and IPv4 address.
* Change this implementation to look for an IPv4 address first, then fall back to whatever the first address is (IPv4 or IPv6) if things don't work out.
2016-09-22 09:49:18 -04:00
Miguel de Icaza 2f1e6655e2 [mkbundle] - Add support for bundling native libraries.
* [mkbundle] add support for bundling native libraries

* [glib] add g_mkdtemp

* mono: Load the various library payloads for bundled executables

* [msvc] Export mono_dl_open and mono_loader_register_module
2016-09-22 09:28:17 -04:00
Marek Safar de952507c2 Add missing file 2016-09-22 14:44:42 +02:00
Marek Safar 24867d108c [colrib] Fixes aecdb91a06 and add GC tests 2016-09-22 14:43:00 +02:00
Marek Safar c00853e14b [corcompare] Drop ParameterAttributes from method signature 2016-09-22 12:27:12 +02:00
Johan Lorensson bf29fd5955 Merge pull request #3585 from lateralusX/jlorenss/win-counter-warning
Resolve "you are registering twice the same counter address" warning on Windows Release builds.
2016-09-22 08:54:23 +02:00
Martin Baulig c3db8b00ab [Mono.Security]: Add 'MonoTlsConnectionInfo.PeerDomainName'.
(cherry picked from commit 0bafe8c3c7)
2016-09-22 07:38:41 +02:00
Martin Baulig 32c5acbefd Remove obsolete Mono.Security.Providers.* assemblies (#3595)
* Remove Mono.Security.Providers.NewSystemSource and Mono.Security.Providers.NewTls.

* Remove InternalVisible for "Xamarin.BoringTls".

* Remove Mono.Security.Providers.OldTls and Mono.Security.Providers.DotNet.

(cherry picked from commit 7b7b7c9b64)
2016-09-22 07:35:48 +02:00
Andi McClure fe9ac011d4 Back out trivial crash when running metadata checked-build mode
introduced by f822445711
2016-09-21 17:52:51 -04:00
Zoltan Varga 7f95267f8a [runtime] Fix the managed name of the ReRegisterForFinalize () icall. 2016-09-21 17:51:38 -04:00
Dave Curylo bf58ae6aae Returning during Send in case of error. Splitting send and receive into separate tasks in test. 2016-09-21 14:18:38 -04:00
Niklas Therning 3d023ebb02 Merge pull request #3548 from cmp-/fix-sgen-resume-thread-win32
[sgen] Fix sgen_resume_thread return value on Windows
2016-09-21 19:36:03 +02:00
cmp ba30dc0a96 [sgen] Fix sgen_resume_thread return value on Windows
According to sgen_resume_thread in sgen-os-mach.c, the function is
supposed to return false if the thread was not suspended.
2016-09-21 18:20:17 +01:00
Aleksey Kliger (λgeek) 31d66d692f [gacutil] Use IKVM.Reflection instead of System.Reflection (#3582)
* gacutil should use System.Reflection.Assembly.ReflectionOnlyLoadFrom() since it doesn't need to run the assemblies;
* but in fact, it could also use a managed reflection library. So in this PR we change it to use IKVM.Reflection
2016-09-21 12:49:12 -04:00
Ludovic Henry 18ada43d3d [w32mutex] Move own/disown code to w32mutex-unix.c (#3599)
* [w32handle] Fix race condition

* [w32mutex] Improve logging

* [w32mutex] Only add to owned mutex when we own it for the first time

* [w32mutex] Move own/disown code to w32mutex-unix.c
2016-09-21 18:10:38 +02:00
Dave Curylo a1b1a7c8db Send all data to a socket before exit from Socket.Send. 2016-09-21 11:31:53 -04:00
Andi McClure 3319d6a5a7 Merge pull request #3583 from xmcclure/test-418-checked
Fix issues (leaks, possible crash) around netmodule loading
2016-09-21 10:37:19 -04:00
Alexander Köplinger 626c697b29 Merge pull request #3602 from henricm/fix-configuration-symlink-removed
Removing symlink to make Configuration tests run on Windows
2016-09-21 15:38:51 +02:00
Henric Müller 154e729860 Removing symlink to make Configuration tests run on Windows 2016-09-21 15:32:05 +02:00
Marek Safar 480a8e0d95 [corlib] Simplify terminal evaluator nesting expression 2016-09-21 15:28:13 +02:00
Niklas Therning f6b8e1f10d Merge pull request #3547 from cmp-/remove-obsolete-stack-checks-win32
Remove obsolete stack limit checks on Windows
2016-09-21 14:42:49 +02:00
Alexander Köplinger f5836956c6 [System.Core] Expose a few more System.IO.Pipes APIs on mobile
Required for netstandard matching.
2016-09-21 13:56:03 +02:00
Henric Müller 2cb3807146 Implementation of GetLoopbackInterfaceIndex on Windows 2016-09-21 13:54:34 +02:00
Henric Müller 26d95892e3 Ignoring IsDnsEnabled test on Windows 2016-09-21 13:45:54 +02:00
Henric Müller 03823d39f4 Using InternalAdd to handle read only of IPAddressCollection
The read-only nature of Win32IPAddressCollection is handled by
the base class IPAddressCollection. Therefor removing the read-only
handling in this class and use InternalAdd from base class instead.
2016-09-21 13:45:04 +02:00
Marek Safar 76f97e3073 [mcs] Add compilergenerated attribute for private event backing fields to match newer csc 2016-09-21 12:54:08 +02:00
Alexander Köplinger 87dfebcb22 Merge pull request #3587 from henricm/fix-set-no-delay-tcp-only
Only set NoDelay by default for protocol TCP
2016-09-21 11:37:08 +02:00
Ludovic Henry d62c2c5fa5 [threadpool-ms] Fix race condition on domain unload (#3592)
This race condition has been introduced with 348d793ebb. This is because we would wait on the cleanup_semaphore outside of the threadpool->domains_lock lock.

By using a cond variable instead of a semaphore, we avoid a potential deadlock.
2016-09-21 11:16:35 +02:00
Niklas Therning f66549c12d Merge pull request #3588 from ntherning/fix-line-ending-issue-in-XmlReflectionImporterTests-Bug594490_SerializationOfXmlLangAttribute
Fixes line ending issue in XmlReflectionImporterTests.Bug594490_SerializationOfXmlLangAttribute
2016-09-21 09:39:54 +02:00
Aleksey Kliger (λgeek) 3589fcd39a Merge pull request #3569 from lambdageek/monodis-no-segfault
[monodis] Don't segfault using cooperative GC.
2016-09-20 18:09:27 -04:00
Andi McClure cc522292ae Fix issues in previous commit
- mono_assembly_load_module was not following MONO_RT_EXTERNAL_ONLY
  rules
- New _checked methods were not following init rules
- module[] load code was botched
2016-09-20 17:12:46 -04:00
Ludovic Henry 4b44d9fad8 [threads] Move thread describe code to mono_thread_internal_describe (#3590) 2016-09-20 22:39:30 +02:00
Alexander Köplinger de8a76a1c1 Fix Linux build break due to case sensitivity 2016-09-20 19:30:04 +02:00
Jo Shields 41a1c19ec8 Handle relocatable libMonoPosixHelper.so when --libdir= isn't lib/
Right now, we use a special token in mono/config which replaces $mono_libdir with the runtime-detected assemblies lib dir - e.g. /usr/lib

Unfortunately, this does not handle cases where a --libdir= value is passed to configure, such as on Red Hat where they use --libdir=/usr/lib64 on AMD64

We already have a variable from configure - reloc_libdir - so introduce some helpers to use it in the $mono_libdir replacement.

This assumes the value of --libdir is a subdirectory of --prefix, but I doubt we have ever worked at all when that is not the case.

Fixes: #41953
2016-09-20 17:02:36 +01:00
Marek Safar 9abe4d86d7 [System] Add more types to mobile profile 2016-09-20 17:55:34 +02:00
Marek Safar 7fadb5f6b3 [corlib] Remove duplicate files entries 2016-09-20 17:29:13 +02:00
Marek Safar aecdb91a06 [corlib] GC from referencesource 2016-09-20 17:29:13 +02:00
Marek Safar a83c5fba9e Merge pull request #3589 from ntherning/fix-line-ending-issues-in-System.Data-tests
Fixes line ending issues in System.Data tests
2016-09-20 17:19:12 +02:00
Niklas Therning c0584ca8ee Fixes line ending issues in System.Data tests
To make them run successfully on Windows.
2016-09-20 17:12:59 +02:00
Ludovic Henry 031bb67812 [threads] Detach thread in all possible cases (#3584)
* [threads] Use mono_thread_detach_internal to factor code

* [threads] Make sure we detach the thread before exiting

* [threads] Add mono_thread_internal_current_is_attached

* [threads] Ensure we detach the thread on Boehm
2016-09-20 17:12:37 +02:00
lateralusX b0a7eca6fd Resolve "you are registering twice the same counter address" warning on Windows Release builds.
When registering profile counters on optimized Windows build you will get the following logging twice:

"you are registering twice the same counter address"

This happens since the optimizer will collapse cpu_load_1min, cpu_load_5min and cpu_load15min into
the same function on optimized Windows builds and that is not expected by register_internal.

By preventing inlining of cpu_load we can keep the different callback methods unique and optimizer
won't fold them into one single representation in the final binary.
2016-09-20 17:07:02 +02:00
Niklas Therning bf8fc72e1b Fixes line ending issue in XmlReflectionImporterTests.Bug594490_SerializationOfXmlLangAttribute
This test is sensitive to the line ending mode used by git. When LF is used by
git (which is what Cygwin's git defaults to) this test fails on Windows since
CRLF will be used as line ending in the serialized XML. This patch changes the
test to use Environment.NewLine explicitly in the expected string.
2016-09-20 16:42:24 +02:00
Marek Safar 38bf986142 Merge pull request #3586 from henricm/fix-win-uri-tests
Ignoring URI tests with unix path on windows
2016-09-20 15:05:10 +02:00
Henric Müller cd40eb318e Only set NoDelay by default for protocol TCP 2016-09-20 14:00:39 +02:00
Marek Safar 97ede66a07 Rewrite 67cdb99 to make more sense and don't regress 2016-09-20 13:15:11 +02:00
Henric Müller 99f2a62240 Ignoring URI tests with unix path on windows
In the .NET runtime, parsing unix paths like "/foo"
on Windows fails. Therefore ignoring tests with such paths
when running tests on Windows.
2016-09-20 11:42:09 +02:00
Alexander Köplinger df39947352 Merge pull request #3578 from henricm/fix-win-process-test
Fixes for ProcessTest on Windows
2016-09-20 11:12:01 +02:00
Alexander Köplinger 443b755fbc Add link to Bugzilla ticket for unifying the behavior between .NET and Mono 2016-09-20 11:11:46 +02:00
Marek Safar ce90aa3fb3 [corlib] Cleanup more warnings 2016-09-20 11:05:39 +02:00
Marek Safar 4c90327da2 [mcs] Warn about unused local constants 2016-09-20 11:05:39 +02:00
Marek Safar e24985c6ce Merge pull request #3580 from esdrubal/msym_no_cecil_ref
[mono-symbolicate] Added Mono.Cecil sources.
2016-09-20 10:57:47 +02:00
Niklas Therning 97ed6df1e2 Merge pull request #3577 from ntherning/fix-path-to-mono-exe-in-soft-debugger-tests-on-windows
Use the path of the current executable by default in soft debugger test on Windows to launch the child mono process
2016-09-20 07:50:37 +02:00
Andi McClure 1dc438307e Safety check for "diamond dependencies" on netmodules
This is something I noticed while following up on an issue with
mcs/tests/test-418.exe. The ECMA-335 spec contains the text:

    "Usually, a module belongs only to one assembly, but it is
possible to share it across assemblies. When assembly A is loaded at
runtime, an instance of M3 will be loaded for it. When assembly B is
loaded into the same application domain, possibly simultaneously with
assembly A, M3 will be shared for both assemblies. Both assemblies
also reference F2, for which similar rules apply."

What happens in Mono when two assemblies both load the same module? We
never planned for that possibility in our architecture. Looking at our
current code, when an assembly image loads a module image into its
modules[] or files[] array, it immediately sets the "assembly" field
of that module to its own MonoAssembly. This field is a plain C
pointer with no safety on it whatsoever, and is references in various
places including by icalls. Consider the following scenario:

- Assembly A is loaded, references module M3, sets M3->assembly to
  A->assembly.
- Assembly B is loaded, references module M3, sets M3->assembly to
  b->assembly.
- Assembly B is unloaded.

At this point the image for B is unloaded, but M3 is still alive
because A keeps it alive, and its image contains a C pointer to freed
memory. There is likely some way to trigger a crash from this point.

Because the above scenario is fairly exotic, I dealt with it by just
causing the module loader to detect when multiple assemblies are
referencing the same module and throwing an exception in this case. I
also added a test to verify the exception is thrown. Allowing the
module load to raise an exception required adding _checked versions of
several functions.
2016-09-19 17:55:33 -04:00
Andi McClure f822445711 Fix leaks, checked build support around netmodules loaded as "files"
Test mcs/tests/test-418.exe was failing when running a checked build
with MONO_CHECK_MODE=metadata. I audited how images track their
modules and fixed the following issues:

1. The checked build metadata "reference audit" was following
references stored in the "modules" field, but not the "files" field. I
changed the audit code to follow both.
2. Loading a module into the "modules[]" field was causing a leak
because mono_image_addref() was being called after
mono_image_open_full(), even though mono_image_open_full itself
returns the module +1. I removed the addref.
3. Loading a module into the "files[]" field was causing a leak
because we were opening the module with mono_image_open_full and then
never attempting to close it. I modified our image close to do the
same thing to "files[]" we do to "modules[]".

In order for 1 and 3 to work, I modified MonoImages to track the size
of the "files[]" field.
2016-09-19 17:55:08 -04:00
Vlad Brezae c1051b7029 Merge pull request #3567 from BrzVlad/fix-conc-memusage2
[sgen] Fix concurrent memory usage
2016-09-19 21:05:27 +03:00
Alexander Köplinger f9db34e0cc [Facades] Another define fix
It was missed in https://github.com/mono/mono/commit/c84760250884989e10d707c049fd0aacae79c93e.
2016-09-19 19:57:45 +02:00
Marek Safar c847602508 [Facades] Use correct define 2016-09-19 18:55:49 +02:00
Alexander Köplinger fcca9846c8 Merge pull request #3522 from henricm/fix-csharp-compiler-path-windows
Using running process to determine mono exe path on windows
2016-09-19 18:25:10 +02:00
Marcos Henrich 4c99f5a645 [mono-symbolicate] Added Mono.Cecil sources.
Mono.Cecil.Mdb is not installed with mono.
Instead of reference Mono.Cecil.Mdb we now add its sources directly.
Mono.Cecil internals are visible to Mono.Cecil.Mdb, but not to
mono-symbolicate so we add Mono.Cecil source too.

Fixes mono-symbolicate not working with installed mono.
2016-09-19 17:02:54 +01:00
Alexander Köplinger a1ffb48bdf Merge pull request #3579 from radical/mcs-ignore-args
[mcs] Accept and ignore command line args supported by csc that we don't
2016-09-19 17:15:25 +02:00
Ankit Jain bbb050d0bd [mcs] Accept and ignore command line args supported by csc that we don't
.. support:

	/publicsign+
	/publicsign-
2016-09-19 11:09:55 -04:00
Marek Safar 2b2e902700 [mcs] Fixes codegen of predefined pointer arithmetic operators with user defined operator conversion for one of operands. Fixes #44440 2016-09-19 16:47:21 +02:00
Henric Müller ce1993f362 Fixes for ProcessTest on Windows
* Checking more error codes on whitespace tests.
* Using findstr instead of type to enable stdin/out pipes.
2016-09-19 16:28:30 +02:00
Niklas Therning 7de12c0fed Use the path of the current executable by default in soft debugger tests on
Windows to launch the child mono process

The 'mono' shell script generated by the Cygwin make file system doesn't work
when running the soft debugger tests against an MSVC built mono executable.
This patch first tries with the main module of the current process when
running on Windows (and mono is built using MSVC). If it looks like a mono
executable the tests will use it before falling back to the shell script.
2016-09-19 14:27:35 +02:00
Marek Safar b13b4c3e51 [bcl] Add more reflection types to monotouch 2016-09-19 13:23:16 +02:00
Marek Safar 293efaf0ac Merge pull request #3576 from ntherning/ignore-FileSecurityTest.EveryoneMayNotBeOwner-when-Administrator
Ignore the FileSecurityTest.EveryoneMayNotBeOwner test when running as Administrator
2016-09-19 12:48:19 +02:00
Marek Habersack 787b047886 [mkbundle] support satellite assemblies (#3448)
Satellite assemblies are special in that they all share the same file
name, but they live in separate directories named after the locale the
satellite assemblies pack. mkbundle currently doesn't support "clashing"
assembly filenames and will not be able to store the satellite
assemblies in the bundle for that reason.

This patch adds support for storing satellite assemblies with their
culture path prefix (e.g. en-US/MyAssembly.resources.dll) in the bundle
and also special code in the assembly loader to support such filenames
in the code which loads assemblies from the bundle.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=27061
2016-09-19 11:51:24 +02:00
Niklas Therning c32dafe7d7 Ignore the FileSecurityTest.EveryoneMayNotBeOwner test when running as
Administrator

This test fails when running as Administrator since Administrator CAN set the
owner to Everyone. This patch ignores the test when running as Administrator.
The check has to be done after the File.SetAccessControl() call that is
expected to fail since when we aren't running as Administrator the IsInRole()
check will trigger UAC which we need to prevent when possible.
2016-09-19 11:08:27 +02:00
Marek Safar 55d0f3f3ec Merge pull request #3573 from ntherning/replace-NUnit-Culture-with-SetCulture
Use NUnit's SetCulture attribute rather than Culture
2016-09-16 20:01:08 +02:00
Vlad Brezae 86044c84c2 [sgen] Trim worker gray queue after finishing concurrent mark
This was keeping around potentially many unused gray queue sections, or even constantly leaking in the case of many majors since every time we start a concurrent major we redirect some additional gray queue sections from main to worker thread gray queues, leading to unbounded growth. The gc thread always trims its gray queues at the end of the collection.

On graph8 this reduces memory usage by 5%. Fixes mem leak from #41995
2016-09-16 20:45:14 +03:00
Vlad Brezae 1a82fb7d51 [sgen] We don't need to trim the free list when finishing gray stack
We always dispose the gray queue at the end of the collection, which implies its trimming.
2016-09-16 20:45:14 +03:00
Vlad Brezae b39bc2adbb [sgen] Increase counter when actually allocating gray sections 2016-09-16 20:45:14 +03:00
Vlad Brezae 889b71116d Merge pull request #3562 from BrzVlad/fix-reverse-wbarrier
[jit] Fix missing wbarrier for array generic setter
2016-09-16 20:43:46 +03:00
Rodrigo Kumpera 1777aff514 Merge pull request #3565 from vargaz/no-free-imt-thunks
[runtime] Avoid freeing IMT thunks, some threads might still be execu…
2016-09-16 10:13:54 -07:00
Marek Safar 86a0c69448 [corlib] Add missing apis 2016-09-16 18:06:06 +02:00
Niklas Therning 5d51431e47 Merge pull request #3574 from ntherning/disable-tests-with-com-instantiation-on-mono-on-windows
Disable tests which instantiate COM objects on Windows
2016-09-16 17:04:13 +02:00
Niklas Therning 7357e0b738 Disable tests which instantiate COM objects on Windows
COM is not working on Mono on Windows and adding support for it is not a
priority at the moment.
2016-09-16 16:59:03 +02:00
Marek Safar 9cab66800c [System.Net.Http] Show invalid values added to HttpHeaderValueCollection. to Fixes #44413. 2016-09-16 15:48:44 +02:00
Marek Safar 0dfef7b345 [mcs] Delay array base type interfaces initialization. Fixes #44402 2016-09-16 15:48:44 +02:00
Marek Safar f1b81b256d Merge pull request #3564 from henricm/thread-safe-win32eventlog-notifications
Making Win32EventLog notification thread safe
2016-09-16 14:58:29 +02:00
Niklas Therning cd277c2a7b Merge pull request #3545 from ntherning/throw-AbandonedMutexException-on-unix
Correctly handle abandoned mutexes on non-Windows platforms
2016-09-16 14:57:21 +02:00
Niklas Therning 7f78849444 Use NUnit's SetCulture attribute rather than Culture
A few tests are currently ignored when running on a system where the default
culture isn't "en" or "en-US". This patch changes Culture attributes to
SetCulture attributes instead to make those tests run on all system and make
NUnit set the culture to the required one during the test run.

Also found and fixed a test failure in one of these methods,
DateTimeTest.ToUniversalTime_TimeZoneOffsetShouldNotOverflow(), which assumed
the minimum year is 0 while it's actually 1. Confirmed that this is the case
on .NET as well.
2016-09-16 14:55:24 +02:00
Henric Müller ab274967bc Making Win32EventLog notification thread safe
The _notifyResetEvent could be closed and nulled and the
NotifyEventThread would still try to read from the event log.
Also multiple calls to EnableNotification would cause issues.
With this fix, we make sure only one notify event thread is
running and that we thread safe the disabling of notifications.
2016-09-16 14:17:17 +02:00
Ludovic Henry dbb5d536e8 [runtime] Fix build 2016-09-16 11:48:47 +02:00
Ludovic Henry 1c9e34cce5 [threads] Check InternalThread.last just after checking corlib version 2016-09-16 11:46:46 +02:00
Bernhard Urban f11615a21d [io-layer] include w32mutex-utils.h (#3568) 2016-09-16 11:24:27 +02:00
Niklas Therning b8fadb959a Correctly handle abandoned mutexes on non-Windows platforms
When a thread owning a mutex doesn't release it before it exits and a second
thread tries to take it using e.g. Mutex.WaitOne() an AbandonedMutexException
should be thrown. This is what .NET and Mono on Windows does.

This commit builds on the work done in PR #2267, which modifies the Win32
emulation of WaitForSingleObjectEx(), SignalObjectAndWait() and
WaitForMultipleObjectsEx() to return WAIT_ABANDONED_0 when expected, and
updates it to the current HEAD. It also adds a few test methods to
WaitHandleTest that test that WaitHandle.WaitAny() and WaitHandle.WaitAll()
follows the .NET behaviour.
2016-09-16 11:07:38 +02:00
Niklas Therning 5dcbbab04e Correctly handle abandoned mutexes on non-Windows platforms
When a thread owning a mutex doesn't release it before it exits and a second
thread tries to take it using e.g. Mutex.WaitOne() an AbandonedMutexException
should be thrown. This is what .NET and Mono on Windows does.

This commit adds the infrastructure needed in the Win32 emulation layer to
coomunicate that a mutex has been abandoned. It builds on the work done in
PR #2267 and updates it to the current HEAD.
2016-09-16 11:06:38 +02:00
Marek Safar 9ed7e83881 [mcs] Report more errors for nameof expressions. Fixes #44168 2016-09-16 10:57:42 +02:00
Marek Safar 1e05158c3c Merge pull request #3566 from ntherning/fix-time-zone-issues-on-windows
Fixes time zone issues when running on Windows
2016-09-16 10:26:38 +02:00
Zoltan Varga 8612b548ee Revert "[loader] Tests for RefereceAssemblyAttribute support"
This reverts commit 31de4df835.

Revert this as the corresponding fix was reverted.
2016-09-15 19:44:10 -04:00
Aleksey Kliger 9f5115a343 [monodis] Don't segfault using cooperative GC.
monodis with coop enabled segfaulted in mono_thread_info_attach
2016-09-15 18:20:06 -04:00
Zoltan Varga 96006931db [winx64] Mark some inline functions static to hopefully fix the mxe build. 2016-09-15 14:06:25 -04:00
Zoltan Varga f732cb997b [runtime] Add a counter for the number of freed IMT trampolines. 2016-09-15 12:30:25 -04:00
Marek Safar 5e245bed38 [corlib] Use simple BinaryCompatibility as anywhere else 2016-09-15 17:22:23 +02:00
Marek Safar 39d34f4c0d [bcl] Fix few warnings 2016-09-15 17:12:38 +02:00
Marek Safar 9e1a781ab8 [man] Update few mcs sections 2016-09-15 17:11:53 +02:00
Niklas Therning c6e0d5d706 Fixes time zone issues when running on Windows
TimeZoneInfo.GetDaylightChanges() didn't work as expected when run against the
time zone data available in Windows.

This patch also enables most of the time zone related tests that were
previously ignored when not run on Unix platforms. Time zone ids will now be
mapped from tz db time zone names to Windows time zone names when needed so
that most of the tests can be run on Mono on Windows as well.
2016-09-15 16:18:05 +02:00
Marek Safar 14c783f1ec [build] Add System.Numerics.Vectors to xammac profile 2016-09-15 14:16:46 +02:00
Marek Safar b37ec02e2b [mcs] Improve member lookup rules when type parameter has both non-object effective base class and interface constraint(s) 2016-09-15 13:40:15 +02:00
Zoltan Varga 354d26c852 Revert "[runtime] Check for ReferenceAssemblyAttribute when loading for execution."
This reverts commit bc9461168e.

Revert this to see if it fixes the wrench build.
2016-09-15 07:37:46 -04:00
Zoltan Varga a36b4b2d82 [runtime] Avoid freeing IMT thunks, some threads might still be executing them. This creates a memory leak, but its bounded. Fixes #39832. 2016-09-15 07:35:18 -04:00
Ludovic Henry 6e25454765 [w32handle] Remove case where mutex and cond are busy (#3561)
This code path has not been used for a while now, as mono_os_(mutex|cond)_destroy return -1 in case of error, and not EBUSY.

This is also the only code path that would check the return value, so we can simply remove the returned value, and assert on the error.
2016-09-15 10:12:07 +02:00
Marek Safar a2ee7a92be Merge pull request #3559 from mistressofjellyfish/httpcookie
[System.Web] HttpCookie load defaults from Web.config
2016-09-15 08:55:06 +02:00
Marek Safar 4c788d5d19 Merge pull request #3558 from rolfbjarne/tests-system-dns-make-failures-not-crash-app
[System] Rewrite Dns tests so that failures don't cause the process to crash.
2016-09-15 08:52:44 +02:00
Vlad Brezae 59448e9b7a [jit] Fix missing wbarrier for array generic setter
The generic setter receives the element by reference which means we will never emit the write barrier since a reference to a reference is not a reference (mini_type_is_reference). Check the actual value instead. Fixes #42903.
2016-09-15 01:16:03 +03:00
Ludovic Henry 7eb2ea6476 [w32handle] Fix race condition when creating named mutex/event/semaphore (#3560)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=41914
2016-09-14 23:18:50 +02:00
Marek Safar 9006b7ac98 Merge pull request #3557 from ntherning/fix-time-zone-dst-in-delta-behaviour
Replicate .NET's TimeZoneInfo.IsDaylightSavingTime() and GetUtcOffset() behaviour when passed times within the lost period at DST start
2016-09-14 18:39:26 +02:00
Katharina Bogad 3f665b84fe [System.Web] HttpCookie load defaults from Web.config
HttpCookie now loads default values from the Web.config,
just like the reference source does.
2016-09-14 17:57:55 +02:00
Rolf Bjarne Kvinge c213a51b70 [System] Rewrite Dns tests so that failures don't cause the process to crash.
Previously the tests were written so that some failures might occur on the
threadpool in methods that did not catch exceptions. In that case the process
would terminate due to an unhandled exception. So rewrite the tests to catch
exceptions in any code that doesn't run on the main thread, and forward those
exceptions to the main thread.

Also wait for async operations to complete on the main thread, and remove
asserts that are not supposed to be hit.
2016-09-14 17:37:42 +02:00
Marek Safar 8f7a1683c2 [mcs] Move type constraints checks after base type definition. Fixes #44212 2016-09-14 15:42:26 +02:00
Niklas Therning 25e0b39715 Merge pull request #3536 from henricm/fix-machinename-ignorecase
Ignoring case for MachineName in EventLogTest
2016-09-14 14:57:03 +02:00
Niklas Therning 4f070dea31 Replicate .NET's TimeZoneInfo.IsDaylightSavingTime() and GetUtcOffset()
behaviour when passed times within the lost period at DST start

When passed a time within this period .NET's IsDaylightSavingTime() returns
true while GetUtcOffset() returns the BaseUtcOffset without the DST delta
added. This patch changes the behaviour in Mono to do what .NET does.
2016-09-14 12:00:07 +02:00
Marek Habersack d063541740 Set DefaultPersistentConnectionLimit to 10 for Xamarin.Android
This is to make it the same as the Xamarin.iOS setting and
fixes https://bugzilla.xamarin.com/show_bug.cgi?id=7467
2016-09-14 11:18:13 +02:00
Zoltan Varga 0bcbe39b14 [runtime] Rename IMT thunks to 'trampolines'. NFC. (#3555) 2016-09-14 02:56:20 +02:00
Ludovic Henry 7421216052 [io-layer] Extract Mutex, Semaphore and Event (#3553)
* [metadata] Move mutex managed support to seperate file

* [mutex] Extract CreateMutex

* [mutex] Extract ReleaseMutex

* [mutex] Extract OpenMutex

* [mutex] Extract wapi_mutex_abandon

* [mutex] Extract MonoW32HandleOps for mutex and named mutex

* [io-layer] Extract wapi_search_handle_namespace

* [metadata] Move semaphore managed support to seperate file

* [semaphore] Move _WapiHandle_sem and _WapiHandle_namedsem to semaphores.h

* [semaphore] Extract CreateSemaphore

* [semaphore] Extract ReleaseSemaphore

* [semaphore] Extract OpenSemaphore

* [semaphore] Extract MonoW32HandleOps

* [metadata] Move event managed support to seperate file

* [event] Extract CreateEvent

* [event] Remove dead code PulseEvent

* [event] Extract SetEvent

* [event] Extract ResetEvent

* [event] Extract OpenHandle

* [event] Extract MonoW32HandleOps

* [w32handle] Extract namespace locking

* [io-layer] Inline only use of wapi_shm_sem_lock/wapi_shm_sem_unlock
2016-09-13 23:40:58 +02:00
Ludovic Henry 334494de14 [hybrid-aot] Add runtime support (#3556)
* [aot-compiler] Add generic class and gsharedvt for hybrid AOT mode

* [aot-compiler] Remove dead code

* [hybrid-aot] Add --hybrid-aot for future use
2016-09-13 23:40:01 +02:00
Ludovic Henry bdaef1e697 [threads] Import mono_thread_info_set_priority (#3543)
* [mono-threads] Remove MonoThreadParm.creation_flags

* [mono-threads] Remove MonoThreadParm.priority and set to MONO_THREAD_PRIORITY_NORMAL by default

* [threads] Wrap use of mono_thread_info_(get|set)_priority

* [threads] Store priority on MonoInternalThread

* [threads] Import mono_thread_info_set_priority

* [mono-threads] Remove MonoThreadParm
2016-09-13 18:41:29 +02:00
Marek Safar a26fda4e8c [System] Don't compress custom http headers in httplistener response. Fixes #34715 2016-09-13 16:11:43 +02:00
Zoltan Varga 2ffa920376 [runtime] Pass the initial context to mono_walk_stack_with_ctx () in mono_stack_walk_async_safe (). Hopefully fixes #44164. 2016-09-13 08:58:17 -04:00
Vlad Brezae fd3f90982a Merge pull request #3534 from BrzVlad/fix-conc-gcstress-mem
[sgen] Fix conc gcstress mem
2016-09-12 23:27:39 +03:00
Rodrigo Kumpera 3470747e29 Merge pull request #3541 from kumpera/add-tas-to-threading
[abort] Reduce the race window when doing Monitor:Enter.
2016-09-12 16:05:28 -04:00
Zoltan Varga 5a3736606e Bump version to 4.9.0 2016-09-12 20:59:46 +02:00
monojenkins 4e441ecc2a Merge pull request #3549 from lewurm/arm64-icache-big-little-fix
[arm64] fixes around icache flushing


This fixes https://bugzilla.xamarin.com/show_bug.cgi?id=39859

The problem in `emit_thunk` and the workarounds for the Cortex A53 errata are unrelated to the bug above, but they don't hurt either.

The basic problem that we see is that the Exynos 8890 SoC (shipped for example in the world edition of the Samsung Galaxy S7) is a big.LITTLE architecture with two different CPUs, four of each. `__clear_cache` of GCC [1], the built-in that we use to flush the instruction cache, correctly reads the cache line sizes for data- and instruction cache from the CPU and then caches that result. However, the two CPUs on the Exynos 8890 have two different cache line sizes for the instruction cache (128 bytes vs. 64 bytes): If we happen to initialize the cache line sizes with the larger one, we only flush every other cache line if the code runs on the second CPU model.

Neither V8 [2] and LLVM [3] do caching of the cache line sizes, but just read it every time from the register.  We have a slightly different solution, where we cache _and_ read the value every time and try to determine a global minimum across CPUs, in case we get scheduled to a different CPU by the kernel during the flushing loop.


[1] https://android.googlesource.com/toolchain/gcc/+/master/gcc-4.9/libgcc/config/aarch64/sync-cache.c#33
[2] https://github.com/v8/v8/commit/fec99c689b8587b863df4a5c4793c601772ef663
[3] https://github.com/llvm-mirror/compiler-rt/blob/ff75f2a0260b1940436a483413091c5770427c04/lib/builtins/clear_cache.c#L146
2016-09-12 18:30:08 +01:00
Marek Safar 104fd9c638 Merge pull request #3535 from henricm/fix-always-use-preamble-length
Removing hard coded preamble length
2016-09-12 16:52:30 +02:00
Vlad Brezae ed81b4bd0a [sgen] Free major sections in bulk also on 64bit
On coreclr-gcstress this reduces the OS vmem maps by more than half.
2016-09-12 17:28:52 +03:00
Vlad Brezae f8c983b0e8 [sgen] Adjust free-ing of empty blocks
After sweep, depending on the computed allowance, we are freeing empty blocks so that we still keep around enough blocks to fill that allowance (to avoid repeated vmaps).

On both collectors this had the problem that the allowance also accounts for LOS space, which we shouldn't account for in major section heuristics (which means that in LOS intensive benchmarks we only free major sections after the LOS shrinks).

On the concurrent collector, where we have a negative allowance adjustment depending on the duration of the concurrent mark (in order to mimic serial memory usage), we can have very small allowances at the end of a major collection, even 0. This means that we would reserve no empty blocks for later use.

We solve these issues by reserving empty blocks relative to the amount of current alive blocks, which is also the basis of how we compute the allowance in the first place.
2016-09-12 17:28:52 +03:00
Vlad Brezae e6cec7897e [runtime] Replace uses of alloc functions with glib variants 2016-09-12 17:28:52 +03:00
Mark Probst 883e0a2d89 [utils] Fix internal allocator header size.
The header is always just a pointer.
2016-09-12 17:28:52 +03:00
Mark Probst 56226f83f5 [runtime] Counters for allocated virtual memory. 2016-09-12 17:28:52 +03:00
David Karlaš 8576b11c77 Merge pull request #3552 from DavidKarlas/getScopeChanges
[Debugger] GetLocals was throwing NullReferenceException(li.scopes_start) if ran against older runtime
2016-09-12 14:58:54 +02:00
David Karlaš ca1db0bc7e [Debugger] GetLocals was throwing NullReferenceException(li.scopes_start) if ran against older runtime
Added logic to make sure user of API handles version checking when calling GetScope
Made properties in LocalScope class public
2016-09-12 13:01:27 +02:00
Emil Sandstø 5a4a9a0e8a [threads] Correct the spin waiting in 'sleep_interruptable' (#3544)
After https://github.com/mono/mono/commit/089c47f1c07bf250d76c36e04675569fc6f5b4ba#diff-e7e458b6256eaa730c145f14a666652aR1141
the code started to use nanoseconds instead of milliseconds. The problem was that this caused 'sleep_interruptable' to spin wait the last millisecond before the wait was over, https://bugzilla.xamarin.com/show_bug.cgi?id=44132.

Fix https://bugzilla.xamarin.com/show_bug.cgi?id=44132
2016-09-12 12:19:00 +02:00
Alex Rønne Petersen 0a0be23e6f Merge pull request #3550 from alexrp/revert-tp-monitor
Revert "[threadpool-ms] Switch Monitor thread to a MonoThreadInfo (#3538)"
2016-09-11 16:19:41 +02:00
Alex Rønne Petersen 6f6987a257 Revert "[threadpool-ms] Switch Monitor thread to a MonoThreadInfo (#3538)"
This reverts commit 2f88b8eb5a.

There is a subtle problem with turning the monitor thread into a simple
MonoThreadInfo: It creates worker threads via mono_thread_create_internal (),
which allocates the thread object from the GC. No thread can allocate from
the GC unless it's actually attached, which the worker thread is not when
created with just mono_threads_create ().
2016-09-11 15:44:56 +02:00
Zoltan Varga ea15e2c577 [runtime] Remove some dead code. 2016-09-10 00:51:15 +02:00
Bernhard Urban 44520cdd9c [arm64] use dc civac instead of dc cvau
suggested workaround for some Cortex A53 bugs, inspired by V8:
https://github.com/v8/v8/commit/fec99c689b8587b863df4a5c4793c601772ef663
2016-09-10 00:43:40 +02:00
Bernhard Urban 802cf1dfbe [arm64] manually flush icache
should fix https://bugzilla.xamarin.com/show_bug.cgi?id=39859
2016-09-10 00:42:58 +02:00
Bernhard Urban 48c3c08e30 [arm64] flush whole emitted thunk 2016-09-09 23:53:41 +02:00
Ludovic Henry 2f88b8eb5a [threadpool-ms] Switch Monitor thread to a MonoThreadInfo (#3538) 2016-09-09 23:41:34 +02:00
Zoltan Varga aaed951757 Remove a debug printf. 2016-09-09 20:08:06 +02:00
Zoltan Varga 038def9851 Add missing file. 2016-09-09 19:59:45 +02:00
Zoltan Varga 7e3028c2c8 [sdb] Add a MethodMirror:GetScopes () method which returns scope information. 2016-09-09 19:58:59 +02:00
cmp 55125d38c9 Remove obsolete stack limit checks on Windows
mono_thread_info_get_stack_bounds has been updated to correctly report
the stack reserved base address quite some time ago.
Remove a couple of checks that still assume the old behavior of
reporting the committed base address.
2016-09-09 18:25:40 +01:00
Ludovic Henry a81a6173b8 [threads] Add specific field to check size (#3542) 2016-09-09 16:23:34 +02:00
Ludovic Henry 348d793ebb [threadpool-ms] Replace win32 semaphore by coop semaphore (#3519) 2016-09-09 12:09:18 +02:00
Ludovic Henry 299b257efb [mono-threads] Fix lifetime of MonoThreadInfo->handle (#3539)
This handle should have a total of maximum 3 copies:
 - in MonoThreadInfo->handle
 - in the return value of mono_threads_create_thread
 - in MonoInternalThread->handle (if it's a managed thread)

Before, there would always be 2 references (in MonoThreadInfo->handle and another another for MonoInternalThread->handle), even if it would be referenced at one place only (MonoThreadInfo->handle), which would lead to a handle leak.

We also need to duplicate the returned handle, to avoid having a use-after-free of the handle (in case the thread exits before we access that handle)
2016-09-09 11:38:30 +02:00
Zoltan Varga 2acdc49ff6 [llvm] Disable llvm again for methods with large basic blocks in non-llvm-only mode, the workaround doesn't seem to work. Fixes #42395. 2016-09-09 03:14:24 +02:00
monojenkins c8ab84a20a Merge pull request #3540 from kumpera/abort-on-gerror
[logging] Fix g_error not aborting.

Once we enabled g_log redirection, we stopped aborting as the new handlers didn't behave like eglib.
2016-09-09 01:45:04 +01:00
Vlad Brezae 3fd54893bc Merge pull request #3528 from BrzVlad/fix-sgen-check-before-collections
[sgen] Fix sgen debug flags
2016-09-09 02:54:48 +03:00
Rodrigo Kumpera 60e0a82be2 [runtime] Reduce the race window when aborting Monitor:Enter.
If you abort a thread that is doing a Monitor:Enter, if the syscall abort lands before
the target thread start waiting it will block in a non aletable way.

To address that, we start by waiting in an alertable way and if interrupted we
decide to continue or not based on whether an abort can start.

Additionally, when alertable, we CAS the thread state to catch early Thread:Abort
calls that set the state by did not managed to init it.

This fixes a rare deadlock on tests/monitor-abort.exe.
2016-09-08 16:08:40 -07:00
Rodrigo Kumpera 6040e79f92 [threads] Add mono_threads_is_ready_to_be_interrupted helper to figure out whether a thread is ready to be interrupted. 2016-09-08 16:08:40 -07:00
Rodrigo Kumpera cfeda495ea [threading] Introduce mono_thread_test_and_set_state to manipulate thread state.
Unconditional state transitions are really bad since they don't allow threads
to coordinate between themselves.
2016-09-08 16:08:39 -07:00
Rodrigo Kumpera 045c8d9982 [logging] Fix g_error not aborting. 2016-09-08 15:58:08 -07:00
Ludovic Henry 668ee608eb [threads] Factor common attach code in mono_thread_attach_internal (#3530)
* [threads] Allocate StartInfo in create_thread

* [threads] Put start_notify semaphore in StartInfo

* [threads] Factor common attach code in mono_thread_attach_internal

* [threads] Use same registered mechanism as mono-threads
2016-09-08 17:17:28 +02:00
Niklas Therning 8468603a7c Merge pull request #3537 from ntherning/fix-failing-ThreadTest-tests-on-windows
Remove Assert.Fail() calls in ThreadTest when running on Windows
2016-09-08 16:31:58 +02:00
Niklas Therning 17d5e53ac8 Remove Assert.Fail() calls in ThreadTest when running on Windows
The tests that fail like this actually work just fine on Mono on Windows.
Added the NotDotNet category to the CurrentThread_Domains() test since it
fails on .NET.
2016-09-08 15:28:34 +02:00
Henric Müller 8fd49882a5 Ignoring case for MachineName in EventLogTest 2016-09-08 14:57:44 +02:00
Jonathan Chambers 12d1d63b8a Avoid race condition between domain unload and threadpool. (#3491)
* Avoid race condition between domain unload and threadpool.

Previous logic only ensured that domain->threadpool_jobs was 0.
There was a race condition as follows:
* worker jobs are queued into ThreadPoolDomain outstanding_request's
* domain unload starts
* domain->threadpool_jobs is 0 so unload proceeds
* queued jobs are processed from the ThreadPoolDomain outstanding_request's
* the domain can be set/entered by worker threads since
  mono_domain_set only fails for domains with state of MONO_APPDOMAIN_UNLOADED,
  while our domain is in the MONO_APPDOMAIN_UNLOADING state
* jobs are now being unexpectedly run in domain that is being shutdown

* Fix a hang when unloading the domain.

This change applies the diff from ludovic-henry to correct the hang.

https://gist.github.com/ludovic-henry/6c8a4bc8951091c0ef36df2e52d5e32e
2016-09-08 14:28:59 +02:00
Henric Müller 3ce9192edf Removing hard coded preamble length
For some reason preamble length was asumed to be 3 when cp 65001
instead of always looking att the preamble length of the encoding.
This resulted in responses cropped by 3 chars on windows.
2016-09-08 14:15:32 +02:00
Alexander Köplinger 43ffa41898 Merge pull request #3532 from alexrp/profiler-stress-tests
[acceptance-tests] Add profiler-stress suite.
2016-09-08 07:23:40 +02:00
Alex Rønne Petersen 7d7b674ac5 [acceptance-tests] Add profiler-stress suite. 2016-09-08 07:04:39 +02:00
Alex Rønne Petersen 8f3dacc509 Merge pull request #3531 from alexrp/master
[profiler} Don't crash if a zero sampling frequency is given.
2016-09-08 03:18:40 +02:00
Alex Rønne Petersen e5a68998b7 [profiler} Don't crash if a zero sampling frequency is given. 2016-09-08 02:20:32 +02:00
Henric Müller f577b619e9 Moving WSAGetLastError calls closer to socket operation (#3450)
* When doing async connect on windows, connect returns `WSAEINPROGRESS`
which needs to be returned to managed code for correct handling. However
on Windows, last error gets reset before `WSAGetLastError` is called.
This fix moves all `WSAGetLastError` calls up closer to the socket
operation to make sure correct error code is returned to the managed code.

* Making sure `TcpNoDelay` is set to false for IPv4 by default and
that `DualMode` is default for IPv6.

* Making sure option value is set to 0 before calling getsockopt
because on Windows, a `BOOL` option value (eg TcpNoDelay) is returned
as a one byte value and the other bytes are left untouched which resulted
in TcpNoDelay always seemed to be true.

* Fixed so `TF_REUSE_SOCKET` is set only if `reuse` parameter is set
when disconnecting a socket.
2016-09-07 15:30:55 +02:00
Niklas Therning a231b0a82c Merge pull request #3511 from henricm/fix-no-socket-reuse
Not reusing sockets in dual mode tests
2016-09-07 15:23:54 +02:00
Henric Müller 67cdb99406 Using running process to determine mono exe path on windows
Extracting mono, mcs, vbnc, al and gac path lookup to a common class.
On windows we now also check the running process to try to determine
the mono.exe.
2016-09-07 14:49:10 +02:00
Ludovic Henry f4d9546f3c [threads] Remove CREATE_SUSPENDED (#3529)
* [threads] Remove use of CREATE_SUSPENDED for domain unload thread

* [threads] Remove use of CREATE_SUSPENDED for managed thread

* [threads] Remove CREATE_SUSPENDED
2016-09-07 14:28:46 +02:00
Alex Rønne Petersen 1fd62ac204 Merge pull request #3526 from alexrp/master
[sgen] Don't consider managed write barriers to be critical methods.
2016-09-07 03:00:48 +02:00
Vlad Brezae ad563e4352 [sgen] Make sure we don't sweep a block if we're not supposed to
If the sweeping mechanism has been triggered by a major collection, then the iteration will wait for the general sweeping to finish and also for the sweeping of all the blocks. If this isn't the case (we are doing a major collection) we will iterate over the current state of the heap, some objects being bound to die during the collection, and the callback must account for this.

It doesn't make much sense to explicitly attempt to iterate without trying to sweep blocks that can be swept.
2016-09-07 03:14:32 +03:00
Manu d251fcc2cd Rename local file into socket_fd (#3524)
This is to avoid hiding the static gint `file` and to better understand the code.
2016-09-07 00:28:16 +02:00
Ludovic Henry cf29167326 Merge pull request #3509 from ludovic-henry/iolayer-extract-threading
[mono-threads] Keep cleaning up mono-threads after iolayer extraction
2016-09-07 00:18:23 +02:00
Alex Rønne Petersen 2cfd9db070 [sgen] Don't consider managed write barriers to be critical methods.
When we emit calls to them, we also emit an OP_DUMMY_USE instruction to keep
the object alive, so it is OK for the GC to interrupt write barriers now.
2016-09-06 20:51:13 +02:00
Vlad Brezae 4d577807ed [sgen] Remove unused and potentially wrong case from major object iteration
We never enter this case since we never iterate over the major objects without requiring to sweep, while a sweep is running. Even if we would be in this case, we directly access the mark bits which can be cleared at the same time by another thread sweeping the block, so we could miss live objects.
2016-09-06 20:01:28 +03:00
Vlad Brezae e8bf41f58d [sgen] Fix mod union consistency check
We don't need a mod union to mark an object with concurrent mark&sweep.
2016-09-06 19:59:24 +03:00
Vlad Brezae 743a184be0 [sgen] Don't do remset consistency checks during majors
It doesn't make sense to check the remset during a major since majors dont use the cardtable and we clear it at the start. So we will obviously have missing remsets. For the debugging concurrent case, we should use the mod union consistency checks instead.
2016-09-06 19:59:23 +03:00
Vlad Brezae 971883045a [sgen] Don't verify the heap after a major
We would need to deal with scanning forwarded objects and dead objects which is not worth it. Only verify the heap at the start of a collection, as indicated by the name of the flag.
2016-09-06 19:59:23 +03:00
Vlad Brezae a6914676d1 [sgen] Fix missing remsets with verify before collections
When verifying the heap we need to have the set of pinned objects otherwise we can observe missing remsets if suspended between the store and the write barrier. If we don't have the set of pinned objects, allow missing remsets.
2016-09-06 19:59:22 +03:00
Ludovic Henry fa41710fe0 [mono-threads] Have error in case we cannot set thread priority 2016-09-06 17:01:27 +02:00
Ludovic Henry f4f7bf559b [mono-threads] Fix win32 to posix priority conversion 2016-09-06 17:01:26 +02:00
Ludovic Henry 22fdfbfafe [mono-threads] Store handle related data in MonoThreadInfo 2016-09-06 17:00:02 +02:00
Ludovic Henry e687b1277e [mono-threads] Assert that we do not try to signal the handle multiple times 2016-09-06 17:00:00 +02:00
Alexander Köplinger faf790bd02 Merge pull request #3518 from akoeplinger/fix-fileiopermission
[corlib] Ensure FileIOPermission ctor is not called on mobile
2016-09-06 15:17:30 +02:00
Alexander Köplinger 5e6fdbd71d [corlib] Ensure FileIOPermission ctor is not called on mobile
After https://github.com/mono/mono/pull/3452 was merged, the LinkSdkRegressionTest.SecurityDeclaration
test in XI started failing:

```
	[FAIL] LinkSdkRegressionTest.SecurityDeclaration :   FileIOPermissionAccess
  Expected: null
  But was:  <System.Security.Permissions.FileIOPermissionAccess>

		  at LinkSdk.LinkSdkRegressionTest.SecurityDeclaration () [0x00033] in /Users/builder/data/lanes/1411/2a96404f/source/xamarin-macios/tests/linker-ios/link sdk/LinkSdkRegressionTest.cs:990
		  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
		  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/data/lanes/1411/2a96404f/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
```

Due to the added call in the PR the linker preserved FileIOPermissionAccess enum,
which is apparently something we want to avoid.

Since according to https://github.com/mono/mono/pull/3452#discussion_r76384945 the only point of calling the
FileIOPermission is validating that the path doesn't contain invalid characters (mostly an issue on Windows),
I decided to just copy those checks as it's way cleaner.
2016-09-06 12:27:26 +02:00
Alexander Köplinger ef85a70d45 Merge pull request #3525 from henricm/fix-access-level-get-token
Using max level allowed when getting current token
2016-09-06 12:24:39 +02:00
Henric Müller f99d80d3be Using max level allowed when getting current token
Reference source of WindowsIdentity is using `MAXIMUM_ALLOWED`
as desired level by default when getting current token.
Changing to same behaviour to enable duplicate and impersonation
to be made on the token retrieved by GetCurrentToken.
2016-09-06 10:08:50 +02:00
Miguel de Icaza a14e0d7c4b [mcs/Makefile] make the 'btest' (bootstrap test) target work again 2016-09-05 21:39:03 -04:00
Zoltan Varga 534f48a15d [jit] Unify the handling of 'error' and 'exc' in the llvm-only and non llvm-only runtime invoke code. Fixes #41961. 2016-09-06 02:22:03 +02:00
Joshua Peterson 895f3f5ae8 Better handle marshaling of packed types (#3508)
* This improves the marshaling for packed classes and class involved in an inheritance hierarchy.
* Similar changes were made in the Unity fork of mono across a number of commits.
* The tests here have been taken from the repo and converted to work as NUnit tests in Mono.
2016-09-05 23:43:55 +02:00
Zoltan Varga 56ec616f73 [jit] Emit a dummy call after calls to Type.GetType () in llvm-only mode to prevent clang from transforming the call to a tail call which would cause the stack walk done by GetType () to find the wrong frame. Fixes #41956. 2016-09-05 23:02:08 +02:00
Alexander Köplinger b41a4217cc Merge pull request #3521 from ntherning/fix-failures-in-RegistryKeyTest-on-windows
Fix for failures in RegistryKeyTest on Windows
2016-09-05 18:17:22 +02:00
Alexander Köplinger beedbc9116 Merge pull request #3520 from ntherning/fix-ModuleTest-too-long-temp-folder-path-on-windows
Prevent ModuleTest failures due to too long temp folder path on Windows
2016-09-05 17:39:33 +02:00
Niklas Therning 48416ee7ac Fix for failures in RegistryKeyTest on Windows
Refcatored Win32RegistryApi.SetValue() to accept uint/byte/etc values for
DWord registry values.

Added handling of ERROR_CHILD_MUST_BE_VOLATILE errors to GenerateException().

Centralized MarkedForDeletion error handling to GenerateException().

Fixed tests which create volatile subkeys in RegistryKeyTest which used the
same key names but didn't clean up properly.
2016-09-05 15:15:11 +02:00
Alexander Köplinger 71694e1e9d Merge pull request #3505 from ntherning/fix-resource-lookup-in-ResourceReaderTest-on-mono-on-windows
Lookup of test resource files in ResourceReaderTest fails on Windows
2016-09-05 13:42:57 +02:00
Niklas Therning db075cce35 Prevent ModuleTest failures due to too long temp folder path on Windows
On Windows the TearDown() cannot delete the temp folder since it contains
loaded assemblies. The next time the test is run it will create a temp folder
inside the previous folder. After a number of runs the temp folder path will
approach the ~260 max path supported on Windows and some of the methods will
start failing.

This patch changes the way the temp folder is created and reduces the depth in
the same way as AssemblyTest was patched to fix a similar issue in
b90617e7b7.
2016-09-05 13:31:51 +02:00
Vlad Brezae 6829e52344 [sgen] Remove unused parameter
We never do nursery collections as part of the concurrent finishing pause
2016-09-05 14:12:00 +03:00
Niklas Therning a611abd2d8 Lookup of test resource files in ResourceReaderTest fails on Windows
Removed the differing code paths in FixtureSetUp() when running on non-Windows
platforms vs when running Mono on Windows or on .NET. The path previously
taken only on non-Windows platforms has been verified to work as expected on
both Mono on Windows and on .NET.
2016-09-05 10:45:26 +02:00
Alexander Köplinger 9d40383ca9 [Dataflow] Bump timeouts in TransformBlockTest.DeferredUsage
It failed a couple of times according to the babysitter logs with the following error:

```
MESSAGE:
Expected and actual are both <System.Int32[10]>
  Values differ at index [1]
  Expected: -1
  But was:  0
```

Bump timeouts a little bit to see if this helps.
2016-09-04 20:11:36 +02:00
Alexander Köplinger d06a5075a8 Merge pull request #3514 from ntherning/more-reliable-g_get_home_dir-on-windows
Prefer SHGetKnownFolderPath() in g_get_home_dir() over HOMEDRIVE/HOMEPATH environment variables
2016-09-04 11:12:01 +02:00
Alex Rønne Petersen 2a96404f87 Merge pull request #3517 from alexrp/master
[man] Update mprof-report.1 to cover new profiler options.
2016-09-03 22:14:16 +02:00
Niklas Therning 16bfa4ec2f Prefer SHGetKnownFolderPath() in g_get_home_dir() over HOMEDRIVE/HOMEPATH
environment variables

Relying on the HOMEDRIVE/HOMEPATH environment variables is fragile as those
variables don't always have to be set. One such scenario is when running on a
Jenkins slave. When not set g_get_home_dir() in eglib would return NULL which
led to a crash in ves_icall_System_Environment_InternalGetHome().

This patch changes g_get_home_dir() to first try to call
SHGetKnownFolderPath() to get the current user's profile directory (i.e. home
dir). If that fails it falls back to the USERPROFILE environment variable. If
that isn't available the function will fallback to the original behavior and
try with HOMEDRIVE/HOMEPATH.
2016-09-03 22:10:59 +02:00
Alex Rønne Petersen bc8a54795e [man] Update mprof-report.1 to cover new profiler options.
Also reformat some sections a bit.
2016-09-03 17:05:52 +02:00
Zoltan Varga 8c239d6e51 [SRE] Move the resolving of user types to managed code, the runtime was not using write barriers. (#3515) 2016-09-03 04:08:40 +02:00
Zoltan Varga 462dd05a95 [runtime] Fix a C&P problem introduced by d4052c5563. 2016-09-03 02:59:20 +02:00
Zoltan Varga 5589845bf3 [SRE] Remove empty TypeBuilder:setup_generic_class () icall. 2016-09-02 21:39:53 +02:00
Zoltan Varga d5321089bb [runtime] Remove the stub of ves_icall_TypeBuilder_create_internal_class (). 2016-09-02 21:33:26 +02:00
Zoltan Varga 8638f0605f [corlib] Fix the signature of a few SRE icalls, they already receive a TypeBuilder as the 'this' argument. 2016-09-02 21:30:29 +02:00
Aleksey Kliger (λgeek) c8287cd329 Merge pull request #3446 from lambdageek/bug-42584
[loader] Check for ReferenceAssemblyAttribute when loading
2016-09-02 10:31:42 -04:00
Marek Safar 7e19f1f62b [mcs] Adjust correctly newline counter inside pragma warning 2016-09-02 16:21:25 +02:00
Marek Safar 1a69613fde [corlib] Add timeout to failing test 2016-09-02 15:46:07 +02:00
Marek Safar bc54b1ed7b Merge pull request #3506 from ntherning/make-ZoneTest-succeed-on-mono-on-windows
Make Zone.CreateFromUrl() work with URLs like file://C:\foo\bar
2016-09-02 15:01:32 +02:00
Marek Safar 2ad252a24f Merge pull request #3452 from ntherning/fix-AppDomainSetupTest-on-windows
Validate AppDomainSetup.ApplicationBase path more like .NET does
2016-09-02 11:25:15 +02:00
Henric Müller 54606e4880 Not reusing sockets in dual mode tests
Creating new sockets between each connect instead of
trying to reuse the client socket. The original tests
was not working in the MS .NET runtime and socket reuse
is not recommended to use unless in very special cases.
2016-09-02 11:09:30 +02:00
Marek Safar ceb298c91e [System.Core] Allow TryConvert to return null for any reference types (not only object). Fixes #41509 2016-09-02 11:02:52 +02:00
Aleksey Kliger bc9461168e [runtime] Check for ReferenceAssemblyAttribute when loading for execution. 2016-09-01 17:53:26 -04:00
Aleksey Kliger 31de4df835 [loader] Tests for RefereceAssemblyAttribute support 2016-09-01 17:53:26 -04:00
Aleksey Kliger c9232d7c61 [runtime] Add mono_assembly_get_reference_assembly_attribute
Checks whether the given assembly has the
System.Runtime.CompilerServices.ReferenceAssemblyAttribute applied.
2016-09-01 17:52:14 -04:00
Rodrigo Kumpera 1a337a898c Merge pull request #3455 from kumpera/abort_cctor
[runtime] Don't abort .cctors. Fixes #43320
2016-09-01 17:49:32 -04:00
Ludovic Henry 012e176979 [mono-threads] Factor common platform create thread code (#3484) 2016-09-01 21:22:51 +02:00
Miguel de Icaza bb1eda94c0 Bundle other options (#3501)
* [mkbundle] add support for baking environment variables, make endian-independent

* [runtime] Bundle support, implement missing stream processing
2016-09-01 12:58:48 -04:00
Alexander Köplinger 5c36996721 Merge pull request #3498 from mattleibow/bug-41723
[Mono.Data.Sqlite] Added checks for entry point existence
2016-09-01 18:17:46 +02:00
Niklas Therning 3a2063b071 Make Zone.CreateFromUrl() work with URLs like file://C:\foo\bar
On Windows the test used URLs like `file://C:\tmp\foo` which the
Mono.Security.Uri class was incapable of parsing. System.Uri from
referencesource parses such URLs just fine. This patch fixes the Uri class to
be able to parse such URLs. It also changes the Zone class to not throw an
exception if the Zone.CreateFromUrl() method is passed an invalid URL. Instead
the zone is set to NoZone. This seems to be how Zone in .NET behaves.
2016-09-01 16:43:50 +02:00
Niklas Therning 4a066c4504 Merge pull request #3503 from ntherning/fix-MarshalTest.GetHINSTANCE-on-mono-windows
Ignore the MarshalTest.GetHINSTANCE() test on Mono on Windows
2016-09-01 16:41:58 +02:00
Niklas Therning 72c153f098 Merge pull request #3504 from ntherning/fix-PropertyInfoTest.ConstantValue-fails-to-delete-locked-file-on-windows
PropertyInfoTest.ConstantValue() shouldn't fail if temp file cannot be deleted
2016-09-01 16:41:17 +02:00
Niklas Therning c862a7b423 PropertyInfoTest.ConstantValue() shouldn't fail if temp file cannot be deleted
Happens when running this test on Windows. Just swallow the exception if the
File.Delete() fails.
2016-09-01 16:30:40 +02:00
Niklas Therning 133e8a43cb Ignore the MarshalTest.GetHINSTANCE() test on Mono on Windows
Won't work on Mono even when running on Windows.
2016-09-01 16:25:01 +02:00
Matthew Leibowitz f44e145ac5 [Mono.Data.Sqlite] Using the Version class to do the version comparison correctly 2016-09-01 16:02:44 +02:00
Miguel de Icaza be3d436e4a Typo fix 2016-09-01 09:22:16 -04:00
Jo Shields 02f0dd9660 Add a man page for cert-sync (#3424) 2016-09-01 09:21:15 -04:00
Zoltan Varga 4664161ae3 [runtime] Add a mono_threads_close_thread_handle () function and use it to close thread handles instead of CloseHandle (). (#3497) 2016-09-01 13:34:00 +02:00
Bernhard Urban 097c8e17cb Merge pull request #3492 from lewurm/fix-insert-insn
[mini] emit sequence point before branching off for tail call [was: respect seq points when adding instruction at end of block]
2016-09-01 07:22:17 +02:00
monojenkins 49a0494ecb Merge pull request #3499 from kumpera/fix_logging
[logging] Ensure glib logging redirection and remove unwanted new pub api functions.
2016-09-01 03:40:12 +01:00
Matthew Leibowitz b70d1330a7 [Mono.Data.Sqlite] Instead of try/catch and dlopen/dlsym, use a cross-platform, correct way of determining API features: version 2016-09-01 04:09:00 +02:00
Rodrigo Kumpera 8abb08a8cf [threading] Update comments. 2016-08-31 17:49:48 -07:00
Rodrigo Kumpera 4729a107b1 [runtime] Introduce abort protected blocks. Use it within async invokes and unhandled exceptions.
There are a few places in the runtime that should not be aborted as it would render it unusable.

cctor execution was the initial trigger for this changeset, but then edge triggering of TAE turned out
to expose this issue on other places.

This patch introduces those regions and apply them to the following places:

ves_icall_System_Runtime_Remoting_Messaging_AsyncResult_Invoke: Not delivering the completed CB
screws up any completion logic the user setup up.

mono_unhandled_exception: Protect delivery of the unhandled exception. Can't fail during it or we'll
effectively double fault and abort.
2016-08-31 17:45:31 -07:00
Rodrigo Kumpera 1764718ce5 [runtime] Add test for the interactions between thread abort and .cctors.
This covers bug #43320
2016-08-31 17:45:31 -07:00
Rodrigo Kumpera 152a3943ae [runtime] Don't start aborting a thread if it's running any .cctor. Fixes #43320.
A thread abort must not start if the thread is running a .cctor.
OTOH, if the cctor self aborts, it should start.

Threads now track how many cctors they are running in the cctor_exec_depth variable.

The abort machinery (in async_abort_critical) checks that flag and bail from
starting the abort.

The cctor code (in mono_runtime_class_init_full) ensures that cctor_exec_depth is bumped
around execution of the cctor itself. Additionally, error handling was cleaned up as it was pretty
inconsistent.
2016-08-31 17:45:31 -07:00
Rodrigo Kumpera 48d1f5cd09 [runtime] Add mono_current_thread_has_handle_block_guard callback to the runtime EH callbacks.
This callback allows the runtime to query mini on whether there's a block guard in play.
It allows for the runtime to correctly decide when to start an abort.
2016-08-31 17:45:31 -07:00
Rodrigo Kumpera 168394fb2f [logging] Ensure that glib logging goes through the new logging mechanics and that the domain prefix is preserved.
Call g_log_set_default_handler in mono_trace_set_log_handler and mono_trace_set_log_handler_internal to ensure that g_ logging is properly routed.

Additionally, change the internal logging callback to take the log message as a single string to simplify things.
2016-08-31 17:43:36 -07:00
Matthew Leibowitz d2c68ea932 [Mono.Data.Sqlite] Make the fields read-only 2016-09-01 01:28:06 +02:00
Matthew Leibowitz 4ca0a0b853 [Mono.Data.Sqlite] Added iOS specific checks for entry point existence:
- using dlfcn.dlsym to avoid P/Invoke exceptions
2016-09-01 01:25:04 +02:00
Rodrigo Kumpera e669004045 [logging] Move internals that were landed in public headers by mistake. 2016-08-31 16:23:56 -07:00
Zoltan Varga da7e234b3c [runtime] Fix a warning. 2016-09-01 01:15:54 +02:00
Alex Rønne Petersen b877d6f3d9 [profiler] Fix some off-by-ones in header size calculation. 2016-09-01 01:03:55 +02:00
Alex Rønne Petersen e36583e871 Merge pull request #3493 from alexrp/master
Follow-up PR for #3481
2016-09-01 01:03:41 +02:00
Zoltan Varga 5621b5878b [corlib] Disable CS0169 for RuntimeStructs.cs. 2016-09-01 00:59:30 +02:00
Zoltan Varga 2cab627a7c [llvm] Error out when using --aot=llvmonly in a runtime compiled without llvm. 2016-09-01 00:56:52 +02:00
Zoltan Varga f9fe66adba [arm] Make mono_arch_get_call_target () work on direct branches too, previously it returned NULL, which broke the code in handle_thunk () for tail calls. 2016-09-01 00:41:12 +02:00
Alex Rønne Petersen b0334d6cf9 [profiler] Include arguments, architecture, and OS in format header.
Bumped the major/minor version to 1.0 for this change.
2016-09-01 00:34:26 +02:00
Alex Rønne Petersen 5f419ae489 [profiler] Fix dump_header () to do fflush () in all non-gzip code paths. 2016-09-01 00:34:25 +02:00
Alex Rønne Petersen cd34142b77 [runtime] Export API functions to get arch/os/wordsize strings. 2016-09-01 00:34:25 +02:00
Alex Rønne Petersen ece3faccab [profiler] Remove duplicate #include. 2016-09-01 00:34:24 +02:00
Alex Rønne Petersen 8982a5c794 [profiler] Update documentation for time fields. 2016-09-01 00:34:24 +02:00
Alex Rønne Petersen f1ee1fbf3b [profiler] Document the TYPE_EXCEPTION format. 2016-09-01 00:34:23 +02:00
Alex Rønne Petersen f170865301 [profiler] Clean up some enums a bit. No format change. 2016-09-01 00:34:22 +02:00
Alex Rønne Petersen 414315dca5 [profiler] Update documentation on the backtrace format. 2016-09-01 00:34:22 +02:00
Alex Rønne Petersen cd7478ec96 [profiler] Pump the hazard free queue when shutting down. 2016-09-01 00:34:21 +02:00
Alex Rønne Petersen c17926d622 [utils/hp] Export mono_thread_hazardous_try_free_all () for use in the profiler. 2016-09-01 00:34:20 +02:00
Alex Rønne Petersen 66cf06f9b9 [utils/hp] Keep pumping the free queue even when we encounter hazardous items.
Previously, a single item being hazardous for a while could completely block
pumping of the queue. This fixes that.
2016-09-01 00:34:16 +02:00
Zoltan Varga 02ffe591f7 [runtime] Fix the method stored in the WrapperInfo for delegate-invoke wrappers for shared methods. Fixes #43696. 2016-09-01 00:25:38 +02:00
Bernhard Urban 4e8e5369ae [mini] emit sequence point before branching off for tail call 2016-08-31 22:36:19 +02:00
Niklas Therning 89ce2b94f3 Merge pull request #3473 from ntherning/fix-thread-double-close-handle-on-appdomain-unload
Fix for double CloseHandle() on AppDomain unload
2016-08-31 22:08:29 +02:00
Niklas Therning 3452b3d990 Merge pull request #3496 from ntherning/fix-heap-corruption-on-windows
Fixes two heap corruptions in the corlib tests on Windows
2016-08-31 20:22:13 +02:00
Aleksey Kliger (λgeek) 7dc4bb5aca Merge pull request #3395 from lambdageek/dev/handles-strings
[runtime] Use coop handles in some String-returning icalls
2016-08-31 13:23:52 -04:00
Niklas Therning e8fd99043a Fixes two heap corruptions in the corlib tests on Windows
The patch of mono/metadata/marshal.c makes sure that
Marshal.StringToHGlobalAnsi() allocates a memory area for the returned C
string which is at least as large as the length of the string object. This is
the behavior on non-Windows platforms. Without this patch the
MarshalTest.StringToHGlobalAnsiWithNullValues() test wrote outside of a memory
area and corrupted the heap which later on caused a heap corruption crash when
running the corlib test suite on Windows.

The patch of mono/metadata/mono-security.c fixes the freeing of the memory
returned by GetNamedSecurityInfoW(). When GetNamedSecurityInfoW() is used to
request a DACL one must also pass an argument for the ppSecurityDescriptor
parameter and this is the one that should be freed later on, not the pointer
to the DACL as the original code used to free. Before this patch
DSACryptoServiceProviderTest.UseMachineKeyStore() crashed because of a heap
corruption.
2016-08-31 19:11:24 +02:00
Marek Safar 07f9a6fc17 Bump cecil 2016-08-31 16:28:02 +02:00
Alexander Köplinger 882749b0b2 Merge pull request #3494 from akoeplinger/netstd-fixes
Expose a few more types/methods for netstandard
2016-08-31 13:52:49 +02:00
Alexander Köplinger 02d1ff2d38 [corlib] Add Environment APIs that take EnvironmentVariableTarget on mobile
We only do something when target is "Process", this matches CoreFX behavior.
2016-08-31 13:33:53 +02:00
Alexander Köplinger 19dae8eb86 [System.Core] Add a couple of System.IO.Pipes classes to the mobile profiles
These are required for netstandard parity.
2016-08-31 13:15:14 +02:00
Marek Safar 999fb3c8d1 [System] HttpWebRequest::Headers setter was only setting local variable. Fixes #42408 2016-08-31 12:13:12 +02:00
Bernhard Urban 913d6f9c56 Merge pull request #3470 from lewurm/fix-aot-compiler-toolchain-ld-invoke
[aot] fix linker invocation
2016-08-31 11:45:58 +02:00
Marek Safar 3bfbaa165d Merge pull request #3487 from marek-safar/rs-Threading
[corlib] Flow CultureInfo from parent thread. Fixes #43193
2016-08-31 07:57:02 +02:00
Marek Safar 4b5eace32d Merge pull request #3489 from akoeplinger/fix-latin1-surrogatepair
[corlib] Fix replacement of UTF-16 surrogate pairs in Latin1Encoding
2016-08-31 07:52:38 +02:00
Zoltan Varga e15f21ba18 Only set the attached flag when a client attaches (#3490)
In defer mode, the debugger thread is started as soon as possible before
any clients are attached, but the debugger is_attached flag was being set
immediately. This would cause the runtime (and the System.Diagnostics.Debugger
class) to wrongly report a client as being attached.

Originally fixed in the Unity fork here: https://github.com/Unity-Technologies/mono/commit/797a210e0f2416d779c448bb9e03bb16933e261f
2016-08-31 02:56:54 +02:00
Josh Peterson f4128e317e Only set the attached flag when a client attaches
In defer mode, the debugger thread is started as soon as possible before
any clients are attached, but the debugger is_attached flag was being set
immediately. This would cause the runtime (and the System.Diagnostics.Debugger
class) to wrongly report a client as being attached.

Originally fixed in the Unity fork here: https://github.com/Unity-Technologies/mono/commit/797a210e0f2416d779c448bb9e03bb16933e261f
2016-08-30 20:49:47 -04:00
Rodrigo Kumpera 4f6fb3002d Merge pull request #3488 from Unity-Technologies/threadpool-unhandled-exception-policy-legacy
Always clear thread abort exception for internal/threadpool threads
2016-08-30 15:44:20 -07:00
Alex Rønne Petersen 2b03fe54d7 Merge pull request #3481 from alexrp/master
Even more profiler fixes/improvements
2016-08-31 00:23:43 +02:00
Alex Rønne Petersen 2db49df290 Merge pull request #3464 from alexrp/arm64-native-atomics
[runtime] Fix C and LLVM atomics on ARM64
2016-08-30 21:47:14 +02:00
Alex Rønne Petersen 24b1ec360e [utils] Remove ia64-specific atomics/membar code.
All ia64 compilers have intrinsics that we use. Also, this ia64 code was very
out of date (missing many functions we use now) so it wouldn't compile anyway.
2016-08-30 21:12:32 +02:00
Alex Rønne Petersen 062ccc0d7e [llvm] Fix atomic opcodes on ARM64 to emit correct fences.
This is a workaround. It's needed for the same reason that we need the fix for
Clang's atomic intrinsics in mono/utils/atomic.h.
2016-08-30 21:12:32 +02:00
Alex Rønne Petersen 66fa2d770d [utils/atomic] Fix native atomic intrinsics on buggy ARM64 compilers.
See the comment in atomic.h for details.
2016-08-30 21:12:32 +02:00
Alex Rønne Petersen b23579f4a0 [utils] Add a MONO_GNUC_VERSION macro. 2016-08-30 21:12:32 +02:00
Marek Safar 54ea12e4fa [corlib] Flow CultureInfo from parent thread. Fixes #43193 2016-08-30 20:42:25 +02:00
Alexander Köplinger cc22315b6f [corlib] Fix replacement of UTF-16 surrogate pairs in Latin1Encoding
When encoding a UTF-16 C# string into bytes using "latin-1"/"iso-8859-1" encoding we were
not properly taking surrogate pairs into account. MSDN[1] provides a good introduction about the topic.

For example, this string would fail to encode and throw an IndexOutOfRangeException: "\ud83d\ude0a "
However, this string would not: "\ud83d\ude0a" (note missing space at the end). More on that later.

In https://bugzilla.xamarin.com/show_bug.cgi?id=42887 it was noted that encoding the string
didn't cause the exception on Mono 2.10.8.1 and 3.2.8. Indeed, it doesn't happen until Mono 4.0
where we switched most of the string code to referencesources.

While looking at the output of `Encoding.GetEncoding("latin1").GetBytes("\ud83d\ude0a ")` on the
"working" Mono verions I noticed that they essentially returned wrong results, e.g.:

```
csharp> Encoding.GetEncoding("latin1").GetBytes("\ud83d\ude0a ")
{ 63, 32, 0 }
```

This is wrong, because a) there's only one 63 (i.e. the '?' question mark char which is used as
a replacement char whenever the target encoding doesn't support a specific char,
and b) there is a trailing '\0' which should not be there.

Checking on .NET confirms the expected result: { 63, 63, 32 } i.e. '?? '

Back to the IndexOutOfRangeException in Mono 4.0+: digging into Latin1Encoding.InternalGetBytes() it
turns out that when we detect a surrogate pair we were incrementing charIndex, but we didn't decrement count.
This means that after the fallback characters (the two '?') were added we would still try to encode one more
char in the loop even though we're already at the end of the string, resulting in the exception.
For the "\ud83d\ude0a" example we would not hit the `count > 1` code path which made it work in this case.

Adding the decrement fixes the bug and makes the code consistent with MonoEncoding.cs[2].

The reason why it "worked" in earlier Mono versions was that we had a very simple EncoderReplacementFallbackBuffer
implementation[3] which only output a single '?' for the surrogate pair:

```
csharp> var buf = Encoding.GetEncoding("latin1").EncoderFallback.CreateFallbackBuffer()
csharp> buf.Fallback((char)0xD800, (char)0xDC00, 0)
true
csharp> buf.GetNextChar()
'?'
csharp> buf.GetNextChar()
'\x0

csharp> buf.Fallback((char)0xD800, (char)0xDC00, 0)
true
csharp> buf.GetNextChar()
'?'
csharp> buf.GetNextChar()
'?'
csharp> buf.GetNextChar()
'\x0'
```

This means that for the "\ud83d\ude0a " example from above we would only add one '?' character
for the surrogate pair to the result buffer, then the space and then we'd be done, leaving the
uninitialized array value 0 in the buffer on index 2.

I added tests for Latin1Encoding, mostly copied from ASCIIEncoding with additions for these
specific cases.

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

[1] https://msdn.microsoft.com/en-us/library/ms404377(v=vs.110).aspx
[2] https://github.com/mono/mono/blob/5b69e839e12b3d3512f310aa5a0e873346d7e50e/mcs/class/I18N/Common/MonoEncoding.cs#L62-L66
[3] https://github.com/mono/mono/blob/mono-3.12.0-branch/mcs/class/corlib/System.Text/EncoderReplacementFallbackBuffer.cs
2016-08-30 20:36:20 +02:00
Marek Safar 5b69e839e1 Merge pull request #3477 from Unity-Technologies/create-delegate-exception
Throw an ArgumentException when a delegate is bound to an open generi…
2016-08-30 19:05:29 +02:00
Jonathan Chambers 968b23e5da Reset thread abort exception for internal threads regardless of unhandled exception policy. 2016-08-30 11:32:53 -04:00
Josh Peterson 2a6e768884 Make improvments after code review:
* Use mono_set_pending_exception instead of mono_raise_exception
* Make the test an nunit test instead of a runtime test.
2016-08-30 10:46:02 -04:00
Ludovic Henry 57f8cb189f [mono-threads] Use create_suspended_sem on windows (#3482) 2016-08-30 12:45:53 +02:00
Marek Safar 76a61357ef Merge pull request #3483 from alexavator/bugfix-keepalive
[System] Set KeepAlive flag for HttpWebRequest
2016-08-30 11:02:43 +02:00
Pozdeev b7754c85fd [System] Set KeepAlive flag for HttpWebRequest 2016-08-30 13:36:21 +05:00
Ludovic Henry e8a221683d [pedump] Fix assertion error
We would previously observe the following crash:

```
ludovic-laptop :: ~/Xamarin/mono ‹16c07b5› » (cd tools/pedump && MONO_PATH=../../mcs/class/lib/net_4_x lldb -- ./pedump --verify metadata,code ../.././mono/tests/xdomain-threads.exe)
(lldb) target create "./pedump"
Current executable set to './pedump' (x86_64).
(lldb) settings set -- target.run-args  "--verify" "metadata,code" "../.././mono/tests/xdomain-threads.exe"
(lldb) r
Process 14407 launched: './pedump' (x86_64)
mono_os_mutex_lock: pthread_mutex_lock failed with "Invalid argument" (22)
Process 14407 stopped
* thread #1: tid = 0x27c9715, 0x00007fff93cfcf06 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007fff93cfcf06 libsystem_kernel.dylib`__pthread_kill + 10
	libsystem_kernel.dylib`__pthread_kill:
	->  0x7fff93cfcf06 <+10>: jae    0x7fff93cfcf10            ; <+20>
	    0x7fff93cfcf08 <+12>: movq   %rax, %rdi
        0x7fff93cfcf0b <+15>: jmp    0x7fff93cf77cd            ; cerror_nocancel
	    0x7fff93cfcf10 <+20>: retq
(lldb) bt
* thread #1: tid = 0x27c9715, 0x00007fff93cfcf06 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007fff93cfcf06 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff8b9b74ec libsystem_pthread.dylib`pthread_kill + 90
	frame #2: 0x00007fff908d56e7 libsystem_c.dylib`abort + 129
	frame #3: 0x000000010022da6a pedump`monoeg_log_default_handler(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, message="mono_os_mutex_lock: pthread_mutex_lock failed with \"Invalid argument\" (22)", unused_data=0x0000000000000000) + 202 at goutput.c:231
	frame #4: 0x000000010022d98d pedump`monoeg_g_logv(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, format="%s: pthread_mutex_lock failed with \"%s\" (%d)", args=0x00007fff5fbff4a0) + 109 at goutput.c:111
	frame #5: 0x000000010022dbd9 pedump`monoeg_g_log(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, format="%s: pthread_mutex_lock failed with \"%s\" (%d)") + 361 at goutput.c:121
	frame #6: 0x000000010022301e pedump`mono_os_mutex_lock(mutex=0x00000001002ec630) + 110 at mono-os-mutex.h:98
	frame #7: 0x0000000100223a66 pedump`mono_w32handle_new(type=MONO_W32HANDLE_PROCESS, handle_specific=0x00007fff5fbff540) + 246 at w32handle.c:440
	frame #8: 0x00000001001ef8bb pedump`_wapi_processes_init + 123 at processes.c:1149
	frame #9: 0x00000001001fbcc3 pedump`wapi_init + 19 at wapi.c:23
	frame #10: 0x0000000100116486 pedump`mono_init_internal(filename="pedump", exe_filename=0x0000000000000000, runtime_version="v4.0.30319") + 102 at domain.c:528
	frame #11: 0x0000000100117124 pedump`mono_init_version(domain_name="pedump", version="v4.0.30319") + 36 at domain.c:868
	frame #12: 0x0000000100001496 pedump`verify_image_file(fname="../.././mono/tests/xdomain-threads.exe") + 678 at pedump.c:466
	frame #13: 0x0000000100000f87 pedump`main(argc=4, argv=0x00007fff5fbff9a0) + 1095 at pedump.c:708
	frame #14: 0x00007fff93e655ad libdyld.dylib`start + 1
```

That would be because the w32handle wouldn't be initialized before calling into `wapi_init` which allocates w32handle.
2016-08-30 10:26:04 +02:00
Ludovic Henry 16c07b50f3 Merge pull request #3476 from lambdageek/fix-conc-ht
[test-conc-hashtable] Init w32 handles. Fixes OSX+coop.
2016-08-30 10:04:32 +02:00
Alex Rønne Petersen 9a14246053 [profiler] Reject heapshot requests if we're not in on-demand mode.
Previously, we would try to satisfy the heapshot request every single time
process_requests () was invoked, but since heap_walk () would never unset
heapshot_requested, we'd end up doing GCs over and over, causing massive
overhead.
2016-08-30 10:01:07 +02:00
Alex Rønne Petersen 39951e43ef [profiler] Process on-demand heapshot requests on the finalizer thread.
This way, we avoid attempting to fully attached the helper thread when it's
already a tools thread, which can lead to all sorts of problems.
2016-08-30 10:01:06 +02:00
Alex Rønne Petersen 16ea17a5e1 [profiler] Add GC finalization events to the format. 2016-08-30 10:01:06 +02:00
Alex Rønne Petersen 0c0e3702a4 [gc] Expose mono_gc_pending_finalizers () and mono_gc_finalize_notify () as public API.
We need these in the profiler, but they are also generally useful functions
that embedders may very well want to use.
2016-08-30 10:01:06 +02:00
Alex Rønne Petersen 138adfc043 [profiler] Add GC finalization callbacks to the profiler API. 2016-08-30 10:01:06 +02:00
Alex Rønne Petersen 8310af2230 [profiler] Initialize counters in the runtime_initialized () callback.
This way, we don't have to depend on the counters subsystem having been
initialized when the profiler library is loaded (very early).
2016-08-30 10:01:06 +02:00
Alex Rønne Petersen 7240d72222 [profiler] Normalize time fields in the format.
All events now come with a time field right after the event byte, and it is
encoded in the same way for all events (based on LogBuffer.time_base).

This allows readers to queue up events until a sync point event, then sort all
of those events by time, and process them in the order they were actually
written in.
2016-08-30 10:01:05 +02:00
Alex Rønne Petersen 41dc6f631c [profiler] Make the comment in proflog.c only represent the latest version of the format.
Maintaining it for every format version is getting unwieldy and most readers
likely won't care about ancient format versions. Further, we haven't really
stabilized the format yet, so documenting every iteration of it doesn't make
a whole lot of sense. Finally, if somebody does care about older versions,
they can simply look in decode.c to see how mprof-report deals with them.
2016-08-30 10:01:05 +02:00
Alex Rønne Petersen bdd9db1ed1 [profiler] Fix a few format bloat and encoding issues since we're bumping the format version.
* Methods in backtraces are now properly encoded based on the method_base
  rather than the ptr_base.
* The unused IL and native offset fields in TYPE_SAMPLE_HIT's backtrace frame
  format have been removed.
* The unused flags fields in the backtrace format and in metadata events have
  been removed.
* Changed a number of fields to be encoded as a single byte instead of LEB128.
2016-08-30 10:01:05 +02:00
Alex Rønne Petersen 02d148fd88 [profiler] Emit sync point events when flushing all buffers.
These events basically establish points in the event stream where all previous
events can be processed and a complete view of the profiling state can be
formed. For instance, if an allocation event for object A of type T was seen
before a sync point, then it's guaranteed that the class load event for T also
came before that sync point (although it may have arrived after the allocation
event for A).
2016-08-30 10:01:05 +02:00
Alex Rønne Petersen 4f62b5af43 [profiler] Acquire the exclusive buffer lock after the suspend lock.
This prevents possible STW deadlocks.
2016-08-30 10:01:05 +02:00
Alex Rønne Petersen 25edbd406f [profiler] Only flush buffers when they exceed the base capacity.
Other than timely arrival, there was never really a need to force buffers to be
flushed at these arbitrary points. Now that we flush all buffers periodically,
that reason is no longer relevant.
2016-08-30 10:01:04 +02:00
Alex Rønne Petersen a34946226e [profiler] Process requests in enter/leave callbacks regardless of call depth.
Heapshots have nothing to do with call depth, so they should be processed in
any case.

Also flush the local buffer in all enter/leave callbacks if needed.
2016-08-30 10:01:04 +02:00
Alex Rønne Petersen 2ccdecec40 [profiler] Periodically flush all thread-local buffers.
This ensures that even for low-activity threads, it won't take ages before the
events from it arrive. We do this flush every 1sec (as with sampling of perf
counters).
2016-08-30 10:01:04 +02:00
Alex Rønne Petersen 12e4a840ae [profiler] Implement global flush points for thread-local buffers.
The problem is this: Given an allocation of object O on address A1 in thread T1
and a subsequent GC move of O from A1 to A2 in T2, if T2's event buffer is
flushed before T1's buffer, the reader of the log file will a seemingly
nonexistent object being moved, and then see the actual allocation of that
object later. This makes it extremely difficult to keep track of the managed
heap.

The way we solve this is by flushing all thread-local buffers when the GC stops
the world. This way, we know that all prior allocations in the program have
been committed to the log file before any moves that are about to follow as
part of the collection. Similarly, we flush the GC thread's buffer before
restarting the world to ensure that all moves are committed before allocations
that may happen later (which could use some of the addresses freed up for use
due to the moves).

This is reasonably easy now that we have a global LLS of threads which are
attached to the profiler. However, we have to use some kind of lock to ensure
that buffers aren't being written to while we're trying to flush them, or that
a suspended thread was in the middle of modifying its buffer. For this, we use
a reader/writer spin lock of sorts, somewhat similar to the lock used by the
SGen binary protocol. When threads are modifying their own buffer (whether it
be writing to it or flushing it), they take the reader lock. This means that
many different threads can be operating on their own buffers without any lock
contention (which would kinda defeat the purpose of the thread-local buffers).
Now, when a thread -- such as the thread that initiated a GC -- wants to access
the buffers of other threads, it takes the writer lock. In doing so, all other
threads are prevented from modifying their own buffers. This gives the thread
holding the writer lock an opportunity to flush the buffers of other threads.
2016-08-30 10:01:04 +02:00
Alex Rønne Petersen ed552792d4 [utils/threads] Export mono_thread_info_yield () for use in the profiler. 2016-08-30 10:01:04 +02:00
Alex Rønne Petersen 869585c2a6 [profiler] Remove LogBuffer.locked and related debugging code.
This hasn't been needed for a long time.
2016-08-30 10:01:03 +02:00
Alex Rønne Petersen 928b840dad [profiler] Rewrite TLS code.
* Actual thread-local state is now stored in a MonoProfilerThread struct which
  is stored in a single TLS slot per thread. This avoids storing things like
  call_depth in LogBuffer. The current LogBuffer of a thread is also stored in
  the MonoProfilerThread.
* All MonoProfilerThread structs are stored in a global linked list set. This
  LLS is used to manually clean up the thread-local state of threads that, for
  whatever reason, don't have the thread_end () callback invoked.
* Lifetime management of thread-local buffers is now much more straightforward.
* The thread-local list of referenced methods is now only allocated if needed.
* Fixed a MethodInfo memory leak in handle_writer_queue_entry ().
* Fixed some class load events that could be lost in the writer thread when
  fetching the full name of a method.
* TLS slots are now actually freed on shutdown.
2016-08-30 10:01:03 +02:00
Alex Rønne Petersen 91af66e4ab [profiler] Implement process_id () for Windows. 2016-08-30 10:01:03 +02:00
Alex Rønne Petersen 9008efcc56 [utils/lls] Export the linked list set API for use in the profiler.
Also exported a couple of hazard pointer functions used by the LLS macros.
2016-08-30 10:01:03 +02:00
Alex Rønne Petersen 64e35f6d8b [utils/lls] Use mono_thread_hazardous_queue_free () instead of mono_thread_hazardous_try_free ().
We cannot use the latter as we do not know whether the free function is safe to call.
2016-08-30 10:01:03 +02:00
Alex Rønne Petersen c2d170ab30 [utils/lls] Rename get_hazardous_pointer_with_mask () to mono_lls_get_hazardous_pointer_with_mask (). 2016-08-30 10:01:02 +02:00
Alex Rønne Petersen 7352d60f62 [utils/hp] Rename get_hazardous_pointer () to mono_get_hazardous_pointer (). 2016-08-30 10:01:02 +02:00
Alex Rønne Petersen e25f0dd1e7 [utils/hp] Remove HazardFreeLocking and HazardFreeContext enums.
These are no longer useful in the new hazard free API.
2016-08-30 10:01:02 +02:00
Alex Rønne Petersen f8a716f1f0 [profiler] Only forward declare structs that need it. 2016-08-30 10:01:02 +02:00
Zoltan Varga f7a57d5f08 Revert "[runtime] Fix pedump by using the normal embedding APIs instead of in…" (#3479) 2016-08-30 00:01:18 +02:00
Rodrigo Kumpera 770ca46e08 Merge pull request #3478 from vargaz/fix-pedump
[runtime] Fix pedump by using the normal embedding APIs instead of in…
2016-08-29 17:51:30 -04:00
Zoltan Varga a9c75b075c [runtime] Fix pedump by using the normal embedding APIs instead of initializing parts of the runtime. Fixes #43786. 2016-08-29 22:37:31 +02:00
monojenkins 66fd6fd24d Merge pull request #3422 from xmcclure/tarjan-doublefan
Make GC bridge perform well in the "double fan" scenario

The GC bridge currently performs VERY poorly when the object graph has a "double fan" shape. If M Java objects point to 1 C# object which points to N Java objects, the graph exported to Monodroid will currently drop the C# object node and replace it with (M\*N) edges. It is easy to write code where (M\*N) grows ludicrously big.

In testing on device, this patch solves that problem while leaving other cases unaffected. In testing on device, I found:
* All performance tests except double fan: No discernible performance difference after patch
* Double fan test with M=N=1000: Before the patch this took between three and seven seconds. After the patch this took between 0.2 and 0.3 seconds.
* Double fan test with M=N=4000: Before the patch this took anywhere from one to two minutes. After the patch, this took about 1.2 seconds.
* Double fan test with M=N=6000: Before the patch, this took so long I was not able to get it to ever complete. After the patch, this took about 1.3 seconds.
* Double fan test with M=N=20000: I did not attempt this test pre-patch. After the patch, it took about 5.6 seconds.

The commit messages describe the changes in some detail but the short version is:
* Add a mechanism for exporting non-bridged SCCs to the bridge client
* Turn that mechanism on whenever the product fanin*fanout grows too large
* Make the merge cache more aggressive

To function, this patch requires a corresponding change to monodroid. See https://github.com/xamarin/xamarin-android/pull/154
2016-08-29 22:30:06 +02:00
Marek Safar c8c09310f9 [Facades] Remove private facade 2016-08-29 21:41:14 +02:00
Marek Safar 3c045871b5 Merge pull request #3463 from david-mitchell/al-platform-switch
Add missing switch and functionality to al.
2016-08-29 21:31:33 +02:00
Andi McClure 40a1b5afe5 GC bridge: Fix non-buildable assert ()s added in previous commits 2016-08-29 14:34:22 -04:00
Alex Rønne Petersen 6a5599d71e Merge pull request #3468 from alexrp/hwcap-improvements
[utils/hwcap] Clean up and improve the hwcap code.
2016-08-29 20:26:46 +02:00
Andi McClure c300a36dbc GC bridge: Move bridge-require-precise-merge to MONO_GC_PARAMS
This was previously in MONO_GC_DEBUG, but we do not use this for
production-viable flags.
2016-08-29 13:48:48 -04:00
Marek Safar 57497c6e33 [corlib] Improve CanceledContinuationExecuteSynchronouslyTest test 2016-08-29 18:39:14 +02:00
Josh Peterson eaaf9b498f Throw an ArgumentException when a delegate is bound to an open generic method.
* This change was made in Unity's old version of Mono at: https://github.com/Unity-Technologies/mono/commit/9e27edaec9a91a75d6ebf0d21654dedcab74653d
2016-08-29 12:23:13 -04:00
David Mitchell 6fcc60e1c9 Add missing switch and functionality to al.
When running msbuild on mono against an architecture-specific
project that also defines satellite assemblies, the /platform
switch will be passed to al.exe. Mono's implementation of al.exe
does not support this switch, which results in a failed build.

This commit adds the /platform switch, which also required
changing the implementation from System.Reflection to
IKVM.Reflection because Mono's implementation of AssemblyBuilder
does not support the necessary options.

While testing this change, I also noticed a few attributes that
the MS version of al.exe will copy from "template" assemblies,
so I added support for those, as well.
2016-08-29 09:17:24 -07:00
Aleksey Kliger f61f855794 [runtime] Use coop handles in some String-returning icalls
Also begin adding handle definitions for some System.Reflection classes
when needed.
2016-08-29 12:12:57 -04:00
Marek Safar f16a7daaf1 [mcs] Add reference to parent storey when current value type async storey needs fabricated this access. Fixes #40860 2016-08-29 18:04:14 +02:00
Aleksey Kliger 2ef81c56cd [test-conc-hashtable] Init w32 handles. Fixes OSX+coop. 2016-08-29 11:57:31 -04:00
Zoltan Varga a35f78db32 [llvm] Fix the arm cross compiler build when using llvm 3.9. 2016-08-29 16:49:17 +02:00
Marek Safar eb42f74662 Merge pull request #3453 from ntherning/cleanup-AssemblyTest-temp-file-handling
Cleanup temp file handling in AssemblyTest
2016-08-29 16:46:04 +02:00
Niklas Therning b90617e7b7 Cleanup temp file handling in AssemblyTest
SetUp() already sets up a temp folder for the test methods and TearDown()
handles cleaning up and taking into account that on Windows, loaded assemblies
cannot be deleted. However, some of the tests created temp files outside of
this folder and had their own cleanup code which didn't expect temp files to
be undeletable on Windows.

This patch removes any custom temp file creation/cleanup from individual test
methods. It also slightly changes the way SetUp() created the temp folder for
each test, now the paths will be shallower.
2016-08-29 14:27:00 +02:00
Niklas Therning 2d407e62e6 Fix for double CloseHandle() on AppDomain unload
When AppDomain.Unload() is called a new thread is created and attached. When
this thread is done the thread handle is immediately closed using
CloseHandle() but the same handle is also passed to CloseHandle() later on by
the InternalThread destructor. On the second CloseHandle() call Windows will
abort the process with an "Invalid handle" error.

This patch removes the CloseHandle() calls in mono_domain_try_unload() which
is called by AppDomain.Unload(). The patch also wires up some more functions
in mono/utils/mono-threads-windows.c to set the MonoThreadInfo.handle field to
NULL when a thread has exited.
2016-08-29 14:00:48 +02:00
Bernhard Urban fc5305d2af [aot] fix linker invocation
fixes regression introduced by 7d238ddd5e
2016-08-29 12:06:30 +02:00
Alex Rønne Petersen 20d221e596 [utils/hwcap] Clean up and improve the hwcap code.
* Get rid of the arch-specific headers.
* Do verbose printing in one place.
* Simplify the cross compilation case to avoid repetition.
* Define all variables with a macro in a single header.
* Print detected hwcap info via g_print () so it's visible on mobile.
* Expose plain bool variables in the s390x implementation.
2016-08-29 06:38:53 +02:00
Miguel de Icaza 39e345a0e5 [runtime] Bundle support, implement missing stream processing (#3423) 2016-08-27 21:51:53 -04:00
Alexander Köplinger 448da87d44 [corlib] Fix Marshal test to not rely on Assert.Less
It doesn't work on nunitlite e.g. on XA:

```
src/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs(268,11): error CS0117: `NUnit.Framework.Assert' does not contain a definition for `Less'
```
2016-08-27 21:24:45 +02:00
Aleksey Kliger (λgeek) 783593ac12 [runtime] ves_icall_AssemblyBuilder_InternalAddModule is dead code (#3461)
There is no System.Refleciton.Emit.AssemblyBuilder::InternalAddModule method
2016-08-26 17:46:11 -04:00
Vlad Brezae 3806fa0d2c Merge pull request #3451 from BrzVlad/fix-armel-emulation
[arm] Fix armel no fp
2016-08-26 23:57:29 +03:00
Alexander Köplinger 91b2f2d620 Merge pull request #3460 from akoeplinger/remove-net_4_5-ifdef
[mcs] Remove NET_4_5 ifdef from the source files
2016-08-26 21:21:55 +02:00
Alexander Köplinger 94e60c50bf Merge pull request #3459 from akoeplinger/fix-parameter-names
[bcl] Fix method parameter names to match .NET
2016-08-26 21:18:07 +02:00
Alexander Köplinger 3b167e0671 Merge pull request #3457 from akoeplinger/fix-gethrforexception
[corlib] Return e.HResult instead of PlatformNotSupportedException/-1 for Marshal.GetHRForException
2016-08-26 20:58:59 +02:00
Andi McClure d00831f52b PR feedback: Add a runtime switch for the aggressive SCC merging
Previously every time we add a new runtime setting for the bridge
processor we have added a new callback for it. Because this is getting
unweildy, and also because some of these settings might have been
broken by recent init order changes, I created a new set_config
callback and merged the existing set_dump_prefix and enable_processing
with it.
2016-08-26 14:13:44 -04:00
Andi McClure 9bd7907af5 PR feedback: Corrections to aggressive merge cache
hash_perturb was being mixed in in the wrong place. Fix that, also
make the hash function take some input from high bits on 64-bit
systems, also make the types around the hash more reasonable.
2016-08-26 15:00:37 -04:00
Zoltan Varga b1ef3a57d0 [sre] Remove TypeBuilder::create_internal_class () icall, it doesn't seem to be needed. (#3458) 2016-08-26 19:56:12 +02:00
Alexander Köplinger c4692001a9 [bcl] Fix method parameter names to match .NET
The names were fixed only for the subset of methods that are included in netstandard,
and in cases where netstandard differs from Desktop .NET we match with .NET.
2016-08-26 17:49:03 +02:00
Alexander Köplinger d7967505ff Fix tarball build
emitnunit.pl was removed in d3129a7624
2016-08-26 17:31:32 +02:00
Alexander Köplinger 055d9416c4 [corlib] Return e.HResult instead of PlatformNotSupportedException/-1 for Marshal.GetHRForException
Follow what coreclr/corefx does now: https://github.com/dotnet/coreclr/pull/6929.
2016-08-26 17:20:47 +02:00
Zoltan Varga 8c1ef41894 [runtime] Remove most of the contents of MonoDynamicGenericClass, the… (#3441)
* [runtime] Remove most of the contents of MonoDynamicGenericClass, the elements of the 'fields' array are not used anywhere, making all the other fields unneccesary too.

* [runtime] Remove the MonoDynamicGenericClass structure, merge it into MonoGenericClass. Add some comments.
2016-08-26 12:32:05 +02:00
Zoltan Varga 8963cc85bf [jit] Add an assert to the native types code to make sure we are using the matching managed assembly. 2016-08-26 12:02:54 +02:00
Zoltan Varga dcd650d6fc [llvmonly] Initialize native-to-managed wrappers when they are loaded instead of on the first call, since the call might be made on a thread not attached to the runtime. Fixes #43357. 2016-08-25 22:18:45 +02:00
Zoltan Varga 20b49905f2 [jit] Fix an assertion on amd64 when using fixed size buffers and pinvoke. Fixes #33571. 2016-08-25 20:35:25 +02:00
Marek Safar 01038e7c2d [corcompare] Show extension argument changes. Make parameter name difference breaking change. 2016-08-25 18:28:57 +02:00
Marek Safar 6d1a78e35a [mcs] Don't crash when as operand cannot be resolved. Fixes #43718 2016-08-25 18:28:57 +02:00
Marek Safar 0a37c37c77 [mcs] Correctly detect catch resume point marker in scope of resume points. Fixes #43636 2016-08-25 18:28:57 +02:00
Niklas Therning 83e7e0822e Validate AppDomainSetup.ApplicationBase path more like .NET does
On Windows we should check the path for invalid characters. Also expand
relative paths set using file:// URLs like .NET does. This patch also removes
the code which prepends "//" on Windows when a file:// URL is given as .NET
doesn't seem to do that in more recent versions.
2016-08-25 18:25:17 +02:00
Ludovic Henry e3ff1ef240 Merge pull request #3447 from ludovic-henry/iolayer-extract-threading
[threads] Get thread handle from MonoThreadInfo when attaching
2016-08-25 15:55:15 +02:00
Vlad Brezae d3962a8a80 [jit] Don't lower store_r4 and load_r4 on armel with no fp
When having a float variable in memory, we should always access its contents through the fload_r4/fstore_r4 funcs, which do the conversion between float and double and different memsize vs var size. It is common case, to have a temp float, have its address loaded with ldaddr and later do a load_r4_membase on that address to access the contents. If alias analyis lowers this load_r4_membase to an op_fmove directly on the register pair, this would in turn be decomposed into 2 simple int op_moves on soft float, which is wrong if these op_moves are converted to memory accesses.
2016-08-25 11:55:46 +00:00
João Matos ad34387f2c Merge pull request #3449 from lateralusX/jlorenss/win-add-missing-source-file
Add missing source file, sgen-os-coop.c, to libmonoruntime Visual Studio project.
2016-08-25 11:39:54 +01:00
Vlad Brezae 208d127b0f [arm] Fix opcode emulation on armel with no fp
Even though we register emulations for these opcodes, the native function doesn't not map to the opcode logic, being used instead as part of the opcode decomposition along with other instructions. Make sure we don't try to emulate these opcodes through the general emulation pass.
2016-08-25 10:15:16 +00:00
lateralusX 9393bb86e1 Add missing source file, sgen-os-coop.c, to libmonoruntime Visual Studio project.
Add missing source file, sgen-os-coop.c to project.

Add source files and headers into correct filters (Header/Source Files).

Eliminated Visual Studio linker warning LNK4221 for libmonoruntime project generated
by empty source files under certain configurations, boehm-gc.c, lock-tracer.c,
null-gc.c and sgen-os-coop.c
2016-08-25 11:14:33 +02:00
Alexander Köplinger dfbd2bcf82 Merge pull request #3437 from ntherning/fix-DirectoryNotFoundException-thrown-in-FileInfoTest.MoveTo_DestFileName_DirectoryDoesNotExist-on-windows
FileInfo.MoveTo() throws DirectoryNotFoundException rather than FileNotFoundException on Windows when target doesn't exist
2016-08-24 23:38:29 +02:00
Andi McClure 48e498d1cf PR feedback: Formatting, comments, asserts 2016-08-24 15:33:00 -04:00
Ludovic Henry bed939e9f7 [threads] Get thread handle from MonoThreadInfo when attaching 2016-08-24 20:56:24 +02:00
Ludovic Henry 9a54e8d226 Merge pull request #3439 from ludovic-henry/iolayer-extract-threading
[mono-threads] Create Win32 handle when attaching the thread
2016-08-24 20:54:04 +02:00
Alexander Köplinger 399de6b18c Merge pull request #3444 from akoeplinger/fix-netstandard-extensions
[Facades] Implement methods for *Extensions types that are available on the extended type
2016-08-24 20:05:08 +02:00
Alexander Köplinger 0196e9a169 [mini] Wrap error output for NUnit xml in CDATA section
Makes sure that characters like <> (which appear in stack traces) don't confuse the XML parser.
2016-08-24 18:38:23 +02:00
Marek Safar cbffc5e908 [monosymbolicate] Add pdb detection 2016-08-24 17:05:58 +02:00
Ludovic Henry 6c6b7b3f50 [mono-threads-windows] Allocate ThreadStartInfo on the stack 2016-08-24 16:39:18 +02:00
Ludovic Henry fb50573d53 [mono-threads] Create Win32 handle when attaching the thread
This guarantee that a MonoThreadInfo always has a handle.
2016-08-24 16:39:17 +02:00
Ludovic Henry 9f00edd1b4 [w32handle] Remove unused assertions 2016-08-24 16:39:16 +02:00
Ludovic Henry e5a4d23fc7 [w32handle] Initialize them earlier
If we happen to have the debugger or the log profiler enabled, we would run into a use before initialization case for the w32handle. The debugger or profiler would call `mono_gc_base_init` which would attach the current thread, and that would crash in `mono_w32handle_new` at w32handle.c:437 with `scan_mutex` being an invalid value (EINVAL).
2016-08-24 16:39:15 +02:00
Marek Safar 1b2d5e91fa Merge pull request #3445 from rolfbjarne/cecil-update
[tuner/linker] Update code to fix build errors after cecil update.
2016-08-24 16:11:50 +02:00
Marek Safar b430545e06 Revert "[corcompare] Reflects cecil breaking changes"
This reverts commit b0ec389b68.
2016-08-24 16:08:25 +02:00
Rolf Bjarne Kvinge 40abe3056b [tuner/linker] Update code to fix warnings after cecil update. 2016-08-24 15:56:55 +02:00
Marek Safar b0ec389b68 [corcompare] Reflects cecil breaking changes 2016-08-24 15:17:12 +02:00
Niklas Therning 93181627a2 FileInfo.MoveTo() throws DirectoryNotFoundException rather than
FileNotFoundException on Mono on Windows and on .NET when target doesn't exist

FileInfoTest.MoveTo_DestFileName_DirectoryDoesNotExist() expects
FileNotFoundException to be thrown but on Windows a DirectoryNotFoundException
is thrown instead.

This patch changes MoveFile() in mono/io-layer/io.c to set the last error to
ERROR_PATH_NOT_FOUND rather than ERROR_FILE_NOT_FOUND when the destination
path doesn't exist. This results in a DirectoryNotFoundException being thrown
in managed code rather than FileNotFoundException. This is the behaviour
observed in .NET.

Also updated FileInfoTest.MoveTo_DestFileName_DirectoryDoesNotExist() to check
for DirectoryNotFoundException rather than FileNotFoundException.
2016-08-24 15:02:59 +02:00
Niklas Therning b72f1d7327 Merge pull request #3443 from ntherning/do-not-pass-FILE_FLAG_OVERLAPPED-to-CreateFile
Don't pass FILE_FLAG_OVERLAPPED to CreateFile()
2016-08-24 15:02:04 +02:00
Alexander Köplinger 186b0adff4 [Facades] Add argument null validation for extension methods 2016-08-24 14:50:21 +02:00
Alexander Köplinger f8db3589fc [Facades] Implement methods for *Extensions types that are available on the extended type
The methods are already available in our implementations of those types so we can just forward the calls
to the "real" types instead of throwing NotImplementedException.

I audited all code in mcs/class/Facades and the only places where we still throw NotImplementedException
are ones where we really need to add a custom implementation.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43695
2016-08-24 13:53:00 +02:00
Alexander Köplinger cce82f1700 [Facades] Make sure "this" is added to the type extensions
It was missing on a few methods.
2016-08-24 13:46:41 +02:00
Alexander Köplinger fd8c6c1956 [Facades] Throw PlatformNotSupportedException instead of NotImplementedException for ServiceController on mobile
It's unlikely the ServiceController APIs will be supported on mobile since they don't really make sense there,
they were initially designed for controlling Windows Services.
2016-08-24 13:46:40 +02:00
Marek Safar 11fb0e399f Merge pull request #3436 from ntherning/fix-alt-dir-separator-not-replaced-in-Path.CleanPath
Path.CleanPath() does not always replace AltDirectorySeparatorChar
2016-08-24 13:17:24 +02:00
Rolf Bjarne Kvinge 59260ced5a [linker] Mark declaring types of nested types resolved from xml descriptors. Fixes #43658. (#3434)
If the declaring type of a nested type marked by an xml descriptor
is not otherwise marked, the members of the nested type will not
be preserved, because the linker will not process the nested type
(since the parent type isn't marked, MarkStep:InitializeAssembly
will skip it, and thus skip akk its nested types as well).

https://bugzilla.xamarin.com/show_bug.cgi?id=43658
2016-08-24 12:12:48 +02:00
Niklas Therning 3b1ebefb7b Path.CleanPath() does not always replace AltDirectorySeparatorChar
If sub == 0, i.e. there are no repeated separators, this method just returns
the input string. On Windows, where DirectorySeparatorChar (\) is different
from AltDirectorySeparatorChar (/), this means that the call

    Path.GetDirectoryName ("foo/bar/dingus")

won't return "foo\bar" as .NET would but rather returns "foo/bar".

This patch makes sure the '/' -> '\' conversion is run when
AltDirectorySeparatorChar characters have been seen in the input string, even
if sub == 0.

PathTest.GetDirectoryName() triggered this bug.
2016-08-24 11:22:39 +02:00
Niklas Therning 1c6422e455 Don't pass FILE_FLAG_OVERLAPPED to CreateFile()
When a FileStream is opened with the FileOptions.Asynchronous flag set the
code in file-io.c will pass FILE_FLAG_OVERLAPPED to the CreateFile() function.
On Windows this means the file will be in asynchronous mode and when
ReadFile()/WriteFile() are called an OVERLAPPED struct has to be passed. Mono
doesn't do this which means that when reading/writing asynchronous FileStreams
Windows returns an ERROR_INVALID_PARAMETER and an exception is raised in
managed code.

This patch simply removes the code which passes the FILE_FLAG_OVERLAPPED to
CreateFile(). This will work since asynchronous I/O is handled in managed code
anyway, using threads. On the OS level the I/O is still synchronous. The patch
won't affect other platforms since the implementation of
ReadFile()/WriteFile()/etc in mono/io-layer/, which is used on non-Windows, is
always synchronous and ignores the FILE_FLAG_OVERLAPPED.

This bug was triggered by the
MonoTests.System.IO.BinaryWriterTest.AsynchronousModeWrites test.
2016-08-24 10:49:23 +02:00
Marek Safar 5adec5a68a [bcl] More netstandard api matching 2016-08-24 00:27:01 +02:00
Alexander Köplinger a156e55b3a Merge pull request #3430 from akoeplinger/simplify-mini-nunit
[mini] Replace emitnunit.pl with simpler Makefile-based xml generation
2016-08-23 21:02:54 +02:00
Alexander Köplinger 4e84bd13f2 Merge pull request #3431 from mhutch/fix-targetframeworkattribute
[xbuild] Fix incremental build of TargetFrameworkAttribute
2016-08-23 19:20:31 +02:00
Niklas Therning cbda28a9a1 Merge pull request #3435 from ntherning/fix-DirectoryInfoTest-assumes-current-dir-is-c-on-windows
Fix for DirectoryInfoTest assuming current dir is C:\ on Windows
2016-08-23 16:46:27 +02:00
Niklas Therning 08efcc3a52 Fix for DirectoryInfoTest assuming current dir is C:\ on Windows
This test assumes that `new DirectoryInfo (@"c:").Name == "C:\"` when run on
Windows but the actual value depends on the current directory. If current dir
is C:\temp the Name property will return "temp". Similar problem in the
FullName() and Parent() tests.

This patch sets the current directory to C:\ explicitly before running the
failing tests on Windows. The current dir is reset in TearDown().
2016-08-23 15:44:54 +02:00
Alexander Köplinger d3129a7624 [mini] Replace emitnunit.pl with simpler Makefile-based xml generation
In an effort to cut down on the number of different scripts we have that try to output NUnit xml.

It also fixes a bug in emitnunit.pl where it would not output anything when one of the tests crashes
the process, because then the final "Overall results: tests: 22425, 100% pass, opt combinations: 25"
line isn't printed and emitnunit.pl just exits. This happens on Alpine.
2016-08-23 15:34:24 +02:00
Alexander Köplinger c4a5b6b5c3 [mcs] Remove NET_4_5 ifdef from the source files
It is always set in all profiles that we support so we can remove it.
2016-08-23 15:15:51 +02:00
Zoltan Varga 208650e6da [jit] Avoid strengh reducing divisions when using llvm, llvm can do it by itself. 2016-08-23 15:09:21 +02:00
Niklas Therning 82b02262cf Merge pull request #3426 from ntherning/fix-handle-leak-in-DirectoryInfo.EnumerateFileSystemInfos-on-windows
Fixes a handle leak in DirectoryInfo.EnumerateFileSystemInfos()
2016-08-23 13:55:25 +02:00
Niklas Therning 29d229377d Merge pull request #3433 from ntherning/fix-DoubleTest.Parse-assumes-en-US
Don't assume "3 5" is unparseable in the current culture in DoubleTest.Parse()
2016-08-23 12:22:50 +02:00
Niklas Therning fb2afb6d76 Don't assume "3 5" is unparseable in the current culture in DoubleTest.Parse()
DoubleTest.Parse() expects "3 5" to be unparseable in the current culture and
expects an exception to be thrown. In sv-SE however "3 5" parses to 35 and
this test fails.

This patch sets the current culture to en-US when the DoubleTest.Parse() test
is run.
2016-08-23 12:20:28 +02:00
Niklas Therning b8c33e6549 Fixes a handle leak in DirectoryInfo.EnumerateFileSystemInfos()
When running DirectoryInfo.EnumerateFileSystemInfos() on an empty directory
MonoIO.FindFirst() will return null and the method returns without closing the
handle which is opened by FindFirst(). This patch makes sure the finally block
which closes the handle is run even when FindFirst() returns null.

Also added a call to FindClose() and some more cleanup in the native
implementation of MonoIO.FindFirst() when an allocation fails.

This bug caused an exception in DirectyoryInfoTest.TearDown() and several
other TearDown() methods in the MonoTests.System.IO tests on Windows due to
RemoveDirectory() failing on an empty directory which still had an open handle
associated with it.
2016-08-23 12:05:53 +02:00
Marek Safar a9e83f7f6f Merge pull request #3103 from marek-safar/rs-Threading
[corlib] EventWaitHandle from referencesource
2016-08-23 09:17:43 +02:00
Mikayla Hutchinson efd47e8b31 [xbuild] Fix incremental build of TargetFrameworkAttribute
The targets depended on a feature that doesn't exist in
xbuild (https://bugzilla.xamarin.com/show_bug.cgi?id=43645)
and as a consequence would fail to add the generated file to
the build when the GenerateTargetFrameworkMonikerAttribute
target was up to date.
2016-08-22 22:52:31 -04:00
Alexander Köplinger 0d1db0362d Merge pull request #3429 from akoeplinger/fix-signaturedescription
[corlib] Add new values for RSAPKCS1SHA(256/384/512)SignatureDescription to CryptoConfig and fix SignatureDescriptionTest in FullAOT
2016-08-23 02:35:44 +02:00
Alexander Köplinger d326ae2998 Merge pull request #3381 from krytarowski/netbsd-support-20
Resurrect NetBSD support in mono-perfcounters.c
2016-08-23 01:24:39 +02:00
Marek Safar f31d874829 [corlib] EventWaitHandle from referencesource 2016-08-22 23:20:00 +02:00
Vlad Brezae 2d91f05408 [arm64] Bump instruction sizes for atomic ops to match the emmited code 2016-08-22 14:06:23 -07:00
Alexander Köplinger e9205142b2 [corlib] Add new values for RSAPKCS1SHA(256/384/512)SignatureDescription to CryptoConfig and fix SignatureDescriptionTest in FullAOT
With the .NET 4.6.2 merge in https://github.com/mono/mono/commit/b6a30059db8319348ebb454cc303633dfabd6a29#diff-799d44d25450b5b84906cbe7095708a0L86
the RSAPKCS1SignatureDescription class switched from using SHA1CryptoServiceProvider as the DigestAlgorithm to SHA1Cng.

This uncovered an issue when running SignatureDescriptionTest in FullAOT, as we were missing an entry for SHA1Cng
in CryptoConfig.fullaot.cs and so we didn't find the algorithm.

Additionally, 4.6.2 added new variants of the SignatureDescription class using SHA256, SHA384 and 512 which
had to be added alongside the corresponding digest/signature URLs defined by https://msdn.microsoft.com/en-us/library/windows/desktop/dd979768(v=vs.85).aspx

Note that on mobile/FullAOT we're falling back to the *Managed variants of the SHA algorithms as the *Cng/*CryptoServiceProvider variants
aren't exposed there (except for SHA1CryptoServiceProvider since it was in the framework from the beginning) so we need to special case these in the tests.
2016-08-22 20:47:47 +02:00
Aleksey Kliger 9aa7728ec6 [s390x] Fix compilation of sre-save.c 2016-08-22 14:07:59 -04:00
Alexander Köplinger f961e18753 [corlib] Simplify monotouch_*_corlib.dll.sources
They were all using the same .cs source files so just including the generic monotouch .sources
makes it easier to reason about and reduces the risk of forgetting to update one of the lists.
2016-08-22 19:15:50 +02:00
Alexander Köplinger 24a4379898 [corlib] Rename CryptoConfig_2_1.cs to CryptoConfig.common.cs
The file is actually used in all profiles so the 2.1 naming was confusing.
2016-08-22 19:02:34 +02:00
Aleksey Kliger (λgeek) faa06c572d [sre] Fix s390x build (#3427)
Followup for 6be008c409 to fix the s390x build.
2016-08-22 12:28:18 -04:00
Alexander Köplinger 363f36f0cb [mcs] Fix arguments to nunit-lite when FIXTURE or TESTNAME is set
nunit used -fixture for running all tests of a fixture and -run for running a single test,
but nunit-lite uses just -test for both.
2016-08-22 18:21:26 +02:00
Alexander Köplinger 07a2b30de0 Merge pull request #3428 from ntherning/fix-missing-libc-in-FileStreamTest-on-windows
Fixes DllNotFoundException in FileStreamTest.SetUp() on Windows
2016-08-22 17:30:04 +02:00
Niklas Therning ff18095f28 Fixes DllNotFoundException in FileStreamTest.SetUp() on Windows
SetUp() calls uname() in libc to check whether the test is running on OS X. On
Windows this fails since libc isn't available.

This patch removes the call to uname() completely since the result wasn't used
by the test anyway.
2016-08-22 17:21:58 +02:00
Marek Safar 0e700ac819 [mcs] Move more eager references version mismatch checks. Fixes #30821 2016-08-22 17:04:11 +02:00
Marek Safar 2ce89dd94a [corlib] Fix exposed public APIs 2016-08-22 13:28:24 +02:00
Marek Safar 426cf7184f Update ms-test-suite 2016-08-22 13:28:24 +02:00
Kamil Rytarowski d04560589c Fix NetBSD build in proclib.c (#3378) 2016-08-22 08:45:17 +02:00
Marek Safar 53f837f3a4 [corlib] More sources from referencesource 2016-08-20 23:16:48 +02:00
Marek Safar 5fc43f7fb4 [corlib] Print some info on FailFast 2016-08-20 22:35:44 +02:00
Zoltan Varga 9efe45052a [runtime] Use a coop semaphore instead of an io layer one to wait for thread start. (#3383) 2016-08-20 11:36:20 +02:00
Marek Safar 1513f87658 [corlib] Interning of utc literals in TimeZoneInfo conversion. Fixes #43512 2016-08-20 11:05:23 +02:00
Johan Lorensson c16b127027 Visual Studio project updates and enhancements to support static libmono and additional test/debug projects. (#3420)
* Fixing linker warning when building libmono DLL.

After splitting mono runtime into a static library used when building libmono
DLL, we got a linker warning since there were no object files left in the
libmono project. There was also a sematic issue with the current organization
of DllMain since it is located in driver.c that will be compiled into the static
library and then consumed by the linker building the DLL. In cases where the
static library was consumed directly it would still include DllMain entry point.

By splitting the DllMain method implementation into a separate specific windows file
we can both resolve the linker warning and remove the DllMain method implementation from the static
library and only include it when building the libmono DLL.

* Visual Studio projects support to optimally link mono applications using static libmono library.

Added a new property, MONO_USE_STATIC_LIBMONO that can be used to link some
mono applications, for example mono(-sgen).exe, towards static version of libmono.

This gives us the option to build a binary without dependencies on other runtime binaries
minimizing what’s needs to be deployed in order to run mono. This in combination with static linked c-runtime
(another option available through a VS property) will produce a mono runtime binary without
addition dependencies except .NET assemblies deployed by mono runtime users.

The default is still using the dynamic version of libmono as before.

* Visual Studio project to test/debug testdriver tests from within Visual Studio.

Added an additional Visual Studio project preconfigured to run testdriver related tests
directly from within Visual Studio.

Commit also includes an additional configuration script that can be used test projects in order
to setup a mono config file. The testdriver project uses this to create a unique configuration
files pointing to the build libtest.dll for running configuration. The configuration file will then
be used when the tests are executed to make sure the correct libtest.dll for current build configuration
gets used when running test different tests from within the Visual Studio debugger.

The project comes with a number of user macros as well that can be used in order to tailor how the tests are run.
Most of the values are preconfigured and shouldn't need to be changed in order to use
current build. In order to change the test that is executed, use the following user macro
defined in mono-testdriver-test property sheet added to the project:

MONO_TESTDRIVER_RUN_TARGET

and point it to the assembly hosting the tests to execute from within Visual Studio.

* Visual Studio project to test/debug nunit tests from within Visual Studio.

Added an additional Visual Studio project preconfigured to run nunit related tests
directly from within Visual Studio.

The project comes with a number of user macros as well that can be used in order to tailor how the tests are run.
Most of the values are preconfigured and shouldn't need to be changed in order to use
current build. In order to change the test that is executed, use the following user macro
defined in mono-nunit-test property sheet added to the project:

MONO_NUNIT_RUN_TARGET

and point it to the assembly hosting the tests to execute from within Visual Studio.

There is also an additional user macro defined:

MONO_NUNIT_FIXTURE

This can be used to limit the number of nunit test run within a test suite.
2016-08-19 23:20:38 -04:00
Aleksey Kliger (λgeek) 6be008c409 Merge pull request #3413 from lambdageek/reflection-split
[reflection] Divide reflection.c into multiple files. NFC
2016-08-19 18:40:08 -04:00
Andi McClure 72070cc2e0 GC Bridge: Make merge_cache more aggressive, less exact, faster
The merge_cache previously, if it encountered an SCC ("color") with
many outgoing links, would not attempt to merge that SCC with existing
SCCs and instead would just create a new color. Because unbridged SCCs
are now reported to the bridge client, the cost of creating extra
colors has increased. To mitigate this the merge cache now attempts to
merge objects of all sizes, and has been changed to be able to do this
performantly.

The biggest change is that in the case of a hash collision, SCCs will
sometimes be merged without fully checking if they are exactly equal.
This is considered okay because false merges will be infrequent and
nothing worse will happen than short-term failure to reclaim memory.

The bridge-pathologies double fan test has been amended to verify
large-object merging works.
2016-08-19 16:22:31 -04:00
Andi McClure c972ad051a GC bridge: Only export non-bridged objects when it's helpful
Augments each tarjan-bridge SCC ("color") with a count of how many
SCCs are pointing to it. The mechanism for exporting non-bridged SCCs
uses this count to only export those SCCs where the "double fan"
scenario appears to be occurring. In testing this eliminates the
performance overhead imposed by the previous commit.

Also renamed/moved some variable declarations because namespace bugs
were creeping in.
2016-08-19 16:12:45 -04:00
Andi McClure db60c62ff9 GC bridge: Include non-bridged objects in the exported object graph
Introduces a mechanism for non-bridged SCCs which lay between bridged
SCCs in the SCC forest to be reported to the bridge client. In this
version, such non-bridged SCCs are always reported. The result is that
most GCs get a little slower but GCs in which the "double fan" shape
appears (many bridged objects link to one C# object which links to
many bridged objects) become massively faster.

Because before clients were allowed to assume exported SCCs were
always bridged, SGEN_BRIDGE_VERSION has been incremented.
2016-08-19 16:07:22 -04:00
Andi McClure ca48b5e9e2 Remove headers unused by sgen-tarjan-bridge.c 2016-08-19 15:48:17 -04:00
Aleksey Kliger 1a1a9a1743 [win32] Add sre-encode.c and sre-save.c to libmonoruntime project 2016-08-19 14:34:27 -04:00
Aleksey Kliger 91ee154da4 [sre] Separate SRE MonoDynamicImage encoding and SRE Save functions to separate files. NFC
- (sre-encode.c) Encoding SRE builders into a MonoDynamicImage and token creation.

- (sre-save.c) Everything for saving SRE images to disk.
2016-08-19 14:32:38 -04:00
Jonathan Chambers 86b6624cdf Allocate handle stack for Boehm GC (#3421) 2016-08-19 19:14:46 +02:00
Niklas Therning d185b75dd7 Merge pull request #3419 from ntherning/fix-MonoTests.System.IO.DirectoryTest.DeleteDirectoryOnExistingFileName-on-win
Fixes MonoTests.System.IO.DirectoryTest.DeleteDirectoryOnExistingFileName on  Windows
2016-08-19 16:21:40 +02:00
Niklas Therning 9088f5a72a Fixes MonoTests.System.IO.DirectoryTest.DeleteDirectoryOnExistingFileName on
Windows

The error (ERROR_DIRECTORY) wasn't recognized in MonoIO so the error message
became "Win32 IO returned 267. Path: C:\foo\bar" which includes the path. The
test tests that the path isn't include in the message in the thrown
IOException.
2016-08-19 15:54:55 +02:00
Ludovic Henry ddcd0f707d Merge pull request #3416 from ludovic-henry/iolayer-extract-wait
[io-layer] Extract WaitForSingleObjectEx, WaitForMultipleObjectsEx and SignalObjectAndWait
2016-08-19 11:16:35 +02:00
Vlad Brezae c6c9631e1b Merge pull request #3418 from BrzVlad/fix-arm64-finalizer-wait
[arm64] Fix atomics
2016-08-19 11:28:54 +03:00
Vlad Brezae 5914d34fd7 [arm64] Add sequential memory constraint to swap, cas and add
Previously we were wrongly trying to achieve this by doing a load-acq followed by a store-rel. Assuming we have memory access on address A (before) and C (after) while the atomic operation happens on address B, the order of the instructions would look like this :

	[A], [B]load, load-acq, store-rel, [B]store, [C]

In this case a reordering of memory accesses like the following is possible, which clearly breaks the desired constraints :

	[B]load, load-acq, [C], [A], store-rel, [B]store

In order to provide the sequential memory constraint we could emit the barriers like this instead :

	[A], membar, [B]load, [B]store, membar, [C]

We can additionally save an instruction and emit the barriers like this instead (this is also what gcc does) :

	[A], [B]load, store-rel, [B]store, membar, [C]

In this case we only need to worry about the relation between memory accesses on A and the loading of B. We need to consider what happens if B is loaded before the access on A is fulfilled. This only matters if we load an older value for B (rather than the one visible by other threads) before A. In that case the erroneous store will fail due to using exclusive stores. At the retry the value read from B will be the right one.
2016-08-19 04:15:52 +03:00
Marek Safar b303ade7c6 [mcs] Fix wrong range check for pragma warning CSxxx. Fixes #43471 2016-08-18 23:06:26 +02:00
Aleksey Kliger 2a87e4f1bf [sre] Split out MonoDynamicImage and MonoDynamicStream functions 2016-08-18 17:03:16 -04:00
Ludovic Henry 5acc26578d [io-layer] Remove unused WaitForInputIdle 2016-08-18 21:51:15 +02:00
Ludovic Henry 5df6d38e61 [io-layer] Remove unused WaitForMultipleObjects 2016-08-18 21:51:14 +02:00
Ludovic Henry 11e45402b3 [io-layer] Replace use of WaitForSingleObject by WaitForSingleObjectEx 2016-08-18 21:51:13 +02:00
Ludovic Henry 8b0cd42ef7 [io-layer] Extract WaitForSingleObjectEx, WaitForMultipleObjectsEx and SignalObjectAndWait 2016-08-18 21:51:12 +02:00
Ludovic Henry b190f213a3 Merge pull request #3415 from ludovic-henry/net_2_1-to-mobile
[mcs] Replace NET_2_1 by MOBILE
2016-08-18 21:39:39 +02:00
Vlad Brezae 322e7d0be8 [arm64] Add full memory sequencing to atomic loads when necessary
Loads with acquire semantics guarantee that following memory accesses are not reordered with the load. Add full membar before it to ensure full sequencing.
2016-08-18 12:34:24 -07:00
Vlad Brezae 4c1dad1b67 [arm64] Add full memory sequencing to atomic stores when necessary
Stores with release semantics guarantee that previous memory accesses are not reordered with the store. Add a full membar after it to ensure full sequencing.
2016-08-18 12:33:00 -07:00
Niklas Therning 58e6594d4b Merge pull request #3412 from ntherning/fix-stack-alignment-issue-in-handler-block-trampoline-on-win64
Fixes stack alignment issue in handler_block_trampoline on Win64
2016-08-18 18:16:18 +02:00
Aleksey Kliger d8ef8c9444 [win32] Add new reflection files to vcxproj 2016-08-18 10:48:01 -04:00
Aleksey Kliger b6cf4908e0 [reflection] Rename files; adjust comments. 2016-08-18 10:48:00 -04:00
Ludovic Henry 5416358952 [mcs] Remove dead code 2016-08-18 16:38:50 +02:00
Ludovic Henry 249daf43de [mcs] Replace NET_2_1 by MOBILE
NET_2_1 is also defined whenever we define MOBILE, so they have the same effect. Silverlight was 2.1 but it's been dead for a while now, and we do not even support it.
2016-08-18 16:34:36 +02:00
Niklas Therning fe51729712 Fixes stack alignment issue in handler_block_trampoline on Win64
On Win64 Mono doesn't (yet) implement fast JIT TLS (mono_get_jit_tls_offset()
returns -1). This means that the code in
mono_arch_create_handler_block_trampoline() takes the code path in the "else"
which is the same code path taken when AOT compiling. The code generated in
this code path manipulates the stack pointer to ensure it's aligned properly
according to the ABI (RSP-8 is 16-byte aligned on function entry) for the AOT
case where the mono_handler_block_guard_trampoline() C function is called
directly from the handler_block_trampoline.

This patch unifies the JIT and AOT generated code to be as similar as possible
and gets rid of the fast path. There's no need for this code to be fast. The
handler_block_trampoline will after this patch call
mono_handler_block_guard_trampoline() directly, both in JIT and in AOT mode,
and then jump back to the saved return address itself rather than let the
MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD generic trampoline do this.

The tests mono/tests/finally_block_ending_in_dead_bb.exe and
mono/tests/block_guard_restore_aligment_on_exit.exe trigger this bug.
2016-08-18 14:40:17 +02:00
Vlad Brezae 499e5cd490 Merge pull request #3401 from BrzVlad/fix-managed-alloc2
[sgen] Fix managed alloc
2016-08-18 11:29:49 +03:00
Niklas Therning 8075cf3727 Merge pull request #3410 from lateralusX/jlorenss/vs2015-test-debug-projects
Visual Studio test/debug mono runtime utility projects.
2016-08-18 08:49:42 +02:00
Miguel de Icaza 50a4be2c5c [mkbundle] add support for distributing I18N encoding files and improved the man page 2016-08-17 22:49:56 -04:00
Aleksey Kliger 42dab3c0f8 [reflection] Divide reflection.c into multiple files. NFC
Split up reflection.c into three separate files:

1. reflection-query.c: This contains System.Type and  the interrogative System.Reflection APIs.
2. reflection.c: This contains the System.Reflection.Emit APIs
3. reflection-custom-attrs.c: All about dealing with custom attributes.
2016-08-17 18:01:44 -04:00
Vlad Brezae 46e7c742cc [aot] Fallback to slowpath managed alloc if we fail to create the normal one
The slowpath managed allocator doesn't require any tls support.

Fixes #42169.
2016-08-18 01:00:16 +03:00
Vlad Brezae 90ac4014a6 [sgen] Unify tls access across with/without HAVE_KW_THREAD platforms
Simplify code by always accessing tlab information and inside_critial_region through the SgenThreadInfo pointer. This also fixes potential failure to detect that we are in a critical region within the managed allocator.
2016-08-18 01:00:15 +03:00
Vlad Brezae 47f6f8cfde [aot] Don't aot methods that use tls on HAVE_KW_THREAD platforms
MONO_THREAD_VAR_OFFSET definitions don't work when loading mono as a dynamic library. This means that we need to be conservative and don't aot code that contains these tls chunks.

In the future, we should remove HAVE_KW_THREAD altogether and use only pthread since it simplifies the code alot.
2016-08-18 01:00:10 +03:00
Aleksey Kliger (λgeek) 5ac5585482 [runtime] Fix unhandled exception fatal error message. Fixes #43410 (#3404)
Partially revert bcbd0ac0c0
2016-08-17 15:33:03 -04:00
Marek Safar 0bd00f4154 Bump binary-reference-assemblies 2016-08-17 17:49:46 +02:00
Marek Safar 86e6221bec [bcl] Remove wrong ReferenceAssemblyAttribute(s) 2016-08-17 15:15:47 +02:00
lateralusX 8b1292313e Visual Studio test/debug mono runtime utility projects.
Added a couple of new/updated test/debug Visual Studio utility projects.
These projects can be used to quicker get up to speed when there is a need
to run/test/debug mono runtime tests inside Visual Studio debugger.

Added utility projects can be used to run mini regression tests using JIT as
well as compile/run full AOT:ed versions of mini regression tests or other assemblies.
The different .prop files are also organized so they can be reused when adding additional
run/test/debug projects going forward.
2016-08-17 13:56:26 +02:00
Marek Safar 400b5eb8b4 [System] Change WebRequest::BeginGetRequestStream driven IAsyncResult::CompletedSynchronously to match .net. Fixes #32374 2016-08-17 13:47:47 +02:00
Alexander Köplinger 8dbf5df12e [tests] Move constant-division.cs to the BASE_TEST_MOBILE_STATIC_NOT_SUPPORTED group
It relies on System.Reflection.Emit which means it doesn't work on mobile_static.
2016-08-17 11:29:35 +02:00
Craig McQueen 166653eecb mono_os_cond_timedwait: fix function name in g_error string (#3407)
It should say gettimeofday, not pthread_cond_timedwait. (This appears to
be a copy-and-paste error.)
2016-08-17 09:42:48 +02:00
Alexander Kyte eec5d58df8 [runtime] Default mobile_static AOT type to FullAOT 2016-08-16 21:11:53 +00:00
Alexander Köplinger 70602566de [ServiceModel] Don't throw in dummy InstanceContext constructor on mobile/xammac_4_5
Otherwise the NotImplementedException would prevent instantiating the class even though
we just use it as a dummy object on mobile.
2016-08-16 22:23:40 +02:00
Marek Safar 870cbdc8b9 [System] Report an error instead of success when proxy authentication is required. Fixes #19594 2016-08-16 22:22:45 +02:00
Aleksey Kliger 7a60679b15 [linker] Update mscorlib.xml to include some Mono.RuntimeStructs
Followup to
https://github.com/mono/mono/commit/70d7f5e35059bdb64d3c6b7e42d7ad5120b476d6
2016-08-16 16:06:35 -04:00
Zoltan Varga 64918cd5c2 Fix the full-aot build. 2016-08-16 19:21:31 +02:00
Niklas Therning 3761639707 Merge pull request #3403 from ntherning/fix-handler-block-trampoline-crash-on-win64
Fixes illegal CALL emitted in handler_block_trampoline on Win64
2016-08-16 17:26:06 +02:00
Marek Safar 97e51abfcf [System] Put back handling of direct ip addresses to ServicePoint::HostEntry (removed in 932359f). Fixes #42864 2016-08-16 15:15:05 +02:00
Marek Safar 6b26583efd [mcs] Avoid agressive generic members inflation from using static. Fixes #43400 2016-08-16 14:01:03 +02:00
Niklas Therning 89a1552d6f Fixes illegal CALL emitted in handler_block_trampoline on Win64.
The code in mono_arch_create_handler_block_trampoline() in tramp-amd64.c emits
a relative CALL which calls the mono_amd64_handler_block_trampoline_helper()
functions via:

  amd64_call_code (code, mono_amd64_handler_block_trampoline_helper)

This macro however only works properly for offsets less than 32-bits. For
64-bit offsets it truncates the offset to a 32-bit number. On Win64 the offset
in this case is always a number larger than 2^32. The emitted CALL will jump
to an illegal address causing a crash.

This patch changes the emitted code sequence to load the address of
mono_amd64_handler_block_trampoline_helper() to RAX and then calls the address
in RAX.

The test mono/tests/finally_block_ending_in_dead_bb.exe triggered this bug.
After this patch the test still crashes but in a new way related to another
bug.
2016-08-16 10:46:36 +02:00
Miguel de Icaza c3405680eb [linker] Bring various descriptors that were updated in iOS, but not on desktop Mono 2016-08-15 23:56:01 -04:00
Miguel de Icaza 7473246b06 [linker] Update descriptors for mscorlib to include the new _ThreadPoolWaitCallback 2016-08-15 23:42:24 -04:00
Zoltan Varga ac5102e9b4 [runtime] Cleanup naming of SRE icalls. NFC. (#3402)
Name the icall functions ves_icall_<TypeName>_<MethodName>. Move the SRE icalls to reflection.c from icall.c.
2016-08-15 23:24:19 +02:00
Marek Safar 3aa57ed53a [mcs] Don't reset temporary stack fields too early. Fixes #43265 2016-08-15 21:13:30 +02:00
Aleksey Kliger (λgeek) 694b115595 [reflection] Don't crash when building dynamic custom attributes on dynamic types (Fixes #43291) (#3399)
* [corlib] Regression test for non-visible custom attributes.

See https://bugzilla.xamarin.com/show_bug.cgi?id=43291

* [reflection] Don't crash when building dynamic custom attributes on dynamic types (Fixes #43291)

1. Don't dereference a NULL custom attribute ctor, throw a type load
   exception.
2. When building MonoCustomAttrInfo from an array of
   MonoReflectinoCustomAttr*, compute the number of
   non-visible (non-public) attributes correctly, and make sure to
   iterate over all the attributes when populating the result array.

Fixes [#43291](https://bugzilla.xamarin.com/show_bug.cgi?id=43291)

* [reflection] Marginally better TLE for custom attrs

At least include a message about what went wrong when trying to
construct a custom attribute from a type that isn't finished yet.
2016-08-15 15:05:14 -04:00
Zoltan Varga e4a17068f5 [runtime] Fix warnings. 2016-08-15 16:30:15 +02:00
Martin Baulig c5072c8f47 Fix the build.
Use the desktop version of MonoTlsProviderFactory.CreateDefaultProviderImpl()
in the 'mobile_static' profile.
2016-08-15 15:57:13 +02:00
Niklas Therning 87a0f5af23 Merge pull request #3396 from ntherning/fix-async-exc-compilation-on-windows
Fix the failure of the async-exc-compilation.exe test on Windows
2016-08-15 09:59:46 +02:00
Henric Müller e7ce5ea9d9 Fix empty hostname in GetHostByName on windows (#3397) 2016-08-14 22:05:32 -04:00
Alexander Köplinger b97fad34be [bcl] Fix netstandard mistake in WebHeaderCollection
I accidentally added this in 3c3ef17376 because I missed that on
full .NET this class inherits from NameValueCollection which provides `this[string name]` already
(the diff tool showed it as missing because it didn't take this into account).
2016-08-12 16:45:19 +02:00
Marek Safar b08769b904 Merge pull request #3398 from henricm/fix-for-test-helpers-symlink
Removing symlink of TestHelpers.cs
2016-08-12 15:55:35 +02:00
Henric Müller ce261e6b94 Removing symlink of TestHelpers.cs 2016-08-12 14:11:57 +02:00
Vlad Brezae 378b6bee20 [jit] Add missing special case for div with mul optimization
The algorithm does not handle the -1, 0 and 1 special divisors.
2016-08-12 14:56:44 +03:00
Niklas Therning 5a561604bf Fix the failure of the async-exc-compilation.exe test on Windows.
The test fails due an ArgumentException being thrown when the catch handler in
the test's Run() method tries to write to the console. The ArgumentException
is thrown in EncodingTable.GetCodePageFromName(string) since the encoding name
passed to it is null. Normally this exception would be caught and the default
encoding would fall back to UTF8. However, since the thread is aborted the
ThreadAbortException will be rethrown and terminates the test with an uncaught
exception. I have verified that the same behavior is seen on OS X if I mock up
the default encoding code to throw the same ArgumentException.

This patch adds a call to Thread.ResetAbort() just before the call to
Console.WriteLine() in the catch handler. This removes the abort status of the
thread and avoids the rethrow of the ThreadAbortException.
2016-08-12 11:16:00 +02:00
Marek Safar f99366e0c3 Merge pull request #3394 from mono/netstandard
NetStandard 1.6 members matching
2016-08-12 09:54:24 +02:00
Alexander Köplinger f8480362ab [bcl] Define NETSTANDARD in xammac profile as well 2016-08-12 02:36:28 +02:00
Vlad Brezae b51beacb8e Merge pull request #2332 from BrzVlad/feature-div-with-mul
[jit] Optimize divisions by immediate
2016-08-12 00:44:00 +03:00
Marek Safar 1d64a37df9 [Facades] Remove wrong facades 2016-08-11 20:53:47 +02:00
Marek Safar 406a5b8177 [Facades] Update version numbers 2016-08-11 20:53:46 +02:00
Marek Safar f5b5a6fdfd [Facades] System.Security.Cryptography.Algorithms on netstandard profiles only 2016-08-11 20:53:45 +02:00
Alexander Köplinger 3c3ef17376 [bcl] Update to match NETStandard 1.6 members 2016-08-11 20:53:38 +02:00
Vlad Brezae 49c169f53f [jit] Enable division by constant optimization on 32 bit 2016-08-11 21:21:41 +03:00
Vlad Brezae 55a6e47160 [arm] Implement OP_BIGMUL 2016-08-11 21:21:41 +03:00
Vlad Brezae ce5df6d400 [tests] Add random immediate division test 2016-08-11 21:21:40 +03:00
Vlad Brezae b518ec10c0 [jit] Register counter for number of optimized divisions 2016-08-11 21:21:39 +03:00
Vlad Brezae 3bc3787974 [jit] Optimize signed division by constant 2016-08-11 21:21:39 +03:00
Vlad Brezae 9b3d453006 [jit] Optimize unsigned division by constant 2016-08-11 21:21:39 +03:00
Marek Safar c37bbef8f0 [corcompare] Use only C# known parameter type attributes for methods signatures 2016-08-11 18:07:54 +02:00
Martin Baulig b0e0d4785e [System]: Use 'HttpWebRequest.Host' for certificate host name validation.
(cherry picked from commit 5200955033)
2016-08-11 17:05:07 +02:00
Martin Baulig a47c56383b [System]: Add new internal X509Certificate2Impl.IntermediateCertificates.
(cherry picked from commit 8ed20455a5)
2016-08-11 17:05:00 +02:00
Martin Baulig 8b541144b1 [System]: Add private Mono.Net.Security APIs which will be shared between AppleTls and BoringTls.
(cherry picked from commit 934a577a94)
2016-08-11 17:04:49 +02:00
Martin Baulig 0ba6c7f3e0 [System]: Cleanup the internal MonoTlsProviderFactory and prepare for BTLS.
(cherry picked from commit b919768e1a)
2016-08-11 17:04:40 +02:00
Aleksey Kliger (λgeek) a232eb3b84 Merge pull request #3389 from lambdageek/bug-43099
[coop] Temporarily restore MonoThreadInfo when TLS destructor runs.  Fixes #43099
2016-08-11 10:43:08 -04:00
Marek Safar a00de00d95 [mcs] More reliable tests 2016-08-11 09:55:23 +02:00
Niklas Therning d22f93ffa6 Merge pull request #3388 from ntherning/fix-thread-priority-on-windows
Fix getting/setting thread priority on Windows
2016-08-11 09:20:54 +02:00
Miguel de Icaza 22f30140f5 [mkbundle] Fix --fetch-target to not require an assembly, embed the proper assembly when --cross RUNTIME is used 2016-08-11 00:33:53 -04:00
Aleksey Kliger 21a4a22997 [handles] offsets-tool should include MonoObjectHandlePayload
Complements 3c05314390
2016-08-10 18:49:40 -04:00
Alexander Kyte f4a87fca69 Merge pull request #3390 from alexanderkyte/fix_nunitlite_build_state
[nunitlite] Pass greedily, not fail greedily
2016-08-10 16:36:13 -04:00
Alexander Kyte d37b48e1f8 [nunitlite] Pass greedily, not fail greedily 2016-08-10 16:29:16 -04:00
Aleksey Kliger 3c05314390 [coop] Fix MONO_HANDLE_PAYLOAD_OFFSET() for cross-compilation
- fix MONO_HANDLE_PAYLOAD_OFFSET when MONO_STRUCT_OFFSET expands to
 token-pasting
- add MonoObjectPayloadHandle decl to object-offset.h machinery.
2016-08-10 16:28:59 -04:00
Alexander Kyte 539ae700e2 Merge pull request #2780 from alexanderkyte/seq_point_optimize
[runtime] Implement performant unbounded-depth sequence point search
2016-08-10 15:47:59 -04:00
Aleksey Kliger 82ce6b8b28 [marshal] Ensure uses_handles is initialized. 2016-08-10 14:56:09 -04:00
Aleksey Kliger 57fb9aa164 [coop] Temporarily restore MonoThreadInfo when TLS destructor runs. Fixes #43099
We need a valid MonoThreadInfo in the TLS key while we run
unregister_thread because we may need to block the thread when it tries
to take the sgen GC mutex.

Fixes [#43099](https://bugzilla.xamarin.com/show_bug.cgi?id=43099)
2016-08-10 12:14:52 -04:00
Marek Safar 3fb3cdf6d7 [mono-api-html] Show assembly version differences 2016-08-10 17:30:56 +02:00
Niklas Therning df867664ee Merge pull request #3213 from henricm/fix-for-win-securestring-to-bstr
Fix for win securestring to bstr
2016-08-10 17:04:53 +02:00
Niklas Therning dca0544211 Fix getting/setting thread priority on Windows
The mono_threads_platform_get_priority()/mono_threads_platform_set_priority()
functions in mono-threads-windows.c assume the "handle" member has been set in
the MonoThreadInfo struct passed to it but it's always NULL. This patch
implements mono_threads_suspend_register() in the same file which sets the
"handle" member at thread registration time, like it's done in
mono-threads-posix.c.

This patch also makes sure the priority of a new thread is set as expected
when the Thread.Priority property has been changed prior to the thread being
started.

Also added a test method to mono/tests/priority.cs which tests that the
priority of the main thread is Normal by default and that it can be changed as
expected.

The changes in this patch fixes the failures in mono/tests/priority.exe on
Windows i386 and x64.
2016-08-10 16:47:33 +02:00
Marek Safar a350474b32 [mcs] Report second level references mismatch only for really used references. Fixes #42702 2016-08-10 15:54:04 +02:00
monojenkins 6e17b26ef5 Merge pull request #3387 from xmcclure/test-suite-bump
Update ms-test-suite to fix broken test
2016-08-10 00:30:10 +02:00
Alexander Köplinger 8ac1adac8e [WinForms] Fix a test to correctly check for Mono
typeof (int).GetType ().GetType ().Name is now RuntimeType since https://github.com/mono/mono/pull/3045.
We did not notice this since most of our bots don't run with en-US locale set which this test requires.
2016-08-10 00:16:06 +02:00
Alexander Köplinger dfdbf0c365 [mono] Use -size 0 instead of -empty as find argument
The latter is not supported by the "find" binary in Alpine. The former works everywhere.
2016-08-10 00:16:06 +02:00
Alexander Köplinger 66881ac454 [mini] Fix mktemp argument in test_op_il_seq_point.sh
mktemp on e.g. Alpine requires at least six 'X' characters in the template argument.
2016-08-10 00:16:05 +02:00
Alexander Köplinger cbe8a553b0 [mdoc] Remove --exclude=.svn from diff arguments
We don't use svn anymore since a very long time and some diff implementations (e.g. in Alpine) don't support --exclude.
Removing the argument is an easy fix.
2016-08-10 00:16:04 +02:00
Alexander Köplinger 421481419d [acceptance-tests] Run ms-test-suite with debug symbols
So we get line numbers in stack traces.
2016-08-10 00:16:04 +02:00
Zoltan Varga d4052c5563 [runtime] Use a coop semaphore instead of the io-layer one in the monitor code. (#3382) 2016-08-09 22:51:30 +02:00
Andi McClure 269608b176 Update ms-test-suite to fix broken test 2016-08-09 16:45:24 -04:00
Alexander Kyte 6718281ee8 Merge pull request #3386 from alexanderkyte/nunit_lite_return_status
[runtime] Make nunitlite return failure exit code when tests fail
2016-08-09 15:03:27 -04:00
Marek Safar 1fe681e47c Merge pull request #3373 from marek-safar/net-4.6.2
[bcl] Update Reference Source to .NET Framework 4.6.2
2016-08-09 21:02:27 +02:00
Alexander Kyte 9f798cb8eb [runtime] Return failure return status if nunit-lite test suite fails 2016-08-09 14:49:14 -04:00
Alexander Kyte e7dc20067c [runtime] Bump nunit-lite dependency for runner change 2016-08-09 14:47:34 -04:00
Marek Safar d948067ae9 [System] Remove one no longer needed uri workaround. Fixes #43032 2016-08-09 19:46:22 +02:00
Marek Safar b6a30059db [bcl] Update Reference Source to .NET Framework 4.6.2 2016-08-09 18:07:14 +02:00
Henric Müller c5cdfaec1e Moving BSTR conv to native code in SecureStringToBSTR.
Previous implementation laid out the BSTR structure
in directly memory in C# code. This layout was not correct
for windows.
Furthermore memory was allocated using AllocCoTaskMem but later freed
using SysFreeString which on windows are different memory areas.
Third issue is that SecureString asumes big-endian when copying the chars
to its internal byte buffer. So on little-endian environments,
a swap of bytes is needed before the buffer is sent to native side
for BSTR conversion. This should probably be handled internally in
SecureString instead.
2016-08-09 14:09:32 +02:00
Kamil Rytarowski ab14520764 Handle NetBSD specific iconv(3) call prototype (#3376)
In the past there were wars between constified and unconstified
second parameter.. NetBSD went with constifying it. POSIX went without
const and most other OSes standarized. NetBSD is still having
incompatible function prototype.

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <iconv.h>

     size_t
     iconv(iconv_t cd, const char ** restrict src, size_t * restrict srcleft,
           char ** restrict dst, size_t * restrict dstleft);
2016-08-09 12:41:54 +02:00
Marcos Henrich 1e6895d366 Merge pull request #3353 from esdrubal/st-format
[corlib] Removed MVID and AOTID metadata.
2016-08-09 10:34:06 +01:00
Alexander Köplinger c4f4517828 [ci] Another Python 3 fix in babysitter
```
  File "./scripts/ci/babysitter", line 424, in run
    for xml in (xml_list + wrote_xml):
TypeError: can only concatenate list (not "map") to list
```
2016-08-09 02:12:53 +02:00
Kamil Rytarowski 3e6701d4b2 Define _NETBSD_SOURCE for mincore(2) (#3380) 2016-08-09 02:00:44 +02:00
Kamil Rytarowski 615f644ca1 Fix the definition of legacy_closer(), detected on NetBSD (#3377) 2016-08-09 01:59:31 +02:00
Kamil Rytarowski 1b7d212ead Resurrect NetBSD support in mono-perfcounters.c 2016-08-09 01:28:48 +02:00
Alexander Köplinger 07cdf4137c [ci] Python3 fix in babysitter script
iteritems() was removed in py3, we can just use items() instead since we're iterating
over the list anyway so we don't need the lazy evaluation behavior of iteritems().
2016-08-08 23:51:45 +02:00
Kamil Rytarowski 5fe8bfae7d Introduce mono-threads-netbsd.c (#3374) 2016-08-08 17:21:38 -04:00
Kamil Rytarowski 736a445ddc Fix shell portability, detected with NetBSD/pkgsrc (#3375) 2016-08-08 17:20:49 -04:00
Aleksey Kliger (λgeek) 70d7f5e350 Merge pull request #3349 from lambdageek/handle-icalls-in-jit
[handles] Add coop handles in wrapper to icalls with HANDLES() declaration
2016-08-08 16:39:13 -04:00
Alexis Christoforides 71a846cace [sgen] Support nursery canaries with managed allocators 2016-08-08 16:22:34 -04:00
Alexis Christoforides 08f47d5693 [sgen] "align-up" requested allocation sizes within the managed allocator, instead of sometimes before.
All code paths will still align-up the size to be allocated, but now it's easier to gather the real size of an object.
2016-08-08 16:22:34 -04:00
Alexis Christoforides 056a0a6ccf [sgen] Nursery canaries option now gives more useful information on failures 2016-08-08 16:22:33 -04:00
Aleksey Kliger 950ec31540 [marshal] Assert if adding handles to an out or inout parameter of an icall.
Eventually should support this (System.RuntimeType.GetInterfaceMapData
could use it, for one) but for now just assert.
2016-08-08 12:50:19 -04:00
Aleksey Kliger 588900f837 [marshal] Load payload from return handle 2016-08-08 12:50:18 -04:00
Aleksey Kliger bb4cb46eb1 [marshal] If an icall is getting handles and MonoError added, it better
check for exceptions.
2016-08-08 12:50:17 -04:00
Aleksey Kliger 106c604f29 [marshal] Wrap icall managed obj input arguments with handles. 2016-08-08 12:50:16 -04:00
Aleksey Kliger fd44a557dd [runtime] Modify Zoltan's prototype to query icall-def.h handles tables
TODO: there's a gratuitous call to mono_lookup_internal_call_full().
Should really cache the uses_handle info along with the addr since the
lookup by name is rather involved.
2016-08-08 12:50:15 -04:00
Aleksey Kliger 8e509d4d09 [runtime] Add HANDLES() macro to icall-def.h
The HANDLES() macro can be wrapped around an ICALL() to signal that
the icall should use the coop handles machinery from handles.h
2016-08-08 12:50:14 -04:00
Zoltan Varga 98705767f9 Add RuntimeStructs class. 2016-08-08 12:50:13 -04:00
Zoltan Varga 9c29176aa2 Pass a MonoError argument to icalls. 2016-08-08 12:50:07 -04:00
João Matos f1efd46acb Merge pull request #3372 from ntherning/fix-g_win32_getlocale
Explicitly use the ANSI version of GetLocaleInfo() in g_win32_getlocale()
2016-08-08 17:26:28 +01:00
Niklas Therning 7945519f84 Explicitly use the ANSI version of GetLocaleInfo() in g_win32_getlocale()
Since UNICODE is defined when Mono is compiled under Windows the
GetLocaleInfo() macro will expand to GetLocaleInfoW() which returns the
current locale identifier in g_win32_getlocale() in 16-bit Unicode.
g_win32_getlocale() however expects an 8-bit encoding. By using
GetLocaleInfoA() explicitly we'll get the identifier back as an ordinary 8-bit
C string.

This patch fixes the mono/tests/threadpool-exceptions5.exe test.
2016-08-08 17:17:19 +02:00
Marcos Henrich 60f8256fd8 [corlib] Removed MVID and AOTID metadata.
MVID and AOTID metadata is no longer displayed at the end of the stack
trace.

Now, every stack frame contains a MVID and AOTID inlined.

An IL offset stackframe looks like:
  at StackTraceDumper.Main () [0x00000] in <a3ec873a838c42c29f4eba7cab7d1dfb>:0

A native offset stack frame looks like:
  at StackTraceDumper.<Main>m__0 () <0x100e15d50 + 0x00029> in <a3ec873a838c42c29f4eba7cab7d1dfb#b37a9d11247b811ffffdaff8090d8a59>:0
2016-08-08 16:12:59 +01:00
Alexander Köplinger 8d1a18d611 Merge pull request #2903 from krytarowski/netbsd-support-4
Implement mremap(2) usage on NetBSD
2016-08-08 11:47:08 +02:00
Zoltan Varga f34c0223fc Fix the loaded llvm build. 2016-08-08 01:40:17 +02:00
Ludovic Henry 7324cd4a7a Merge pull request #3370 from ludovic-henry/fix-finalizer-wait
[gc] Fix crash when doing WaitForPendingFinalizers
2016-08-07 18:58:45 +02:00
Ludovic Henry df3278863a [gc] Fix crash when doing WaitForPendingFinalizers
The crash would come from a use-after-free of stack memory: in coop_cond_timedwait_alertable, we would allocate the struct we pass to the mono_thread_info_install_interrupt function on the stack. But there is no guarantee as to when break_coop_alertable_wait is run. The fix is to allocate the data passed to mono_thread_info_install_interrupt on the heap, and free it in the callback, or if it hasn't been interrupted.
2016-08-07 13:45:56 +02:00
Vincent Povirk 466097af62 [x86] Only pinvoke methods are stdcall. (#3354)
For xamarin bug 30146.
2016-08-07 03:29:41 -04:00
Zoltan Varga 871a3d453b [runtime] Fix the loaded llvm build. 2016-08-06 13:03:40 -04:00
Marek Safar 105085eb95 Merge pull request #3356 from marek-safar/cecil-update
Cecil update
2016-08-06 09:31:04 +02:00
Zoltan Varga d66b50ddb8 [runtime] Store the original invoke method in WrapperInfo for delegate invokes, use that to fix the check in find_aot_method_in_amodule (). 2016-08-05 18:59:07 -04:00
Marek Safar 5b0af84d6a [monosymbolicate] Update project file 2016-08-05 23:08:14 +02:00
Marek Safar 2d34a90a4c [Mono.Cecil] Add special handling of legacy 0.9.5 version 2016-08-05 23:08:13 +02:00
Marek Safar 0eada4ca3b [mono-symbolicate] Better test failure reporting 2016-08-05 23:08:12 +02:00
Marek Safar e3f25930e1 [mdoc] Update project file 2016-08-05 23:08:12 +02:00
Marek Safar 2371e279ae [Mono.Contract] Less obsolete warnings 2016-08-05 23:08:11 +02:00
Marek Safar d80283d1e8 [bcl] Reflect cecil breaking changes 2016-08-05 23:08:10 +02:00
Marek Safar 78bc83d6c6 Update Cecil to the latest master 2016-08-05 23:08:03 +02:00
Alexander Köplinger 2289feac4c Merge pull request #3363 from akoeplinger/fix-42938
[xbuild] Use the xbuild ToolsVersion even if another one is specified in the csproj
2016-08-05 22:54:59 +02:00
Zoltan Varga 32f8df796e [arm] Fix aot support in the sdb soft breakpoint trampolines. 2016-08-05 16:29:14 -04:00
Alexander Köplinger 97076ff919 [ci] Don't build mobile profiles in a monolite build
The mobile profiles rely on system resgen2 which is not present in a monolite build.
2016-08-05 19:44:48 +02:00
Niklas Therning 7e92715a0f Merge pull request #3359 from ntherning/sgen-avoid-scanning-stack-guard-page-on-windows
Prevent SGen from scanning the guard page used by Windows to dynamically grow the stack
2016-08-05 19:25:39 +02:00
Alexander Köplinger c7aa64ab0b Merge pull request #3361 from xmcclure/babysitter-xml
Add mono/tests support to CI babysitter
2016-08-05 18:58:44 +02:00
Zoltan Varga 98f6d1e7ce Initial prototype for handling handle stack setup and argument/return value conversion in icall wrappers. 2016-08-05 12:16:33 -04:00
Niklas Therning 29fecdd2fc Merge pull request #3365 from ntherning/fix-gc-graystack-stress-on-win64
Fixes the mono/tests/gc-graystack-stress test on Windows x64
2016-08-05 17:16:28 +02:00
Alexander Köplinger ca43f903c2 Merge pull request #3337 from akoeplinger/fix-alpine
Fix Alpine build
2016-08-05 16:50:04 +02:00
Alexander Köplinger 23fda51698 [ci] Add a CI_TAGS option for building with monolite
Also ensure that all the CI_TAGS check work with multiple values.
2016-08-05 16:49:37 +02:00
Alexander Köplinger 34bc900fc7 [ci] Run "make" in parallel in run-jenkins.sh
To speed up the build.
2016-08-05 16:49:37 +02:00
Ludovic Henry 8194bea584 Merge pull request #3288 from ludovic-henry/iolayer-extract-threading
[io-layer] Extract threading code
2016-08-05 15:05:34 +02:00
Niklas Therning 84d0f76ec7 Prevent SGen from scanning the guard page used by Windows to dynamically grow
the stack.

Windows uses a guard page before the committed stack memory pages to detect
when the stack needs to be grown. If we suspend a thread just after a function
prolog has decremented the stack pointer to point into the guard page but
before the thread has been able to read or write to that page, starting the
stack scan at the thread's ESP/RSP will raise a STATUS_GUARD_PAGE_VIOLATION and
the process will crash.

This patch uses VirtualQuery() to determine whether the thread's stack_start
value points into the guard page. If it does the stack scan will instead be
started at the following, non-guard page.
2016-08-05 14:54:06 +02:00
Marek Safar 643eadf903 Bump binary-reference-assemblies 2016-08-05 14:29:28 +02:00
Niklas Therning 56664d10bf Fixes the mono/tests/gc-graystack-stress test on Windows x64
Windows x64 only has 1 MB of stack per thread which is less than other x86
64-bit OSes. Using 10000 for "depth" in this test causes a stack overflow on
Windows x64. This patch changes "depth" to 5000 only on Windows x64. 5000 will
fit within the default stack size.
2016-08-05 14:18:27 +02:00
Ludovic Henry b8fff1390a Merge pull request #3355 from ludovic-henry/process-fix-exited
[process] Fix Process.Exited event triggered too soon
2016-08-05 10:59:21 +02:00
Miguel de Icaza 0d1f6eea5b Remove stray comment 2016-08-04 23:56:52 -04:00
Zoltan Varga a9e01245a9 [arm] Fix the initialization of the variable holding the single step trampoline address when using soft breakpoints + aot. 2016-08-04 18:15:34 -04:00
Alexander Kyte 18b834028e Merge pull request #3360 from alexanderkyte/mini_fix_timeout
[runtime] Increase mini bitcode timeout and add parallelism
2016-08-04 16:03:14 -04:00
Alexander Kyte 37210cf0d4 [mobile_static] Give bitcode mini tests parallelism and more time 2016-08-04 16:02:29 -04:00
Alexander Köplinger a1a54b5f14 [xbuild] Use the xbuild ToolsVersion even if another one is specified in the csproj
This is the recent behavior in .NET/MSBuild as well [1]:

> Starting in Visual Studio 2013, the MSBuild Toolset version is the same
> as the Visual Studio version number. MSBuild defaults to this Toolset
> within Visual Studio and on the command line, regardless of the
> toolset version specified in project file.

With this change xbuild will always use its own version instead
of the one specified in the project, unlessa ToolsVersion is forced
via the /tv switch on the command line.

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

[1] https://msdn.microsoft.com/en-us/library/bb383796.aspx#Anchor_1
2016-08-04 21:57:26 +02:00
Andi McClure 3c3dd75865 Add NUnit XML support to test babysitter, also document the communication protocol better
For test harnesses which don't support the full babysitter protocol,
the test harness can now report back paths to NUnit-format XML files
containing test results, or the paths to those XML files can be given
by whoever invoked the babysitter script. Failures listed in the XMLs
are included in the babysitter log.

test-runner.cs has been modified to report its XMLs, so we should now
see mono/tests failures in the babysitter log.
2016-08-04 15:09:34 -04:00
João Matos 427af110f6 Merge pull request #3357 from tritao/zip_delete_entries
[System.IO.Compression] Remove the entry from ZipArchive entries when its deleted
2016-08-04 18:27:37 +01:00
Ludovic Henry 8afaa90625 [process] Fix Process.Exited event triggered too early
The Process.Exited event would be triggered too early, leading to crash in code using this event to access the process exit code. This is because in Process.ExitCode, we first check that the process has really exited.
2016-08-04 18:59:50 +02:00
Niklas Therning 687cb3e46a Merge pull request #3358 from ntherning/disable-sgen-red-zone-on-win64
Set SGen's REDZONE_SIZE=0 on Win64
2016-08-04 16:45:59 +02:00
Niklas Therning eb9d4b44e7 Set SGen's REDZONE_SIZE=0 on Win64 since the ABI defines no red zone and the
ABI states that "All memory beyond the current address of RSP is considered
volatile".

On Windows the stack grows dynamically as the thread needs more stack space.
Windows places a guard page before the page at the top of stack and when this
guard page is accessed by the thread Windows will add a new page to the stack
and resume the thread.

Before this fix SGen on Win64 subtracted 128 from the stack pointer of a
suspended thread and started the stack scan from this address. In the case
when the stack pointer would be less than 128 from the start of the memory
page SGen would attempt to read from the previous page. If this happens to be
the guard page a STATUS_GUARD_PAGE_VIOLATION exception is raised and the
process crashes. The sgen-weakref-stress.exe triggered this bug on almost
every invocation.
2016-08-04 16:07:11 +02:00
Ludovic Henry 257b951a6c [io-layer] Remove threads.h, thread-private.h and wthreads.c 2016-08-04 15:41:47 +02:00
Ludovic Henry 44e8f37286 [io-layer] Remove unused _WAPI_THREAD_CURRENT 2016-08-04 15:41:46 +02:00
Ludovic Henry 3c52d24037 [io-layer] Extract thread MonoW32HandleOps 2016-08-04 15:41:46 +02:00
Ludovic Henry bd07ed29e0 [io-layer] Extract GetThreadPriority and SetThreadPriority 2016-08-04 15:41:45 +02:00
Ludovic Henry 3a3801b1e1 [io-layer] Extract wapi_create_thread_handle 2016-08-04 15:41:44 +02:00
Ludovic Henry fab2d1f531 [io-layer] Extract wapi_thread_own_mutex and wapi_thread_disown_mutex 2016-08-04 15:41:17 +02:00
Ludovic Henry c472a8e636 [io-layer] Extract wapi_current_thread_desc 2016-08-04 15:40:47 +02:00
Ludovic Henry 020ca4264b [io-layer] Extract wapi_ref_thread_handle 2016-08-04 15:40:26 +02:00
Ludovic Henry 27b44e002b [io-layer] Remove _wapi_thread_cur_apc_pending 2016-08-04 15:40:25 +02:00
Ludovic Henry 23613bd913 [io-layer] Extract wapi_get_current_thread_handle 2016-08-04 15:40:25 +02:00
Ludovic Henry 3cd88d5518 [io-layer] Extract wapi_thread_handle_set_exited 2016-08-04 15:40:20 +02:00
Ludovic Henry d19e5eaeae [io-layer] Make _wapi_getpid, _wapi_thread_own_mutex, _wapi_thread_disown_mutex and _wapi_mutex_abandon functions public 2016-08-04 15:00:07 +02:00
Ludovic Henry 523740c04a [io-layer] Make _WapiHandle_thread struct public 2016-08-04 15:00:06 +02:00
Ludovic Henry bd3e01a6ec [mono-threads] Split platform and suspend specific functions
We split mono-threads-{posix,windows,mach}.c functions in 2 categories:
 - platform: depends on the host the runtime is compiled on (possible values: posix or windows)
 - suspend: depends on the mono-threads suspend backend in use (possible values: posix, windows or mach)
2016-08-04 15:00:05 +02:00
Ludovic Henry dfa6daf9ed [io-layer] Make wait.c not depend on _wapi_thread_cur_apc_pending 2016-08-04 15:00:04 +02:00
João Matos 179e33d100 [System.IO.Compression] Remove the entry from ZipArchive entries when its deleted. Fixes #43022.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43022.
2016-08-04 13:21:13 +01:00
Marek Safar c0bd75d8cd [mcs] Better error reporting for missing types during conversion 2016-08-04 12:57:42 +02:00
Miguel de Icaza 5ea18d668c [build] Update order.xml data 2016-08-03 23:14:59 -04:00
Zoltan Varga b32c4cf6d1 [arm64] Assert that the displacement is not out of range int he b/bl macros, instead of in arm_get_disp (), so the assert location is more meaningful. 2016-08-03 19:50:11 -04:00
Alexander Kyte a41a317d69 Merge pull request #3352 from alexanderkyte/mini_bitcode_fix
[runtime] Provide Mono.Simd.dll to llvmonlycheck+fullaotcheck
2016-08-03 13:35:21 -04:00
Alexander Kyte fb726a78e9 [runtime] Provide Mono.Simd.dll to llvmonlycheck+fullaotcheck 2016-08-03 13:24:32 -04:00
Alexander Köplinger 9e132b68e7 Merge pull request #3351 from kasthack/patch-2
Added missing DeliveryFormat property to MailClient
2016-08-03 18:31:35 +02:00
Zoltan Varga 32a3e6815c [arm] Initialize breakpoint_tramp later in full aot mode, its not available in arch_init (). 2016-08-03 11:31:48 -04:00
Konstantin Safonov 0902d69876 Added missing DeliveryFormat property to MailClient
Doesn't actually change the behavior but at least allows to build sources referencing it on mono.
https://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.deliveryformat(v=vs.110).aspx
2016-08-03 17:50:53 +03:00
Aleksey Kliger (λgeek) 9e4743224b Merge pull request #3347 from lambdageek/coop-abort-ignore-unhandled
[coop] Don't call unhandled exn hook for ThreadAbortException
2016-08-03 10:29:33 -04:00
Marek Safar d3582e9b85 [mcs] More tweaks in betterness improvements. Fixes #41724 2016-08-02 20:54:37 +02:00
Aleksey Kliger 65c1b9cc10 [coop] Don't call unhandled exn hook for ThreadAbortException
Fixes the weird Jenkins logs for the coop job.
2016-08-02 12:32:24 -04:00
Aleksey Kliger (λgeek) 3a980691bc Merge pull request #3344 from alexanderkyte/propagate_mono_error_async
[runtime] Propagate async MonoError to AsyncResult
2016-08-02 11:31:44 -04:00
Marek Safar ff24de4596 [bcl] Don't build not installed mobile assemblies 2016-08-02 10:23:04 +02:00
Aleksey Kliger (λgeek) 0f111ae86f Merge pull request #3340 from lambdageek/dev/invoke-unhandled-exception-hook
[runtime] Move mono_invoke_unhandled_exception_hook to metadata
2016-08-01 19:22:43 -04:00
Alexander Kyte dcf4d62881 Merge pull request #3345 from alexanderkyte/fix_mini_aot_flags
[runtime] Pass invariant AOT options to mini aot tests
2016-08-01 17:17:07 -04:00
Alexander Kyte c69ede50f2 Merge pull request #3269 from alexanderkyte/silence_zero_len
[runtime] Disable noisy warning
2016-08-01 16:41:45 -04:00
Aleksey Kliger e5dfc41368 [test] Fix sporadic Mono.Debugger.Soft ThreadpoolIOsinglestep failure.
ReadAsync size arg should not be greater than array.Length - offset.
2016-08-01 16:13:00 -04:00
Zoltan Varga fcf5c93cc4 Fix the build. 2016-08-01 15:36:58 -04:00
Alexander Kyte c337b093ef [runtime] Propagate async MonoError to AsyncResult 2016-08-01 15:26:44 -04:00
Zoltan Varga dd6eeb391e [runtime] Implement WaitForPendingFinalizers used cond vars instead of io-layer events. (#3315) 2016-08-01 15:22:57 -04:00
Aleksey Kliger 0896614b5c [threads] Call mono_invoke_unhandled_exception hook in mono_thread_internal_unhandled_exception.
When a GC or threadpool thread dies due to an unhandled exception,
invoke the unhandled exception hook to exit, instead of exiting directly.
2016-08-01 15:15:09 -04:00
Alexander Kyte 2fdca79292 [runtime] Pass invariant AOT options to mini aot tests 2016-08-01 15:09:31 -04:00
Alexander Köplinger 34bc55c89a Bump to include the F# bockbuild patch 2016-08-01 20:25:16 +02:00
Zoltan Varga 975291ac17 [arm] Use soft breakpoints on watchos. 2016-08-01 13:11:30 -04:00
Ludovic Henry 182be7ac05 Merge pull request #3342 from ludovic-henry/gc-domain-finalizer-sem
[gc] Replace domain finalizer request cond+mutex by a semaphore
2016-08-01 18:17:09 +02:00
Aleksey Kliger (λgeek) 8f8fc0efef Merge pull request #3335 from lambdageek/dev/system-reflection-assembly
[reflection] Move AssemblyName to managed
2016-08-01 10:41:37 -04:00
Aleksey Kliger b32a5ba469 [llvm] In default_mono_llvm_unhandled_exception call mono_invoke_unhandled_exception_hook to exit
instead of exiting directly.
2016-08-01 10:37:38 -04:00
Marek Safar eaf2ceb532 [Facades] Emit symbol files for lib like facades 2016-08-01 13:16:38 +02:00
Alexander Köplinger 11626cfe38 [man] Fix typo in environment variable name
The section was added in 410a200ecd but with the wrong name.
2016-08-01 12:13:31 +02:00
Ludovic Henry 2b53b83f5a [gc] Fix timeout in mono_domain_finalize 2016-08-01 11:14:06 +02:00
Ludovic Henry d55971068f [gc] Ensure we clean the DomainFinalizationReq 2016-08-01 08:43:57 +02:00
Ludovic Henry 99816b850b [gc] Replace domain finalizer request cond+mutex by a semaphore
This is possible because we only wait for it at one place, and only post it at one other place.
2016-07-30 11:58:41 +02:00
Zoltan Varga c1e65c7387 [arm] Implement support soft breakpoints + AOT. 2016-07-30 05:12:46 +00:00
Zoltan Varga 8c8e1f6dfe [sdb] Fix an aot assert. 2016-07-30 05:12:19 +00:00
Rodrigo Kumpera ff86e021c0 [corlib] Bring AssemblyName(string) to the happy C# world. 2016-07-29 16:18:15 -04:00
Rodrigo Kumpera 277aab6863 [corlib] Move Assembly::GetName to be implemented in managed.
This involves a few steps.

First define MonoAssemblyName in RuntimeStructs.cs

Then add some helped to decode blob arrays and handle hex digits.

Finally, move the actual implementation from native to managed.
2016-07-29 16:18:15 -04:00
Aleksey Kliger (λgeek) 35671f29a7 Merge pull request #3320 from lambdageek/dev/reflection-in-managed
[reflection] Marshal name strings from managed
2016-07-29 16:05:32 -04:00
Aleksey Kliger 00bf8defb4 [runtime] Move mono_invoke_unhandled_exception_hook to metadata
And call it consistently in thread start functions when the managed
thread start function returns with an exception.

(If coop is not enabled, the exception handler unwinds the thread and
when there's no handler invokes the unhandled exception hook via
jit_tls->abort_func, so this is just for the coop case.)

Fixes mono/tests/unhandled-exception-1.cs for coop and bitcode.
2016-07-29 12:55:35 -04:00
Aleksey Kliger c5d8e417e2 [reflection] Marshal name arg of RuntimeType.GetNestedTypes in managed code
Also do the name unmangling on the managed side.
2016-07-29 10:46:29 -04:00
Aleksey Kliger 21a9134c00 [reflection] RuntimeType.GetNestedTypes in managed 2016-07-29 10:46:29 -04:00
Aleksey Kliger e7da7e65db [reflection] Marshal name arg to some RuntimeType search methods
Marshal the name argument of Get{Methods,Properties}ByName,Get{Fields,Events}
in managed code.

Cleanup the corresponding icalls.
2016-07-29 10:46:29 -04:00
Aleksey Kliger 6fcec5e3cd [corlib] Add Mono.SafeStringMarshal struct
Allows safe allocation of native utf8 char* strings from managed
strings.

using (var h = new SafeStringMarshal (str)) {
   /* use h.Value IntPtr */
} // g_free'd by h.Dispose ()
2016-07-29 10:24:13 -04:00
Marek Safar 6af085036b [mcs] Recursive interface declaration check is needed for interfaces only. Fixes #42198 2016-07-29 15:21:12 +02:00
Marek Safar 540f271539 [mcs] Do exactly matching expression check for anonymous methods with successfully inferred return type only. Fixes #42611 2016-07-29 15:21:12 +02:00
Ludovic Henry d0fef1f2b4 Revert "[runtime] Add documentation to mono-os-{mutex,cond,sem} + Move to .c file"
This reverts commit 9ba062e5a1.
2016-07-29 12:35:44 +02:00
Ludovic Henry 816b393cff [gc] mono_os_cond_timedwait returns -1 on timeout, not ETIMEDOUT 2016-07-29 00:07:41 +02:00
Ludovic Henry 9ba062e5a1 [runtime] Add documentation to mono-os-{mutex,cond,sem} + Move to .c file 2016-07-29 00:07:40 +02:00
Aleksey Kliger d5090f6c35 [reflection] Plug more leaks. 2016-07-28 16:29:09 -04:00
Marek Habersack 19449f5f64 Fix a cut'n'paste error 2016-07-28 19:24:25 +02:00
Rodrigo Kumpera f1eb362a77 Merge pull request #3338 from lambdageek/dev/plug-ptrarray-leak
[reflection] Don't leak GPtrArray internal array
2016-07-28 11:21:01 -04:00
Alex Rønne Petersen 981e5b9c22 Merge pull request #3334 from alexrp/arm-cpu-detect-fix
[arm] Also check the 'model name' line for the architecture version.
2016-07-28 17:08:26 +02:00
Aleksey Kliger 4e2b72e678 [corlib] change Mono.SafeGPtrArrayHandle to a struct
Don't GC allocate short-lived internal garbage.
2016-07-28 10:59:14 -04:00
Aleksey Kliger e49968b916 [reflection] Don't leak GPtrArray internal array
`g_ptr_array_free (..., FALSE)` was the wrong thing here.  We always
want TRUE in our use cases.
2016-07-28 10:53:06 -04:00
Alexander Köplinger 74be3019a7 [mini] Fix asm/sigcontext.h include in exceptions-arm.h
We include the header under the PLATFORM_ANDROID ifdef in mono-sigcontext.h as well [1].
It was probably added because older Bionic didn't include this from signal.h [2].

Fixes the build on Alpine/musl-libc.

[1] https://github.com/mono/mono/blob/19a99abf1680c85f8ff58c2b44ea8c15bb557ca5/mono/utils/mono-sigcontext.h#L5
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=859580
2016-07-28 15:56:10 +02:00
Angelo Compagnucci d5aec290cb [libgc] fix musl incorrect sigcontext include
On musl __GLIBC__ is not defined, so the conditional logic will
not produce correct result. Add a specific case to handle when
__GLIBC__ is not defined.
2016-07-28 15:56:09 +02:00
Alexander Köplinger a329632db2 [io-layer] Add include for sys/types.h to processes.h to fix Alpine build
It showed the following error before:

```
In file included from wapi.h:23:0,
                 from wapi.c:2:
../../mono/io-layer/processes.h:218:31: error: unknown type name 'pid_t'
 gchar* wapi_process_get_path (pid_t pid);
                               ^
Makefile:603: recipe for target 'wapi.lo' failed
make[3]: *** [wapi.lo] Error 1
```
2016-07-28 15:04:14 +02:00
Marek Safar 19a99abf16 [mcs] Add codegen for compound assigment of complex expressions with concatenated string using await inside params arguments. Fixes #42224 2016-07-28 14:13:11 +02:00
Alex Rønne Petersen 21298d817d [arm] Make HAVE_ARMV{5,6,7} macros override hwcap detection.
This is necessary on weird devices where the hwcap code might fail to detect
the ARM version it's running on (usually caused by differences in /proc/cpuinfo
output).
2016-07-28 04:32:19 +02:00
Vlad Brezae 3fd4d31a18 Merge pull request #2961 from schani/fix-sgen-refactoring
SGen fixes and refactorings
2016-07-27 23:04:34 +03:00
Vlad Brezae 722f24df51 Merge pull request #3328 from BrzVlad/finalizer-thread-exited2
[sgen] Avoid popping the entire finalizer queues if finalizers are su…
2016-07-27 22:59:27 +03:00
Marek Safar 575c8c9c51 [System.Core] Add MonoTODOAttribute to workaround linker bug with IVT from mscorlib 2016-07-27 21:50:39 +02:00
Alex Rønne Petersen 6dea2d4e0d [arm] Also check the 'model name' line for the architecture version.
Some Android devices for some reason have a 'model name' line instead of a
'Processor' line. On such devices, we would fail to detect the architecture
version at all, and end up thinking that it's ARMv4 (even if the runtime
was compiled for ARMv7).
2016-07-27 18:17:40 +02:00
Marek Safar 3fab4bc111 [mcs] Detect constant switch statement fall-through. Fixes #42585 2016-07-27 11:40:49 +02:00
Marek Safar 0bcf586cda [Facades] Remove duplicate System.IO.Compression 2016-07-27 09:40:51 +02:00
Zoltan Varga 941573a764 [sdb] Explicitly encode in the JIT debug info whenever there is precise information about variable locations instead of checking whenever the method has seq points. Fixes #42750. 2016-07-26 20:32:37 -04:00
Vlad Brezae eb92161b45 [sgen] Avoid popping the entire finalizer queues if finalizers are suspended
When we shutdown we set suspend_finalizers flag in metadata so we no longer run any finalizers. After recent changes, we avoid traversing gc hashes for finalizer enqueuing when this flag is set. The counterpart, popping the queues empty (even without running the finalizers) can still take some time, especially since we lock for each entry. Exit early from this loop if we no longer need to run finalizers.

Achieve this by setting a new flag inside sgen, instead of passing the address of suspend_finalizers all the time to the sgen api.
2016-07-27 03:09:53 +03:00
Aleksey Kliger (λgeek) 6b8e96c44d Merge pull request #3199 from lambdageek/dev/proxy-setter
[remoting] Convert mono_store_remote_field_new_checked to managed code
2016-07-26 12:47:45 -04:00
Marek Safar 00e633549a [mcs] Report interpolated strings feature. Fixes #42410 2016-07-26 17:47:09 +02:00
Marek Safar 6dc559d43d Merge pull request #3330 from madewokherd/compactframework
Remap the Compact Framework PublicKeyToken for assemblies it ships.
2016-07-26 16:26:02 +02:00
Marek Safar 568eea52dd [System.Text.Encoding.CodePages] Small improvements 2016-07-26 16:13:30 +02:00
Marek Safar 79c78c1a14 [mono-api-info] Add contract-api option 2016-07-26 15:09:22 +02:00
Marek Safar e4051335bd [mono-api-html] Ignore more non breaking virtual changes when enabled 2016-07-26 15:09:22 +02:00
Marek Safar 91acac03a4 [bcl] Update some of .net apis 2016-07-26 15:09:22 +02:00
Ludovic Henry 6bbd1e393d [semaphore] Return error for mono_os_sem_timedwait 2016-07-26 14:03:00 +02:00
Ludovic Henry 01814d4a19 [semaphore] Make mono_os_semaphore_* functions return more meaningful values
By asserting on error, we ensure that we return from these functions only when successfull, or when it makes sense to return an error (for example, timedwait return -1 only on timeout or interrupt).
2016-07-26 14:02:17 +02:00
Ludovic Henry 98284703de [mutex] Make mono_os_mutex_* functions return more meaningful value
By asserting on error, we ensure that we return from these functions only when successfull, or when it makes sense to return an error (for example, timedwait return -1 only on timeout).
2016-07-26 14:02:17 +02:00
Alexander Köplinger 0a042da3ef Merge pull request #3327 from rolfbjarne/bug41745
[System*] Disable tests that require working networking stack on watchOS.
2016-07-26 13:30:51 +02:00
Ludovic Henry 2bd1dbd79b [threadpool-ms] Fix use-after-unloaded of domain
The following scenario might happen:
 - thread A: returns from tpdomain D1, then parks
 - thread B: returns from tpdomain D1, D1 is unloading so it's removed with `domain_remove`
 - thread A: unparks, calls `domain_get_next` with tpdomain D1
  - domain_get_next asserts as it can't find tpdomain D1 in the list of domains

To fix that, we simply set the previous_tpdomain to NULL when unparking.
2016-07-26 13:22:34 +02:00
Rolf Bjarne Kvinge 51de6e83eb [System*] Add category for tests that use API that require BSD sockets.
We don't have access to BSD sockets on watchOS, so that API
doesn't work.

With this category we'll be able to exclude these tests.
2016-07-26 13:20:51 +02:00
Alexander Köplinger c2151a9177 Merge pull request #3331 from lambdageek/dev/test-for-42625
[debugger-agent] Regression test for #42625
2016-07-26 10:56:27 +02:00
Alexander Köplinger 53c4a18a9f Merge pull request #3262 from lindenlab/add_continuations_test
Added Mono.Tasklets test
2016-07-26 10:49:19 +02:00
Alexander Kyte f9fe0e4a6e [runtime] Accomplish BITCODE build symbol sharing with only make (#3329) 2016-07-26 01:02:25 -04:00
Dolphin Hawkins 9ab4146a00 Added Mono.Tasklets test 2016-07-25 20:19:19 -07:00
Aleksey Kliger 083b5368f4 [debugger-agent] Regression test for #42625
Check that we can suspend I/O blocked threadpool workers in coop GC mode.
2016-07-25 19:01:00 -04:00
Alexander Köplinger 3bd3c27288 [ci] Don't cd in run-test-acceptance-tests.sh
The other scripts like TESTCMD rely on paths being based off of the repo root.
2016-07-26 00:44:18 +02:00
Alexander Köplinger 51fbf83f95 [ci] Fix typo in run-jenkins.sh 2016-07-25 23:45:19 +02:00
Vincent Povirk 1f9b59421b Remap the Compact Framework PublicKeyToken for assemblies it ships. 2016-07-25 16:17:50 -05:00
Alexander Kyte ae64b9c42c Merge pull request #3324 from alexanderkyte/threads_unhandled_exc
[runtime] Call unhandled exception handler explicitly to fix for bitcode
2016-07-25 16:32:29 -04:00
Alexander Köplinger 9fe0da70bb [acceptance-tests] Remove folders from Roslyn script that we now ship after 8f130a6e17 2016-07-25 22:31:05 +02:00
Alexander Köplinger 0e8eeec63b [ci] Move acceptance-tests script from Jenkins into the repo
Yay, less state on Jenkins!
2016-07-25 22:05:02 +02:00
Alexander Köplinger fcff8ec192 Bump Mono version to 4.7.0 2016-07-25 21:02:24 +02:00
Mark Probst c7ce43dd76 [sgen] Fix and simplify some debugging stuff. 2016-07-25 11:06:55 -07:00
Mark Probst 84810b29d3 [sgen] Document sgen-copy-object.h 2016-07-25 11:06:55 -07:00
Mark Probst 98ece1e8cf [sgen] Fix major collection time accounting.
This was from when we did a nursery collection as part of the
finishing collection pause.  Now that we don't do that anymore, we
underaccount major collection times.
2016-07-25 11:06:55 -07:00
Mark Probst 14bdaa017c [sgen] Only do fence when concurrent collection is running.
The store/store fence incurs quite a high cost, so we only want it to
run when absolutely necessary.  The most efficient way is to
separately compile nursery object operations for when the concurrent
collector is running, so there has to be no dynamic check.

In the future we might want to try batching updates of references to
moved objects so we have to do only one fence per batch.
2016-07-25 11:06:55 -07:00
Mark Probst adc5b2b575 [sgen] Missing store/store fence. 2016-07-25 11:06:55 -07:00
Mark Probst 77c8f52a77 [sgen] Fix whole heap check. 2016-07-25 11:06:55 -07:00
Mark Probst 72d6789396 [sgen] Make unnecessary stack check into assertion. 2016-07-25 11:06:55 -07:00
Mark Probst 39939b44b2 [sgen] Don't crash in binary protocol flush when forcing. 2016-07-25 11:06:55 -07:00
Mark Probst b82d861215 [sgen] Flush binary protocol buffers when missing remsets.
The missing remset check uses the binary protocol to log missing
remsets it found.  Debugging is easier if we don't have to manually
flush the binary protocol.
2016-07-25 11:06:55 -07:00
Mark Probst 2e7cd1c658 [sgen] Remove stupid typedef. 2016-07-25 11:06:55 -07:00
Mark Probst 3898293822 [sgen] Get rid of the global gray queue. 2016-07-25 11:06:55 -07:00
Mark Probst d6138d6bad [sgen] Pass GC thread gray queue into jobs. 2016-07-25 11:06:55 -07:00
Mark Probst 2971171458 [sgen] Don't expose the worker's gray queue. 2016-07-25 10:52:59 -07:00
Mark Probst cec4077b43 [sgen] Give remset consistency check a proper name, and do it more often. 2016-07-25 10:52:59 -07:00
Mark Probst eef3e9acc4 [sgen] Don't be too fussy about missing remsets to pinned objects.
If a thread is interrupted after a reference write but before the corresponding
write barrier, the remset will be missing, but the object will be pinned.
2016-07-25 10:52:59 -07:00
Alexander Kyte 5d299ed3ee [runtime] Call unhandled exception handler explicitly to fix for bitcode 2016-07-25 12:12:34 -04:00
Alexander Kyte ce8e905118 Merge pull request #3325 from alexanderkyte/fix_bitcode_mini
[mobile_static] Pass correct MONO_LLVMONLY for bitcode script
2016-07-25 12:02:07 -04:00
Alexander Köplinger 398320339c [bcl] Implement System.Text.Encoding.CodePages.CodepagesEncodingProvider in the facade 2016-07-25 14:30:47 +02:00
Alexander Köplinger 52cb65fec0 Fix Windows build broken in 2c061c1885 2016-07-25 12:32:13 +02:00
Zoltan Varga 2c061c1885 [runtime] Implement the GC domain finalization event using conditional variables instead of an io-layer event. (#3316) 2016-07-24 17:19:27 -04:00
Alexander Kyte f8688a302e [mobile_static] Pass correct MONO_LLVMONLY for bitcode 2016-07-24 02:46:23 -04:00
Zoltan Varga f5ba317644 [runtime] Abort instead of stopping background threads on shutdown. Hopefully fixes #41644. (#3323) 2016-07-22 18:25:59 -04:00
Martin Baulig 02b577b436 [System]: Fix SystemCertificateValidator.EvaluateSystem() on Android. Fixes #41290.
After the latest code changes, we may land here with `errors == SslPolicyErrors.None`,
so we need to make sure that we actually set it to `RemoteCertificateChainErrors` if
the system validator returns an error.

(cherry picked from commit b4304354b1)
2016-07-22 14:40:15 -04:00
Alexander Köplinger dc4aa9d35e Merge pull request #3318 from akoeplinger/cleaner-mini-nunit
[mini] Explicitly turn nunit output on or off based on variable
2016-07-22 14:20:45 +02:00
Alexander Köplinger f8b1e5c9cd Merge pull request #3319 from akoeplinger/fix-mono.csharp
[Mono.CSharp] Fix test .sources to include ASTVisitorTest.cs
2016-07-22 01:46:28 +02:00
João Matos 324c1d3d10 Merge pull request #3322 from grendello/offsets-tool-xa
Modify the offsets dumper to work with Xamarin.Android
2016-07-22 00:44:38 +01:00
Vlad Brezae 200f8b2227 [sgen] Fix build 2016-07-22 02:16:36 +03:00
Marek Habersack 2e5644386a Modify the offsets dumper to work with Xamarin.Android
This is a handful of quick and dirty changes to make the utility
work with Xamarin.Android which uses a different directory layout
than monodroid.
2016-07-22 00:35:17 +02:00
Rodrigo Kumpera 223c12a73c Merge pull request #3289 from BrzVlad/fix-critical-finalizer
[sgen] Fix critical/normal finalization order at domain unload
2016-07-21 15:35:06 -07:00
Rodrigo Kumpera 3fc81be928 Merge pull request #3321 from BrzVlad/fix-block-state-membar
[sgen] Add missing memory barrier
2016-07-21 15:34:41 -07:00
Rodrigo Kumpera 94f505825b Merge pull request #3290 from BrzVlad/fix-finalizer-tests
[tests] Fix finalizer tests
2016-07-21 15:32:18 -07:00
Alexander Köplinger cf24de837e [mini] Explicitly turn nunit output on or off based on variable
Alternative implementation to 8f092147bb.

In CI we explicitly pass EMIT_NUNIT=1 and check-seq-points to generate the nunit xml and run the tests,
locally those are omitted. This avoids needing to sniff for Jenkins/Wrench variables.

Same for a9eec21d62, but we already pass V=1 in Jenkins.
2016-07-22 00:20:14 +02:00
Vlad Brezae 1979f8b295 [sgen] Add missing memory barrier
When doing the first phase of sweeping we tag the block pointer within the block list with a CAS, after which we own the block and we are free to update the state and do sweep computations on the block. When we finish this phase we directly write the untagged block pointer back in the list, making the block available to inspect by other threads. We need a write barrier before writting the untagged pointer back because, when another thread might acquire the block, it might encounter an invalid block state.
2016-07-22 01:14:53 +03:00
Zoltan Varga a9eec21d62 [runtime] Decrease the verbosity of the runtime test runner when not running under CI. 2016-07-21 18:12:15 -04:00
Alexander Köplinger b973ccf824 [Mono.CSharp] Fix test .sources to include ASTVisitorTest.cs
I noticed this while looking at why Mono.CSharp is registered as "crashed" in the the new
fullaot PR job on Jenkins. It turns out all tests were excluded in mobile_static which means
no NUnit xml was produced and that is exactly what the script then interprets as a crash.

I saw that ASTVisitorTest.cs was not included in the net_4_x tests as well, likely inadvertently.
It got bitrotten over the years so I had to fix it up a bit, now it compiles/runs on mobile_static as well.
2016-07-21 23:22:03 +02:00
Zoltan Varga 8f092147bb [ji] Run the mini tests without the emitnunit.pl script when not running under CI. 2016-07-21 15:44:04 -04:00
Alexander Köplinger d8d1fe64c1 [versions.mk] Make path to SUBMODULES.json based on srcdir (#3314)
Since acceptance-tests/Makefile (and llvm/Makefile) include scripts/submodules/versions.mk which evals versions.py which looks
for a SUBMODULES.json file in the current working directory we got confusing error messages if the build directory is not the src dir:

```
Traceback (most recent call last):
  File "../../mono/scripts/submodules/versions.py", line 22, in <module>
    submodules = json.load(open(CONFIG_FILE))
IOError: [Errno 2] No such file or directory: 'SUBMODULES.json'
```

Instead we now pass the path to SUBMODULES.json as a variable to versions.py and set it based on $(top_srcdir) so it works
even for out-of-tree builds.
2016-07-21 13:49:26 -04:00
Alexander Kyte 635799108e [runtime] Make AOT'ed TestDriver.dll dependency for builds (#3303) 2016-07-21 13:49:15 -04:00
Rodrigo Kumpera c1a3562e2d [mini] Fail methods that try to throw scalars. Fix hard crash from #42417. (#3312) 2016-07-21 13:48:34 -04:00
Alexander Kyte 7d238ddd5e [mobile_static] Use clang++ for the linker (#3308)
In order for our exception handling to work on linux, we need the
unwind-dw2-fde-dip implementation in libgcc to work with our
.o file. This requires that `--eh-frame-hdr` be passed by the linker.

By using clang++ as the linker, we will get this and other flags
necessary for correct interop with c++ libraries.
2016-07-21 13:47:19 -04:00
Marcos Henrich 5391cbb42b Merge pull request #3305 from esdrubal/response_stream_close
[System] Fix RequestCanceled ex on ResponseStream.Close
2016-07-21 12:43:26 +01:00
Rodrigo Kumpera 321e47404f Merge pull request #3306 from kumpera/fix_wait
[wapi] Fix timed wait code to not overflow. Fixes #42688
2016-07-20 17:58:12 -07:00
Alexander Kyte 13d63a296f [runtime] Only add Mono.Dynamic.Interpreter to mobile_static (#3302) 2016-07-20 16:08:09 -04:00
Alexander Kyte 7021327848 Merge pull request #3307 from alexanderkyte/aot_path
[mobile_static] Fix temp path for mcs/class AOT
2016-07-20 15:18:38 -04:00
Alexander Kyte 0b77f98b5d [mobile_static] Fix temp path for mcs/class AOT 2016-07-20 15:16:59 -04:00
Rodrigo Kumpera e62c5b001d [wapi] Fix timed wait code to not overflow. Fixes #42688
Wait math must always subtract ticks and get deltas. That way we avoid overflows.
2016-07-20 10:42:40 -07:00
Marcos Henrich 558a3c0dc6 [System] Fix RequestCanceled ex on ResponseStream.Close
Fixes issues where ResponseStream.Close would throw an exception when
peer had already closed the connection and ResponseStream.Close would
still try to communicating to peer that it was closing.

The issue was brought to our attention by failures on:
  - MonoTests.System.Net.WebRequestTest.TestReceiveCancelation
  - MonoTests.System.Net.HttpWebRequestTest.TestLargeDataReading
2016-07-20 18:31:32 +01:00
Zoltan Varga 9e3f1f3002 [amd64] Rewrite the handler block trampoline to use normal calls instead of jumps so the functions called from the calls execute with an aligned stack. 2016-07-20 12:17:38 -04:00
Zoltan Varga 1f39769fb0 [tests] Disable some more tests in the mobile_static profile. 2016-07-20 12:15:28 -04:00
Zoltan Varga 43401ebfe2 [runtime] Add a missing mono_error_init () in a DISABLE_APPDOMAINS codepath. 2016-07-20 11:26:00 -04:00
Zoltan Varga 52599a3afd [amd64] Fix stack alignment in the handler block trampoline. 2016-07-20 08:00:11 -04:00
Vlad Brezae c89f64aada [tests] Remove double inclusion of source file 2016-07-20 12:16:01 +03:00
Vlad Brezae 220b5f56b8 [tests] Fix flakiness on some tests that assume object finalization
A common pattern that we use across the test suite is to create objects on a new thread, join the thread, collect then expect certain objects to be dead/finalized since we assumed that thread to be no longer a source of pinning. This is not always the case since, after joining, the thread might still be alive and running unmanaged code related to the thread shutdown, which can reuse the stack that previously contained the managed references.

The workaround is to still allocate objects far down the stack, even if we are on a separate thread.

At the moment the helper can be used in tests which run under the TestDriver (since it's included in TestDriver.dll) and can also be included as a helper source for test bcl classes that need it.
2016-07-20 12:15:59 +03:00
Rodrigo Kumpera f136599a68 Merge pull request #3304 from kumpera/unlimited-abort
Change suspend abort timeout to infinite and fix timeout env
2016-07-20 00:06:56 -07:00
Marek Safar fe03a3809e Revert "[Facades] Add System.Runtime.InteropServices.PInvoke"
This reverts commit 6d13f594fa.
2016-07-19 22:18:55 -07:00
Marek Safar 6d13f594fa [Facades] Add System.Runtime.InteropServices.PInvoke 2016-07-19 22:14:09 -07:00
Rodrigo Kumpera 2549481594 [mono-threads] Change suspend abort timeout to infinite and fix timeout env var parsing. 2016-07-19 18:06:53 -07:00
Rodrigo Kumpera a9a6209e24 [utils] Introduce MONO_INFINITE_WAIT instead of checking for -1 all over the place. 2016-07-19 18:05:37 -07:00
Alexander Köplinger 22dd441823 Merge pull request #3300 from esdrubal/mono-sym-fixes
[mono-symbolicate] Fixes symbolicate.expected
2016-07-20 03:03:13 +02:00
Zoltan Varga 9b2942a03e [tests] Disable tests which are expected to fail in the mobile_static profile. 2016-07-19 19:15:26 -04:00
Alexander Köplinger 3f870685e0 Revert "[test] Mono.Debugger.Soft test for async I/O tasks"
This reverts commit cf94a6fcd4.

It seems this causes something that prevents the chroot from unmounting in the Linux builds on Jenkins,
resulting in an endless "can't unmount" loop and stuck builds. Reverting to see if this fixes it.
2016-07-20 01:03:41 +02:00
Zoltan Varga f783acb4d0 [jit] Add full aot support for handler block trampolines on amd64. 2016-07-19 17:52:46 -04:00
Zoltan Varga 910ede5369 [jit] Avoid aborting if mono_ldtoken_checked () fails in one place. 2016-07-19 16:49:30 -04:00
Zoltan Varga cb8c0ce99d [aot] Fix full-aot support for delegate virtual invokes. 2016-07-19 16:44:26 -04:00
Vlad Brezae 629529ecea [sgen] Fix critical/normal finalization order at domain unload
For objects that die at the same time, normal finalizers should be run before critical finalizers. When we were unloading a domain we were running finalizers for all objects in that domain without checking whether the finalizer is critical or not. Now we enqueue the objects first in the finalization queues so we can run all the normal finalizers before the critical ones.
2016-07-19 23:37:13 +03:00
Zoltan Varga 9552af4b1b [runtime] Reset the thread_info TLS key if thread registration fails. 2016-07-19 14:11:30 -04:00
Alexander Kyte 9d8e60bd10 [runtime] Fix leak in generic sharing 2016-07-19 14:08:51 -04:00
Alexander Kyte 4c12908921 [sgen/mono] Don't leak stack info struct 2016-07-19 14:08:25 -04:00
Marcos Henrich 61085e29df [mono-symbolicate] Fixes symbolicate.expected
Make all file locations in symbolicate.expected relative to mono
repository base directory.
2016-07-19 18:04:34 +01:00
Aleksey Kliger (λgeek) 44d346f73a Merge pull request #3294 from lambdageek/dev/fix-42625
[threadpool-ms] Switch to GC Safe mode in event_wait backends
2016-07-19 12:42:42 -04:00
Marcos Henrich 89e9e78ee8 Merge pull request #3283 from esdrubal/mono-sym-docs
Update mono-symbolicate README and man
2016-07-19 14:47:33 +01:00
Marcos Henrich 6d9336ef00 Merge pull request #3293 from esdrubal/mono-sym-fixes
Mono sym fixes
2016-07-19 14:43:03 +01:00
Zoltan Varga 3a642d6d75 [tests] Make some tests work with full-aot. 2016-07-19 07:58:56 -04:00
Marcos Henrich 4dc450cd1f Updated mono-symbolicate man. 2016-07-19 10:51:39 +01:00
Marcos Henrich c65757680d Updated mono-symbolicate README
Updated mono-symbolicate usage.

Added practical example.

Renamed mono-symbolicate README to README.md
2016-07-19 10:51:38 +01:00
Marcos Henrich 0fe366f5fb [mono-symbolicate] Fixes Directory Exists/Delete race condition. 2016-07-19 10:40:31 +01:00
Marcos Henrich b03eea92a9 [mono-symbolicate] Add mscorlib stacktrace to tests
BCL symbols are now added to tests symbol directories.

We now test a stacktrace with stackframes on mscorlib.
2016-07-19 10:30:50 +01:00
Marcos Henrich f30cca3836 [mono-symbolicate] Fixed options/command logic.
Options are now parsed before comand store-symbols.
2016-07-19 10:30:42 +01:00
Johan Lorensson e1ebf4bd34 Merge pull request #3297 from lateralusX/jlorenss/win-x64-fix-pinvoke-failures
Fixing 4 failing pinvoke tests in runtime test suite on windows x64.
2016-07-19 10:26:06 +02:00
lateralusX b4971fd9e8 Fixing 4 failing pinvoke tests in runtime test suite on windows x64.
Fix for the following failing pinvoke tests in runtime tests suite on win x64:

* pinvoke11.exe
* winx64structs.exe
* pinvoke_ppcs.exe
* pinvoke_ppcc.exe
2016-07-19 02:40:33 +02:00
Aleksey Kliger cf94a6fcd4 [test] Mono.Debugger.Soft test for async I/O tasks 2016-07-18 20:22:15 -04:00
Alexander Kyte 03207c185f Merge pull request #3092 from alexanderkyte/mobile_static_fix_runtime_tests
[mobile_static] Get mono/tests running on mobile_static
2016-07-18 19:38:50 -04:00
Alexander Köplinger 81cff6f08d Merge pull request #3295 from mhutch/fix-pcl-build
[xbuild] Fix PCL build
2016-07-19 00:51:48 +02:00
Zoltan Varga c5d1c0bf1d [llvm] Add mono_llvm_set_call_notail () helper function, not yet used. 2016-07-18 18:41:24 -04:00
Zoltan Varga c430e4bf71 [llvm] Mark as the OBJC_METHOD_VAR_NAME/OBJC_SELECTOR_REFERENCES globals as used to prevent llvm from optimizing them away. 2016-07-18 18:41:24 -04:00
Zoltan Varga b5c8153740 [llvm] Disable tail calls when using llvm 3.9. 2016-07-18 18:41:24 -04:00
Alexander Köplinger 18de6419a1 Fix tarball package build broken by 8f130a6e17
- Microsoft.WebApplication.targets was inadvertently removed.
- The new Microsoft.NuGet.Build.Tasks assembly sources were not getting dist'ed. Adding to DIST_ONLY_SUBDIRS fixes this for now,
  though we can maybe add it to SUBDIRS instead (but neither me nor Marek know for what exactly that's used)
2016-07-18 22:53:44 +02:00
Mikayla Hutchinson d4166edc13 [xbuild] Fix %Identity issues
Identity metadata is the exact, unmodified ItemSpec.
2016-07-18 16:47:03 -04:00
Mikayla Hutchinson 9eb8076d98 [xbuild] Update PCL targets 2016-07-18 16:47:01 -04:00
Mikayla Hutchinson 58231fec64 [xbuild] Framework path should have trailing slash 2016-07-18 16:46:50 -04:00
Vlad Brezae af7debca7d Merge pull request #3280 from BrzVlad/fix-stw-stack-start
[sgen] Initialize stack_start to 0 when a thread is signaled for stw
2016-07-18 23:45:31 +03:00
Zoltan Varga b3d6023194 [llvm] Add a workaround for 3.9 based llvm versions using 'x15' as the location of the rgctx argument on arm64 even through it is reserved. 2016-07-18 16:13:17 -04:00
Zoltan Varga d08285b3d1 [jit] Save/restore cfg->ip during inlining, so instructions emitted after a failed inline have the correct il offset. 2016-07-18 16:13:17 -04:00
Alexander Kyte 1aa82aca7f Merge pull request #3132 from alexanderkyte/libmono_safe_undefined
[runtime] Make mini still build when -no-undefined given
2016-07-18 16:04:17 -04:00
Alexander Kyte 73d2def898 [runtime] Don't build mobile_static on default preset, don't know which configuration to use 2016-07-18 15:48:56 -04:00
Alexander Kyte 50dad86017 [runtime] Disable tests for AOT that require on unsupported runtime features 2016-07-18 15:03:48 -04:00
Alexander Kyte a8a85e231b [runtime] Hardcode preset feature disables 2016-07-18 15:03:47 -04:00
Alexander Kyte fb9a0777f2 [mobile_static] Move PLATFORM_AOT_SUFFIX into configure.ac 2016-07-18 15:03:47 -04:00
Alexander Kyte be12fd0bf5 [mobile_static] AOT libs not aoted by the test runner 2016-07-18 15:03:47 -04:00
Alexander Kyte 1b4e23b3a4 [mobile_static] Skip all appdomain-related tests 2016-07-18 15:03:46 -04:00
Alexander Kyte 42f54aac93 [mobile_static] AOT assemblyresolve for tests 2016-07-18 15:03:46 -04:00
Alexander Kyte 2bffc4a424 [mobile_static] Build mono/tests bitcode files in subdirectories to make threadsafe 2016-07-18 15:03:45 -04:00
Alexander Kyte 9360b991d7 [mobile_static] Skip appdomain tests on mobile_static 2016-07-18 15:03:45 -04:00
Alexander Kyte 09e89205e5 [mobile_static] Make test runner aot each assembly individually 2016-07-18 15:03:44 -04:00
Alexander Kyte eca9a375e3 [mobile_static] Skip mcs compiler tests for mobile_static 2016-07-18 15:03:44 -04:00
Alexander Kyte 695e8f53ae [mobile_static] Skip verifying ilasm.exe on mobile_static
ILASM.exe has features which a mobile_static runtime will not support.
It is invoked with an external mono when used in the runtime.
We skip it here because otherwise it will fail to verify.
2016-07-18 15:03:43 -04:00
Alexander Kyte c4465679d9 [mobile_static] Configure mini fullaot tests to work with mobile_static 2016-07-18 15:03:43 -04:00
Alexander Kyte 5222073ae4 [mobile_static] Enable Mono.Simd namespace to fix mini tests 2016-07-18 15:03:42 -04:00
Alexander Kyte e8029e1474 [mobile_static] Use mobile_static paths in mono/mini tests when necessary 2016-07-18 15:03:42 -04:00
Alexander Kyte 83871537b9 [mobile_static] Blacklist mono/tests sgen tests for mobile_static 2016-07-18 15:03:41 -04:00
Alexander Kyte 997ef7a007 [mobile_static] Pass aot options to mono/tests test runner if applicable 2016-07-18 15:03:41 -04:00
Alexander Kyte 955ddd33ac [mobile_static] AOT the mono/tests test runner when AOTing tests 2016-07-18 15:03:40 -04:00
Alexander Kyte 8e06b430a1 [mobile_static] Make mono/tests runner handle steps necessary for mobile_static 2016-07-18 15:03:40 -04:00
Alexander Kyte f7cccf2c52 [mobile_static] Move AOT build / run flags to make accessible in /mono 2016-07-18 15:03:39 -04:00
Alexander Kyte b1d611fa86 [mobile_static] Don't include Mono.Posix dependency to test driver 2016-07-18 15:03:39 -04:00
Alexander Kyte 78d1c677d7 [mobile_static] Don't try to use SIGKILL to get test stacktrace if Mono.Posix not available 2016-07-18 15:03:39 -04:00
Alexander Kyte d7582973dc [mobile_static] Blacklist runtime tests for mobile_static profile 2016-07-18 15:03:38 -04:00
Alexander Kyte 32a599ea28 [mobile_static] Make preset AOT_RUN_FLAGS and AOT_BUILD_FLAGS available to /mono 2016-07-18 15:03:38 -04:00
Alexander Kyte a88eb4f43c [mobile_static] Set MCS build options for mobile_static to feature gate runner 2016-07-18 15:03:37 -04:00
Alexander Kyte a06eeefb6e [mobile_static] Ensure the mobile_static profile builds ilasm 2016-07-18 15:03:37 -04:00
Alexander Kyte 26b2798a2d [runtime] Get ilasm.exe compiling with mobile_static 2016-07-18 15:03:36 -04:00
Aleksey Kliger 853500ac4c [threadpool-ms] Switch to GC Safe mode in event_wait backends
Fixes [Bugzilla #42625](https://bugzilla.xamarin.com/show_bug.cgi?id=42625)
2016-07-18 14:52:30 -04:00
Zoltan Varga 5648faa97d [llvm] Fix the DISABLE_JIT build. 2016-07-18 14:06:39 -04:00
Zoltan Varga 8161e9e3b0 [aot] Add a gen-seq-points-file deprecated option. 2016-07-18 14:05:39 -04:00
Marcos Henrich 876a906e42 [mono-symbolicate] Handle wrapper stackframes 2016-07-18 17:04:19 +01:00
Marcos Henrich 574e1a6e9b [mono-symbolicate] Fixes type with namespace not found 2016-07-18 17:04:19 +01:00
Marcos Henrich 203bd56b70 [mono-symbolicate] Adds log messages.
Added logger to mono-symbolicate, so we can add debug, warning and error
log messages.
2016-07-18 17:03:58 +01:00
Zoltan Varga 722afbd65f [runtime] Fix small issues from https://github.com/mono/mono/pull/3278. 2016-07-18 12:03:13 -04:00
Zoltan Varga 0e97e079fa [tests] Reduce a test iteration in process-leak.exe so it doesn't take minutes to run. 2016-07-18 11:44:45 -04:00
Mark Probst a82c1ae261 [runtime] A bunch of small fixes. 2016-07-18 11:36:25 -04:00
Marcos Henrich d817c0a129 Merge pull request #3264 from esdrubal/tzi_dst
[corlib] Implements TZI.IsDST(DateTimeOffset)
2016-07-18 16:01:54 +01:00
Marcos Henrich 6ec2a9cacb [mono-symbolicate] Fix crash while overwriting symbols 2016-07-18 13:55:29 +01:00
Marcos Henrich 7dbc89bf8f [mono-symbolicate] Fixes crash on stackframes w/o MVID
Wrapper stack frames don't have MVID or IL associated.
ex: (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
2016-07-18 13:55:29 +01:00
Marcos Henrich 5c4313d3dc [mono-symbolicate] Display error when MVID folder not found
Display error instead of crashing with exception.
2016-07-18 13:55:29 +01:00
Marek Safar 7b903d2758 [Facades] Remove dulicate subdirs include 2016-07-15 21:15:27 +02:00
Mikayla Hutchinson 8f130a6e17 Merge pull request #3282 from mhutch/netstandard-build
PCL5/netstandard MSBuild support
2016-07-15 15:11:49 -04:00
Mikayla Hutchinson 7ff0d66da4 [build] Fix resgen in child profiles 2016-07-15 13:07:27 -04:00
Mikayla Hutchinson cf5cf7cb3c [xbuild] Clearer distinction between versioned and unversioned files 2016-07-15 13:07:26 -04:00
Mikayla Hutchinson 4a6176c71e [xbuild] Use RESOURCE_DEFS to compile resx 2016-07-15 13:07:25 -04:00
Mikayla Hutchinson 3e74952787 [xbuild] Rename internal target to match MSBuild
The PCL targets depend on its name.
2016-07-15 13:07:24 -04:00
Mikayla Hutchinson 46e4193511 [xbuild] Fix warning with netstandard projects
This fixes an inconsistency where xbuild would add System.Core
references to all builds, and MSBuild would only add them for
.NETFramework.

This change could break user XA/XI/XM projects on Mac if the user has
manually removed the explicit System.Core reference from the project,
however such projects would already be broken on Windows.
2016-07-15 13:07:22 -04:00
Mikayla Hutchinson e48600af1d [xbuild] Fix NuGet tasks build 2016-07-15 13:07:16 -04:00
Mikayla Hutchinson 4c1bd63c73 [xbuild] Install PCL5 framework 2016-07-15 13:07:09 -04:00
Mikayla Hutchinson 64013e21a1 [xbuild] Install PCL targets from buildtools 2016-07-15 13:07:00 -04:00
Mikayla Hutchinson 152343d063 [xbuild] Update NuGet tasks to VS2015 Update 3 2016-07-15 13:06:45 -04:00
Mikayla Hutchinson 91fc604c58 Add dotnet/buildtools submodule
Using the openportabletargets branch in order to get
https://github.com/dotnet/buildtools/pull/643
2016-07-15 13:04:48 -04:00
Alexander Köplinger ae5611d4ff [xbuild] Add Microsoft.NuGet.Build.Tasks.dll MSBuild task
This is required for interoperating with project.json-based NuGet package configuration files
(not to be confused with DNX or AspNet Core which use it as a project file too) from MSBuild/xbuild.

The task hooks into the build process, resolves assembly references from the nuget package cache
and injects them into the compilation project so the csproj doesn't need to be modified when
adding new references/packages.

It is the first step on our road to PCL5/NuGet3.
2016-07-15 13:04:48 -04:00
Aleksey Kliger (λgeek) f3c5893d99 Merge pull request #3286 from lambdageek/dev/refl-to-managed
[reflection] RuntimeType  Event and Property search partly in managed
2016-07-15 12:58:12 -04:00
Zoltan Varga 1ad5c0a021 [jit] Fix some alignment issues in mono_unwind_ops_encode_full (). 2016-07-15 12:43:28 -04:00
Marek Safar 0f51a82c63 [Facades] Build System.Drawing.Primitives only on profiles with no external dependencies inside bcl 2016-07-15 18:26:05 +02:00
Johan Lorensson 3125d1bdc7 Merge pull request #3285 from lateralusX/jlorenss/win-x64-native-valuetype-abi
Rewrite of Windows x64 value type ABI to support DirectX wrapper libraries on JIT and full AOT.
2016-07-15 17:13:28 +02:00
Marek Safar 84acce6fca [Facades] System.Drawing.Primitives use type fowarders in monotouch profile when available 2016-07-15 16:37:28 +02:00
Alexander Köplinger d95e84201f [bcl] Don't build System.Net.Http.WebRequest.dll on mobile
It's not shipped in Xamarin.iOS and Xamarin.Android, so we shouldn't build it for these profiles.
2016-07-15 14:06:23 +02:00
Marek Safar 5aaaf9295b Revert "[Facades] Exclude System.Drawing.Primitives from watch profile"
This reverts commit 6db2cae90c.
2016-07-15 12:27:05 +02:00
Marek Safar 6db2cae90c [Facades] Exclude System.Drawing.Primitives from watch profile 2016-07-15 12:09:03 +02:00
Zoltan Varga 198bf460a6 [llvm] Add generic IR implementations of some SIMD opcodes, not used yet. 2016-07-15 05:21:07 -04:00
Marek Safar 64b7e70f0d Merge pull request #3274 from Unity-Technologies/fix-path-getfullpath-windows
Fix Path.GetFullPath for roots on Windows
2016-07-15 10:31:33 +02:00
lateralusX 5ae220a3b2 Smaller formatting adjustments based on feedback. 2016-07-15 10:19:37 +02:00
Zoltan Varga c20575195b Merge pull request #3287 from JustArchi/patch-1
Fix compilation of AOT-less Mono
2016-07-15 01:54:08 -04:00
Łukasz Domeradzki 1731145974 Fix compilation of AOT-less Mono
```
aot-runtime.c:5838:1: error: expected identifier or ‘(’ before ‘{’ token
 {
 ^
```
2016-07-15 05:23:53 +02:00
Aleksey Kliger 04c4e9a918 [reflection] Move System.RuntimeType.GetPropertiesByName to managed 2016-07-14 19:15:35 -04:00
Aleksey Kliger abb3af7f52 [reflection] Add System.Reflection.PropertyInfo.GetPropertyFromHandle method
Also add Mono.RuntimePropertyHandle struct representing a native MonoProperty pointer.

Also add ves_icall_System_Reflection_PropertyInfo_internal_from_handle_type icall
that wraps mono_property_get_object_checked.
2016-07-14 19:13:52 -04:00
Aleksey Kliger 83dd71ae23 [runtime] Add finalizer to SafeGPtrArrayHandle 2016-07-14 17:58:47 -04:00
Zoltan Varga 3776f68d0f [llvm] Fix an enable debug info generation for llvm master. 2016-07-14 16:49:28 -04:00
Aleksey Kliger 4fba2695b5 [reflection] mono_error_init
avoid a crash when there's a cache hit
2016-07-14 15:47:07 -04:00
Aleksey Kliger 70c2a93a48 [reflection] Move RuntimeType.GetEvents_internal to managed code 2016-07-14 15:19:57 -04:00
Aleksey Kliger fcb6f81336 [reflection] Add System.Reflection.EventInfo.GetEventFromHandle methods
Add new Mono.RuntimeEventHandle struct wrapping a pointer to a native MonoEvent

Add new icall
ves_icall_System_Reflection_EventInfo_internal_from_handle_type that's
mostly a wrapper around mono_event_get_object_checked.
2016-07-14 15:19:57 -04:00
Aleksey Kliger 932076d2f1 [runtime] Faster parent check in ves_icall_System_Reflection_FieldInfo_internal_from_handle_type
Use mono_class_has_parent for a faster supertypes check instead of
following the parent pointers.
2016-07-14 15:19:57 -04:00
lateralusX e53f07efa2 PInvoke methods using SetLastError get dropped on Windows x64 full AOT.
This happens because current implementation is doing a direct call to Win32
GetLastError in order to get the value before it get clobbered by the icall
setting the last error value in mono. When running AOT all constructs that tries
to call a method using a direct address will be dropped since that will not work
in full AOT. This results in incomplete compiled libraries causing runtime exceptions
in full AOT.

The fix on Windows x64 is to introduce a new OP code, GET_LAST_ERROR that will
retrieve the last error without clobbering it in the process. This is done by
emitting code reading the value directly from the TEB (thread environment block)
and will be lowered to just a move from the segment register holding the TEB data
structure on Windows x64. This is how GetLastError is doing this as well, but since
we won’t be able to call the method in a “safe” way in full AOT, using the segment
register directly will solve the issue. We use the segment register for accessing TLS,
so we already relying on the TEB structure.

NOTE, this will only be applied to Windows x64, full AOT for now.
2016-07-14 20:40:58 +02:00
Zoltan Varga 5ff5b9339f [llvm] Delete some dead code. 2016-07-14 14:31:20 -04:00
Zoltan Varga 3407b733f9 [llvm] Delete unused intrinsics. 2016-07-14 14:15:04 -04:00
Zoltan Varga 4a00eb9552 [sdb] Pass a MonoError* to mono_class_get_methods_by_name () instead of a MonoException*. 2016-07-14 13:49:02 -04:00
Zoltan Varga f052972681 Fix a warning. 2016-07-14 13:46:21 -04:00
lateralusX 06c0592f9d Fix a GC crash happening in full AOT compiled code where a delegate method can't
be detected at runtime. Since the process crash, lot of valuable information was never
written out to the console (like the managed stack trace) needed to effectively resolve
the issue.
2016-07-14 19:34:52 +02:00
lateralusX bd83be49c3 Add gsharedvt support for changed Windows x64 value type ABI. 2016-07-14 19:34:52 +02:00
lateralusX a4eeef2f2f Rewrite of Windows x64 value type ABI to support DirectX wrapper libraries.
Current implementation used different value type ABI’s depending on if call
was a managed->native, native->managed or managed->managed call. The implementation
was also overcomplicated since it was a tweaked copy from System V x64 value type
ABI with scenarios and conditions that wouldn’t apply to the Windows x64 value
type ABI. Having a uniform value type ABI when possible regardless of managed->native,
native->managed or managed->managed calls simplifies scenarios and reduce complexity.

While all the above are legitimate reasons the primary driving factor behind
the rewrite was a different issue. There are .NET wrapper libraries around DirectX API
used by game engines and other libraries that uses a pattern using a call into a stub
managed method that gets patched directly in the MSIL to a calli that will end up in a
native DirectX vtable method. In current ABI we can’t detect scenario like this, so arguments
are passed as if the call was a managed->managed call causing issues for value types. Since DirectX
uses value types a lot (vectors, matrixes etc.), this was a blocker getting these technologies
running on Windows using DirectX at all. Another approach could be to change the behavior of the
library, but this would require a major redesign of the library and since several of these libraries
are mature, that wasn’t a realistic option, especially since MS .NET runtime handles the libraries as is
without modifications.

The rewrite makes sure Windows x64 value type ABI follow the platform value type ABI in all scenarios.
2016-07-14 19:34:52 +02:00
Andi McClure 41b65b08a5 Merge pull request #3279 from xmcclure/tarjan-crash-2
Re-allow bridge callbacks to be set after GC init
2016-07-14 12:28:03 -04:00
Zoltan Varga 21b68dda9c [llvm] Implement some SIMD opcodes using LLVM IR instead of calling an llvm intrinsics. 2016-07-14 12:24:27 -04:00
Aleksey Kliger (λgeek) 26c3cfa0c5 Merge pull request #3281 from lambdageek/dev/g-ptr-array
[reflection] RuntimeType Field and Method search partly in managed
2016-07-14 11:32:58 -04:00
Marcos Henrich a4052f5f2b [corlib] Implements TZI.IsDST(DateTimeOffset)
Fixes #41349
2016-07-14 16:25:57 +01:00
Jonathan Chambers a034a2b627 Move check for slash inside of existing short path check and do a char comparison rather than a string comparison 2016-07-14 09:47:42 -04:00
Marcos Henrich 7efba04b66 [corlib] Test TZI.IsDST with DateTimeOffset.
Covers #41349
2016-07-14 13:26:21 +01:00
Marek Safar c75dcf579f [Facades] Remove wrong private facade 2016-07-14 14:23:46 +02:00
Marcos Henrich 9ddba8c671 Merge pull request #3276 from esdrubal/access_token_move
[corlib] Replaced SafeAccessTokenHandle.cs with ref source.
2016-07-14 10:27:19 +01:00
Marek Safar c1461e8453 [mcs] Add missing error message argument 2016-07-14 08:38:36 +02:00
Alexander Köplinger da04e24602 [bcl] Include all facade directories in the tarball
net_4_x_PARALLEL_SUBDIRS doesn't implicitly include all facades anymore after 10c5e72512.
2016-07-14 01:50:54 +02:00
Aleksey Kliger a586925967 [reflection] Managed RuntimeType.GetConstructors_internal 2016-07-13 18:22:40 -04:00
Marek Safar 1a1e1939c0 [Facades] Update list of full assemblies 2016-07-14 00:13:22 +02:00
Aleksey Kliger 1f09c7abaa [reflection] RuntimeType.GetMethodsByName in managed
Also:
  1. MethodBase.GetMethodFromHandleInternalType_native icall
  2. reimplemented the other MethodBase GetMethodFromHandleXXX methods
  in terms of this new icall.
  3. MonoError-ize mono_class_get_methods_by_name
2016-07-13 16:00:43 -04:00
Aleksey Kliger e46704ce90 [reflection] Managed version of RuntimeType.GetFields_internal 2016-07-13 16:00:41 -04:00
Andi McClure da895ba61a Back out pending_bridge_callbacks_mutex in previous commit
The mutex on pending_bridge_callbacks was overkill because the init
model for the mono runtime already enforces the callbacks being set on
the init thread. Added a couple comments to formalize this.
2016-07-13 15:49:04 -04:00
Zoltan Varga 64c6938512 Merge pull request #3240 from alexanderkyte/aot_compiler_leaks
[runtime] Fix aot compiler leaks
2016-07-13 15:03:14 -04:00
Vlad Brezae ab46df8888 [sgen] Initialize stack_start to 0 when a thread is signaled for stw
If we have an invalid SP in the suspended thread, we don't set stack_start in the thread info, expecting it to be 0 in order to signal a resume and suspend retry to the suspender thread. If the thread was already restarted before (from a different reason like IP in critical section), it would have a nonzero stack_start from the previous suspend, leading to an assertion in the previously described case.

This is also what we do on mach.
2016-07-13 20:04:51 +03:00
Marcos Henrich 725892b35c Merge pull request #3248 from esdrubal/web_request_abort
[System] EndRead now throws WebException on abort.
2016-07-13 17:41:22 +01:00
Marcos Henrich 1172aac102 Merge pull request #3268 from esdrubal/mono-sym-enable
[runtime] Enable compact seq point by default
2016-07-13 17:27:02 +01:00
Marcos Henrich 76a11d5b2d [corlib] Replaced SafeAccessTokenHandle.cs with ref source. 2016-07-13 17:24:37 +01:00
Aleksey Kliger dca84a114d [corlib] Add Mono.SafeGPtrArrayHandle
Wrap a GPtrArrayHandle struct in a safe handle that will free the
native resource after we're done.
2016-07-13 12:03:02 -04:00
Aleksey Kliger 121ed7c854 [corlib] Mono.RuntimeStructs.GPtrArray
and corresponding Mono.RuntimeGPtrArrayHandle
reflecting native GPtrArray struct in managed code.
2016-07-13 12:03:00 -04:00
Aleksey Kliger 6d79bc40a2 [reflection] Switch ves_icall_RuntimeType_GetFields_internal to GPtrArray
instead of MonoPtrArray.  Next step is to return the GPtrArray to
managed code, so using a stack allocated array won't work anymore.
2016-07-13 12:02:59 -04:00
Aleksey Kliger (λgeek) 71c524b8ba [logging] Default to stdout if MONO_LOG_DEST is unset (#3272)
Follow up to e70a8aca1c, do what the man
page says and default to stdout if MONO_LOG_DEST isn't specified.
2016-07-13 11:21:01 -04:00
Josh Peterson c005ca7358 Fix Path.GetFullPath for roots on Windows
On Windows, xbuild can fail with the somewhat obscure error message: "error : Error building target GetReferenceAssemblyPaths: UNC paths should be of the form \\server\share." This occurs because a call to Path.GetFullPath(@"\") returns the string "\" on Windows, when it should return a root path that includes the drive letter, like "C:\".

The code in xbuild tries to scan directories for files. Specifically, it looks for "\.*dll". If any .dll files exist in the root directory, each will be returned with the path "/\foo.dll". This path is used to create a FileInfo, and the exception about a UNC path occurs.

So if the path is "\" or "/" Path.GetFullPath should return the correct root path, including the drive letter, on Windows.

Here is the full call stack from xbuild:

Error building target GetReferenceAssemblyPaths: System.ArgumentException: UNC paths should be of the form \\server\share.
at System.IO.Path.InsecureGetFullPath (System.String path) <0x25343f0 + 0x003fb> in <filename unknown>:0
at System.IO.Path.GetFullPath (System.String path) <0x2534378 + 0x00013> in <filename unknown>:0
at System.IO.FileInfo..ctor (System.String fileName) <0x25fae20 + 0x00033> in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.FileInfo:.ctor (string)
at System.IO.DirectoryInfo.GetFiles (System.String searchPattern) <0x25fa7c0 + 0x00087> in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:GetFiles (string)
input, Int32 ptr, System.IO.DirectoryInfo directory, Boolean recursive) <0x25fa2b0 + 0x0016b> in <filename unknown>:0
input, Int32 ptr, System.IO.DirectoryInfo directory) <0x25fa270 + 0x0002f> in <filename unknown>:0
at Microsoft.Build.BuildEngine.DirectoryScanner.ProcessInclude (ITaskItem include_item, System.Collections.Generic.Dictionary`2 excludedItems, System.Collections.Generic.List`1 includedItems) <0x25d72d0 + 0x002ab> in <filename unknown>:0
at Microsoft.Build.BuildEngine.DirectoryScanner.Scan () <0x25d70e0 + 0x000ff> in <filename unknown>:0
at Microsoft.Build.BuildEngine.BuildItem.Evaluate (Microsoft.Build.BuildEngine.Project project, Boolean evaluatedTo) <0x25d5a50 + 0x005d3> in <filename unknown>:0
at Microsoft.Build.BuildEngine.BuildTaskItem.Execute () <0x25e5ad8 + 0x0002b> in <filename unknown>:0
at Microsoft.Build.BuildEngine.TaskBatchingImpl.Execute (IBuildTask buildTask, TaskExecutionMode taskExecutionMode) <0x25e3698 + 0x0004a> in <filename unknown>:0
at Microsoft.Build. BuildEngine.TaskBatchingImpl.Run (IBuildTask buildTask, TaskExecutionMode taskExecutionMode, System.Boolean& executeOnErrors) <0x25e50e0 + 0x0004f> in <filename unknown>:0
at Microsoft.Build.BuildEngine.TaskBatchingImpl.Build (IBuildTask buildTask, TaskExecutionMode taskExecutionMode, System.Boolean& executeOnErrors) <0x25e21b0 + 0x00097> in <filename unknown>:0
at Microsoft.Build.BuildEngine.TargetBatchingImpl.RunTargetWithBucket (System.Collections.Generic.Dictionary`2 bucket, Microsoft.Build.BuildEngine.Target target, System.Boolean& executeOnErrors) <0x25e14b8 + 0x00213> in <filename unknown>:0
at Microsoft.Build.BuildEngine.TargetBatchingImpl.Run (Microsoft.Build.BuildEngine.Target target, System.Boolean& executeOnErrors) <0x25e1360 + 0x000f7> in <filename unknown>:0
at Microsoft.Build.BuildEngine.TargetBatchingImpl.Build (Microsoft.Build.BuildEngine.Target target, System.Boolean& executeOnErrors) <0x25dfee0 + 0x00053> in <filename unknown>:0
at Microsoft.Build.BuildEngine.Target.DoBuild (System.Boolean& executeOnErrors) <0x25dfcf0 + 0x0004f> in <filename unknown>:0
2016-07-13 09:54:11 -04:00
Marek Safar 9a60311261 Merge pull request #3254 from mono/netstandard
[bcl] netstandard 1.6 support
2016-07-13 13:30:34 +02:00
Marcos Henrich 01600bef50 [runtime] Added gen-seq-points-file= deprecated option
Added gen-seq-points-file= back with deprecated message to avoid crashes
in application still using it.
2016-07-13 11:17:36 +01:00
Marcos Henrich 209c4246ad [runtime] Enable compact seq point by default
Enable compact seq points by default so that the stack trace have IL
offsets instead os native ones.

This changes will allow any stacktrace generated from now on to be
symbolicated using mono-symbolicate.

Deprecates options gen-compact-seq-points.
2016-07-13 10:52:27 +01:00
Marek Safar 10c5e72512 [bcl] netstandart 1.6 support 2016-07-13 11:02:10 +02:00
Mikayla Hutchinson e6334f9268 [mono-api-html] Add option to ignore breaking changes 2016-07-13 10:55:46 +02:00
Andi McClure 7114fd4236 Allow bridge callbacks to be set after GC init
This is cleanup to the previous emergency fix for bug 42469. The goal of that fix was to defer bridge processor initialization until after sgen init, but it introduced a requirement mono_gc_register_bridge_callback be called before sgen init. This breaks Xamarin Designer, which sets up callbacks late.

This patch introduces an sgen_init_bridge () which is called both at startup and after callbacks are set, and performs the initialization once all pieces are in place. Additional concurrency and style issues are also addressed.
2016-07-12 18:31:58 -04:00
Ludovic Henry ac19455304 Merge pull request #3224 from ludovic-henry/iolayer-extract-wait-handle
[io-layer] Extract handle lifetime + waiting + signalling to utils
2016-07-12 23:00:28 +02:00
Alexander Kyte ea6525cda8 [runtime] Disable noisy warning 2016-07-12 13:22:22 -04:00
João Matos 38ffd8781f [aot] Fixes strip tool invocation in to wrap paths in AOT compilation.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=34498.
2016-07-12 17:15:17 +01:00
Aleksey Kliger 4e6d44a447 Fix windows build after 162f843968 2016-07-12 12:10:07 -04:00
Aleksey Kliger (λgeek) f9851a7935 [corlib] Rewrite RuntimeType.GetGenericParameterConstraints (#3260)
* [corlib] Rewrite RuntimeType.GetGenericParameterConstraints

using managed code for managed object manipulation by surfacing the
native MonoGenericParamInfo struct to managed code as Mono.RuntimeStructs.GenericParamInfo

* [corlib] RuntimeType::GetGenericParameterAttributes can be managed code now.

* [corlib] Fix x86 breakage

RuntimeTypeHandle.GetGenericParameterInfo returns a pointer
Not a struct that's the same size as a pointer.  On the x86 Linux
calling convention they behave differently.
2016-07-12 11:16:59 -04:00
Andi McClure 9d91232d02 Merge pull request #3265 from xmcclure/tarjan-crash
Defer bridge processor init until after sgen init, fixing crash (bug 42469)
2016-07-12 11:11:46 -04:00
Zoltan Varga 162f843968 [amd64] Reorganize add_valuetype () to make it easier to use the platform calling convention for managed code as well. Implement dyncall support for passing/returning vtypes in registers. 2016-07-12 09:34:41 -04:00
Ludovic Henry 58ece251d7 [io-layer] Move handles out of the io-layer to utils/w32handle 2016-07-12 14:53:23 +02:00
Ludovic Henry ecd64d830a [io-layer] Inline init_handles_slot 2016-07-12 14:53:23 +02:00
Ludovic Henry e576b7dbfe [io-layer] Replace _WAPI_PRIVATE_HANDLES and _WAPI_PRIVATE_HAVE_SLOT by _wapi_handle_lookup_data 2016-07-12 14:53:23 +02:00
Ludovic Henry 11700bd8d0 [io-layer] Remove any remaining dependency of handles.c on other parts of the io-layer 2016-07-12 14:53:23 +02:00
Ludovic Henry c4e7dfb5ef [io-layer] Replace _WAPI_HANDLE_INVALID by INVALID_HANDLE_VALUE 2016-07-12 14:53:23 +02:00
Ludovic Henry f6aaaa11c5 [io-layer] Remove wapi_getdtablesize 2016-07-12 14:53:23 +02:00
Ludovic Henry dc49c2f3ed [io-layer] Move DuplicateHandle and CloseHandle to wapi.c 2016-07-12 14:53:23 +02:00
Ludovic Henry 1d5c330a78 [io-layer] Remove use of _wapi_has_shut_down 2016-07-12 14:53:23 +02:00
Ludovic Henry ab7d1a2e9f [io-layer] Remove unnecessary locking of _WAPI_SHARED_SEM_FILESHARE 2016-07-12 14:53:23 +02:00
Ludovic Henry 794ef7b32b [io-layer] Move _wapi_handle_spin to handles.c 2016-07-12 14:53:23 +02:00
Ludovic Henry db7cf6a3fa [io-layer] Move _WAPI_FD_HANDLE, _WAPI_SHARED_NAMESPACE and _WAPI_HANDLE_INVALID to handles-private.h 2016-07-12 14:53:23 +02:00
Ludovic Henry 931cbe5653 [io-layer] Remove pseudo global handle 2016-07-12 14:53:23 +02:00
Ludovic Henry 1916e35358 [io-layer] Allocate WapiHandle specific data on the heap 2016-07-12 14:53:23 +02:00
Ludovic Henry 986ddaea8e [io-layer] Register WapiHandleOps dynamically 2016-07-12 14:53:23 +02:00
Ludovic Henry 28d3395e3e [io-layer] Move WapiHandleType and WapiHandleOps to handles-private.h 2016-07-12 14:53:23 +02:00
Ludovic Henry 6c550a796b [io-layer] Extract _wapi_search_handle_namespace from handles.c 2016-07-12 14:53:23 +02:00
Ludovic Henry d3dc6dab7f [io-layer] Add typename and typesize handle operations 2016-07-12 14:53:23 +02:00
Ludovic Henry 8412c63395 [io-layer] Move _wapi_getpid out of handles.c 2016-07-12 14:53:23 +02:00
Ludovic Henry e088056d80 [io-layer] Add details operation on handle 2016-07-12 14:53:23 +02:00
Ludovic Henry 2a57a281ce [io-layer] Move io-layer initialization out of handles.c 2016-07-12 14:53:23 +02:00
Ludovic Henry fbc49edb16 [io-layer] Move file_share_hash to io.c 2016-07-12 14:53:23 +02:00
Ludovic Henry 92e0731741 [io-layer] Remove empty function _wapi_shm_semaphores_remove 2016-07-12 14:53:23 +02:00
Ludovic Henry b51db7c8b9 [io-layer] Remove unused _wapi_sem_id 2016-07-12 14:53:23 +02:00
Ludovic Henry adb587c1e9 [io-layer] Extract WapiHandleBase from _WapiHandleUnshared 2016-07-12 14:53:23 +02:00
Ludovic Henry 4b857e0841 [io-layer] Make _WAPI_PRIVATE_MAX_SLOTS and _WAPI_HANDLE_INITIAL_COUNT definition private 2016-07-12 14:53:23 +02:00
Ludovic Henry d244edc689 [io-layer] Make _wapi_global_signal_handle definition private 2016-07-12 14:53:23 +02:00
Ludovic Henry 3198424e93 [io-layer] Make _WapiHandleUnshared definition private 2016-07-12 14:53:23 +02:00
Ludovic Henry dd9eb54bb0 [io-layer] Factor Mutex and NamedMutex code 2016-07-12 14:53:23 +02:00
Ludovic Henry 2a234ddf58 [io-layer] Factor Semaphore and NamedSemaphore code 2016-07-12 14:53:23 +02:00
Ludovic Henry 677337daa8 [io-layer] Factor Event and NamedEvent code 2016-07-12 14:53:23 +02:00
Ludovic Henry 2214fd492b [io-layer] Make named handle use their equivalent non-named handle 2016-07-12 14:53:23 +02:00
Alexander Köplinger ec6fca56f3 Merge pull request #3267 from lateralusX/jlorenss/fix-win-build-missing-exports
Fix windows build issue due to missing export in def files.
2016-07-12 10:48:23 +02:00
lateralusX 5e296bd161 Fix windows build issue due to missing export in def files. 2016-07-12 09:24:38 +02:00
Zoltan Varga 265b8077b0 [runtime] Make mono_thread_resume_interruption () work during shutdown as well by checking for ThreadState_StopRequested as well. Hopefully fixes #41644. 2016-07-11 23:46:01 -04:00
Andi McClure a11bcf50f9 Defer bridge processor init until after sgen init (bug 42469)
mono_gc_register_bridge_callbacks is a function which the android implementation calls before initializing the runtime. One of the things this function previously did was initialize the default bridge processor if none has been initialized yet. However, because the function gets called before initializing the runtime, a bridge processor was never initialized. This lead to two bad effects:

- If a bridge processor was ever manually specified, the bridge processor would get initialized twice
- Tarjan crashes if initialized before sgen, so when Tarjan became the default bridge processor Android always crashed on launch

The default bridge processor is now initialized at the end of sgen_gc_init.
2016-07-11 17:51:56 -04:00
Andi McClure 9d7ff20924 More verbose error message when sgen_register_fixed_internal_mem_type fails 2016-07-11 17:51:36 -04:00
Aleksey Kliger 7a5121678d Fix Windows build 2016-07-11 16:16:33 -04:00
Rodrigo Kumpera 74b9df2e9f [runtime] Add mono_set_allocator_vtable which expose the eglib alloc vtable functionality. 2016-07-11 13:23:20 -04:00
Dolphin Hawkins 856447c71e Fixed up configure overridable allocators option. Moved g_vasprintf implementation to gstr which forwards to the system vasprintf when appropriate 2016-07-11 13:23:20 -04:00
Dolphin Hawkins 3e0eb1a54c Fixed eglib test build error 2016-07-11 13:23:20 -04:00
Dolphin Hawkins 12af7a43ba fixed formatting error 2016-07-11 13:23:20 -04:00
Dolphin Hawkins 6474f8e612 Enabled g_mem_set_vtable through the configure option --with-overridable-allocators and exposed through mono_set_allocator_vtable 2016-07-11 13:23:20 -04:00
Alexander Köplinger c516dda693 [eglib] Fix Windows build 2016-07-11 12:10:00 +02:00
Alexander Köplinger e076a50737 [eglib] Fix compilation on Windows after 3bebb7696e
eglib uses G_OS_WIN32 instead of HOST_WIN32 for the Windows-specific code.
2016-07-11 11:31:29 +02:00
Alexander Köplinger c61df4dc52 Fix tarball/package build that was broken by 0a8d5a08
The new header file wasn't included in the tarball.
2016-07-11 01:00:33 +02:00
Marcos Henrich ccc6d60a33 Merge pull request #3192 from esdrubal/sym-spec
mono-symbolicate spec implementation
2016-07-08 22:51:36 +01:00
Andi McClure 0a8d5a08af Merge pull request #3252 from xmcclure/tarjan-opt-basic
Cleanup on gc bridge to support future optimizations
2016-07-08 17:51:02 -04:00
Marcos Henrich caccc92c6a [mono-symbolicate] Use Mono.Options. 2016-07-08 22:45:49 +01:00
Marcos Henrich 820324d9cf [corlib] Lowercase and no '-' in metadata guids.
MVID and AOTID stacktrace metadata no longer displays guids with '-'.

Metadata is now also using lowercase instead of uppercase.

Changed mono-symbolicate and mono --aot to use the minimalistic GUIDs.
2016-07-08 22:45:49 +01:00
Marcos Henrich 21c0c0823a [corlib] StackTrace fixes.
Replaced static constructor with delayed initialization.

Fixed possible undeterministic order of dumped MVIDs.

Used AppendFormat when possible.

Added comment to StackTrace.AddMetadataHandler explaining that it can be
used with reflection by outside code, to avoid removing it or changing
its signature.

Added StringComparer.Ordinal to dictionary.
2016-07-08 22:45:49 +01:00
Andi McClure 31e1a2a947 Cleanup on gc bridge to support future optimizations
Consists mostly of
- Comments
- Consolidate duplicate dynarray implementations in new-bridge and
  tarjan-bridge into a single header full of statics
2016-07-08 17:40:58 -04:00
Marcos Henrich 19a53fe7b0 [corlib] Ignore metadata on stacktrace tests
StackTrace tests no longer fail with stacktrace metadata.
2016-07-08 22:40:38 +01:00
Marcos Henrich 53a596d8be [corlib] Add Metadata to inner exceptions. 2016-07-08 22:40:38 +01:00
Marcos Henrich eb349adf59 [corlib] Skip MVID of stackframes without method.
Fixes NRE caused by stackframes without any method assigned to them.
2016-07-08 22:40:38 +01:00
Marcos Henrich 8e44dfdcbb [corlib] GetAotId now returns null, if unavailable
Also fixes issue when mono_domain still doesn't have any executing
assembly set.
2016-07-08 22:40:38 +01:00
Marcos Henrich 602b8952d5 [mono-symbolicate] Improved Makefile
Makefile now stores managed assemblies into the msym dir.

Each test now uses a separate directory to store stacktraces outputs and
symbols.
2016-07-08 22:40:38 +01:00
Marcos Henrich bc8c201f1a [runtime] AOTID is now properly stored. 2016-07-08 22:40:38 +01:00
Marcos Henrich 0db79f08b3 [mono-symbolicate] Fixes last stacktrace issue.
Extracted Symbolicate.Process stacktrace dump logic into DumpStackTrace
method. Which can also be used to dump the last stack trace after the
process loop.
2016-07-08 22:40:38 +01:00
Marcos Henrich 0f9c5caa3c [mono-symbolicate] Fixes symbolication of AOTed
Sequence points are only required if native offsets are on the
stacktrace.

fix -- seq point info aot
2016-07-08 22:40:38 +01:00
Marcos Henrich 4895ed1d10 [mono-symbolicate] Adds store-symbols
mono-symbolicate can now be called:
   symbolicate store-symbols <msym dir> [<dir>]+

This will store in <msym dir> all the managed symbols found in the
provided directories.
2016-07-08 22:40:38 +01:00
Marcos Henrich 35f1ca3ae6 [mono-symbolicate] Implemented metadata parsing.
mono-symbolicate now parses stack traces with metadata at their end.

All the stack trace and metada are read, so that symbolicate can use
MVID and AOTID to retrieve the symbols from the msym directory..
2016-07-08 22:40:38 +01:00
Marcos Henrich eb8cc5ca57 [runtime] Added aot=msym-dir=<DIR>
Removed gen-seq-points-file.
.msym files are now stored into a a subfolder of the provided msym-dir.
The subfolder of each .msym are named as AOTID.
2016-07-08 22:40:38 +01:00
Marcos Henrich 98050688e3 [runtime] aot-compiler.c now stores AOTID in image
AOTID is now also displayed during compilation.
2016-07-08 22:40:38 +01:00
Marcos Henrich 3bebb7696e Moved ensure_directory_exists to eglib.
Moved ensure_directory_exists in apdomain.c to g_ensure_directory_exists
in eglib/src/gpath.c so it can be reused.
2016-07-08 22:40:38 +01:00
Marcos Henrich 15ddd55f04 [corlib] Added MVID metadata to StackTrace
The MVID metadata handler displays multiple MVID(s) followed by the
 comma separated list of StackFrame lines whose method belongs to the
module with the displayed MVID.
2016-07-08 22:40:38 +01:00
Marcos Henrich 59cccab00d [corlib] Added metadata handlers to StackTrace
Added a reflectable static method that can be used to customize data
displayed after a stack trace.

Added metadata handler that display the AOTID of the executing assembly.
2016-07-08 22:40:38 +01:00
Marcos Henrich c235a59c5c [corlib] Added icall Assembly.GetAotId 2016-07-08 22:38:22 +01:00
Marcos Henrich 3d03fb578d [runtime] Adds AOTID
AOTID is a GUID generated by the AOT compiler and stored along with the
native code.

The AOTID uniquely identifies the generated native assembly.

The AOTID is required when we want to map native offsets to IL offsets
and the sequence points mapping those values need to be determined.
2016-07-08 22:38:22 +01:00
Rodrigo Kumpera a9035d9e74 Merge pull request #3258 from lindenlab/mono4-continuations_fix
Add some tests for Mono.Tasklets Continautions
2016-07-08 16:06:57 -04:00
Kelly Washington 9bf8d670fb Merge branch 'master' into mono4-continuations_fix 2016-07-08 16:20:07 +00:00
Kelly Washington 436c2cf1b3 Add microthreading test to ContinuationsTest 2016-07-08 16:06:44 +00:00
Aleksey Kliger (λgeek) 9d496e241e [coop] Change handles to be pointers (#3249)
Previously handles were pointer-sized structs.  Unfortunately not all
calling conventions treat pointer-sized structs as pointers, so if we
wanted to interact with handles from wrappers, we would have to do
something complicated.

With the new design, `TYPED_HANDLE_DECL(MonoFoo)` will expand to:
```c
    typedef struct {
        MonoFoo *__obj;
    } MonoFooHandlePayload;
    typedef MonoFooHandlePayload *MonoFooHandle;
```
2016-07-08 10:36:04 -04:00
Marcos Henrich 6f261e6bb6 [System] EndRead now throws WebException on abort.
When a requast is aborted on .NET a WebException is thrown and not a
ObjectDisposedException as we were doing.

Fixes #41477
2016-07-08 14:42:52 +01:00
Marcos Henrich 4a1de1526b [System] Test ReadAsync Cancellation.
Covers #41477
2016-07-08 14:42:51 +01:00
Johan Lorensson 5aa397ecb7 Merge pull request #3247 from lateralusX/jlorenss/win-x64-lmf-exception
Fix crash in mono mini exceptions.exe regression test on win x64.
2016-07-08 08:24:04 +02:00
Zoltan Varga e262b595b2 [llvmonly] Fix support for synchronized methods. 2016-07-07 23:42:26 -04:00
Zoltan Varga ec8e6139f4 [runtime] Remove the 'The wrapper info for the wrapper is a WrapperInfo structure.' comments, this is now true for all wrappers. 2016-07-07 22:26:51 -04:00
Zoltan Varga 8f5380f8f3 [jit] Emit memory barriers for volatile STFLD opcodes. Fixes #42413. 2016-07-07 20:06:58 -04:00
Kelly Washington 38a299e011 Merge branch 'continuations-test' into mono4-continuations_fix 2016-07-07 23:13:11 +00:00
Zoltan Varga 5cee22f7f7 [aot] Fix the llc flags when using hardfp on arm. 2016-07-07 18:59:16 -04:00
Zoltan Varga c770a73d36 [aot] Allow the loading of llvm compiled code into a non-llvm runtime on arm and vice versa, the restriction is not needed any more. 2016-07-07 18:57:55 -04:00
Kelly Washington b4a00d1ea3 Add ContinuationsTest for Mono.Tasklets 2016-07-07 22:39:03 +00:00
Rodrigo Kumpera e23589a6cf Merge pull request #3250 from jbevain/cli-flags
Fix definition and handling of the Preferred32bit CLI flag in the verifier
2016-07-07 17:09:30 -04:00
Jb Evain 2a8146f287 [runtime] Fix the CLI_FLAGS_PREFERRED32BIT value 2016-07-07 13:07:58 -07:00
Jb Evain 13f0bf1210 [runtime] Fix the CLI Header flags check 2016-07-07 13:06:08 -07:00
Alexander Kyte 74accfab20 [runtime] Free rgctx_lazy_fetch_trampoline info 2016-07-07 15:22:25 -04:00
Alexander Kyte 9233a8dfbd [runtime] Free temporary aot buffer 2016-07-07 15:22:24 -04:00
Alexander Kyte 88797e515e [runtime] Free info_offsets used by emit_extra_methods 2016-07-07 15:22:23 -04:00
Alexander Kyte d3853bbe3d [runtime] Free last buf used by emit_extra_methods 2016-07-07 15:22:22 -04:00
Alexander Kyte b4e3a0ecd3 [runtime] Free temporary table 2016-07-07 15:22:21 -04:00
Alexander Kyte bc07893021 [runtime] Free patches list 2016-07-07 15:22:21 -04:00
Alexander Kyte c5fc049ef3 [runtime] Free temporary trampoline emitter buffer 2016-07-07 15:22:20 -04:00
Alexander Kyte a2a5e35856 [runtime] Free temporary class name table 2016-07-07 15:22:19 -04:00
Alexander Kyte 901ba00d0f [runtime] Free leaked buffer 2016-07-07 15:22:18 -04:00
Alexander Kyte 5f9e4d4122 [runtime] Free temporary pointer array 2016-07-07 15:22:17 -04:00
Alexander Kyte 8a5acf4c51 [runtime] Free temporary attr structure 2016-07-07 15:22:16 -04:00
Alexander Kyte 9d9f42dded [runtime] Don't leak a runtime invoke method builder 2016-07-07 15:22:15 -04:00
Alexander Kyte 8a31a248ed [runtime] Don't leak short-lived header 2016-07-07 15:22:14 -04:00
Alexander Kyte 0c12c23250 [runtime] Free leaked temporary parse 2016-07-07 15:22:13 -04:00
Alexander Kyte 0b6d8e9a37 [runtime] Prevent leak by copying list with no other references 2016-07-07 15:22:13 -04:00
Alexander Kyte 2d5ffcb8e3 [runtime] Free vars in linear_scan2 2016-07-07 15:21:53 -04:00
Alexander Kyte 5a5ada0ae2 [runtime] Free register info 2016-07-07 15:21:43 -04:00
Bennjamin Blast 8694ee1f46 Modify the configuration loader so that (#2758)
- A single dll can be mapped to different targets based on function name.
- The dllentry target can be omitted if it is the same as the source.

This change is released under the MIT license.
2016-07-07 14:47:33 -04:00
alenl2 00a7f1b7ad Fixed stack overflow issue in DuplexClientRuntimeChannel (#2172) 2016-07-07 14:19:22 -04:00
lateralusX 87afbc4422 Fix crash in mono mini exceptions.exe regression test on win x64.
Exceptions.exe regression test started to fail on win x64 release builds.
Turns out that the Visual Studio C compiler picked a different optimization
for release builds (due to a change of library type that uses a different default optimization level)
using RSI register in native code calling into JIT:ed code. If the JIT:ed code used reflection
and exceptions, that triggers InternalInvoke and lmf_filter, the code only
stored System V x64 non-volatile registers in the unwind information. On Windows,
RSI is also a non-volatile register (RDI as well) that needs to be preserved and
since the code didn’t include those in the unwind information, the correct RSI value
was not restored during the unwind. Once the control was handled back to the native
code it dereferenced RSI (that was set to 0) and crashed.

The fix is to make sure we store all non-volatile registers on x64 Windows
when we save an lmf so the unwind code can restore them when unwinding through
the lmf.
2016-07-07 17:24:49 +02:00
Aleksey Kliger 5b39ce65cc [mini] bump AOT version - WrapperType changed 2016-07-07 11:09:20 -04:00
Aleksey Kliger d1ace1652b [runtime] Remove STFLD_REMOTE wrapper type. 2016-07-07 11:09:19 -04:00
Aleksey Kliger 0423293064 [runtime] Remove mono_store_remote_field_new_icall.
It is dead code.
2016-07-07 10:59:03 -04:00
Aleksey Kliger 50a2f837a0 [remoting] call TransparentProxy::StoreRemoteField directly from STFLD_REMOTE wrapper.
Don't call via mono_store_remote_field_new_icall.
2016-07-07 10:59:03 -04:00
Aleksey Kliger 4e9cd385aa [remoting] Convert mono_store_remote_field_new_checked to managed code
Reimplement as System.Runtime.Remoting.Proxies.TransparentProxy:StoreRemoteField
2016-07-07 10:59:03 -04:00
Marek Safar 2d22bb12dc Merge pull request #3244 from henricm/fix-for-synchronization-attribute
Fix for lock release in SynchronizationAttribute
2016-07-07 14:25:59 +02:00
Zoltan Varga 1b9a6aaac7 [llvm] Enable atomic load/store support when using llvm master. 2016-07-07 04:41:54 -04:00
Zoltan Varga 7fa8d07125 [llvm] Use a custom memory managed for llvm master too, the default one allocates everything into a separate memory page. 2016-07-07 03:23:21 -04:00
Henric Müller 3de4092e85 Fix for lock release in SynchronizationAttribute
* Making sure ownerThread is not nulled unless lockCount is zero.
* Fixed so Locked property checks lockCount when determining if locked
   instead of _locked field which was never set.
* Added test for setting Locked property.
* Added test capturing the original issue.
2016-07-07 08:56:16 +02:00
Zoltan Varga 0c8c3aef22 [llvm] Fix some problems when using llvm master. Check the base pointer for null instead of the derived one in load/store opcodes. Avoid trying to name parameters representing empty structs, they have no llvm parameter. Avoid trying to patch calls from llvm code, they are made indirectly. 2016-07-07 00:55:38 -04:00
Andi McClure 64b3e392ae Merge pull request #3239 from xmcclure/default-tarjan
Switch Android GC bridge default from new-bridge to tarjan-bridge
2016-07-06 17:26:45 -04:00
Alexander Kyte 548f40b70a [runtime] Free patches array in aot compiler 2016-07-06 17:21:44 -04:00
Alexander Kyte 2be7465287 [runtime] Move mempools up, don't free methodheaders pointing into it after, etc 2016-07-06 17:13:33 -04:00
Alexander Kyte 54e98c46dc [runtime] Don't leak method header (significant leak size) in aot compiler 2016-07-06 17:13:32 -04:00
Alexander Kyte 332cf0af1c [runtime] Defer destruction of MonoCompile until patches have been emitted 2016-07-06 17:13:31 -04:00
Alexander Kyte 3cf76a8454 [runtime] Always free method header in method_to_ir 2016-07-06 17:13:30 -04:00
Alexander Kyte ae9c94e152 [runtime] Clean up method_to_callers table for llvm 2016-07-06 17:13:29 -04:00
Alexander Kyte 3731535084 [runtime] Don't leak temporary jump info struct
This represented 93k leaked allocations when aoting mscorlib
2016-07-06 17:13:28 -04:00
Alexander Kyte 3b4334e793 [runtime] Prevent leaking temporary 2016-07-06 17:13:27 -04:00
Alexander Kyte bd7292f9b4 [runtime] Free LLVM failure message 2016-07-06 17:13:26 -04:00
Alexander Kyte 60b0d0d7ac [runtime] Fix minor leak 2016-07-06 17:13:23 -04:00
Alexander Kyte 0445f85ec0 [runtime] Don't leak LLVM IR Builders 2016-07-06 17:11:43 -04:00
Marek Safar d4886043dc Merge pull request #3243 from mono/netstandard
[Facades] netstandard 1.6 updates
2016-07-06 21:35:02 +02:00
Alexander Köplinger b14dcc5163 [System] Bump timeout in TimerTest a bit
I saw this failing occasionally on iOS on Wrench:

```
[FAIL] TimerTest.AutoResetEventFalseStopsFiringElapsed :   #2 wrong elapsedCount
  Expected: 1
  But was:  0

	at MonoTests.System.Timers.TimerTest.AutoResetEventFalseStopsFiringElapsed () [0x00091] in /Users/builder/data/lanes/1411/b07703ed/source/xamarin-macios/external/mono/mcs/class/System/Test/System.Timers/TimerTest.cs:327 
	at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
	at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/data/lanes/1411/b07703ed/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:309 
```
2016-07-06 21:32:10 +02:00
Marek Safar 276c31d5ed [Facades] netstandard 1.6 updates 2016-07-06 12:57:33 +02:00
Zoltan Varga b07703ed57 [llvm] Fix JIT support with llvm master. 2016-07-06 03:36:06 -04:00
Johan Lorensson ee05c8a322 Multiple fixes for Windows x86 p/invoke test failures. (#3186)
* Fix for non GCC win x86 calling convention when passing empty structs over pinvoke.

Port of https://github.com/mono/mono/pull/3085 to Winwdows x86 fixing failures
in pinvoke2 tests:

test_0_marshal_empty_struct

* Fix for incorrect implementation of small struct (single float/double) on Windows x86.

Failure in pinvoke3 test_0_marshal_small_struct_delegate9 is caused by incorrect
implemented small struct ABI on Windows x86.

Windows x86 ABI for returning structs of size 4 or 8 bytes (regardless of type)
dictates that values are passed in EDX:EAX register pairs,
https://msdn.microsoft.com/en-us/library/984x0h58.aspx.
This is different compared to for example float or double return types
(not in struct) that will be returned in ST(0),
https://msdn.microsoft.com/en-us/library/ha59cbfz.aspx.

Fix disables the alternative to do special handling of structs with 1 float or double
and make sure same logic is always applied to all small structs regardless type
as dictated by Windows x86 ABI.

* mono_test_marshal_delegate_ref_delegate uses incorrect calling convention.

mono_test_marshal_delegate_ref_delegate called by pinvoke3::test_55_marshal_delegate_ref_delegate
uses incorrect calling convention. Mono assumes delegates to be stdcall but
current definitions will be cdecl, this will cause an incorrect stack pointer
on architectures where cdecl and stdcall are different (Windows x86). Test fails
with "corrupt" stack pointer on Windows x86.

* Smaller adjustment based on feedback.

* Changed boolean struct member to bit field (on both x86 and x64)
* Changed compare code style from 0 == x to x == 0 to comply with coding standard.
2016-07-06 00:32:08 -04:00
Johan Lorensson 4d9ffd3db2 Added support to build mono runtime as a static library. (#3231)
libmono will use static library when building its dynamic library. This gives
the option to build binaries that could link the static version of mono runtime
or use the dynamic version of the same library. The default build binaries still
link against the dynamic version of the runtime.
2016-07-06 00:28:02 -04:00
Zoltan Varga 4261bb6696 [llvm] Fix aot when using llvm master. 2016-07-06 00:19:50 -04:00
Alexander Köplinger 9ae0c7f099 Merge pull request #3242 from alexanderkyte/fix_docs
[runtime] Remove extraneous fi in docs build printing
2016-07-06 02:08:26 +02:00
Alexander Kyte cfa44850df [runtime] Remove extraneous fi in docs build printing 2016-07-05 20:07:39 -04:00
Alexander Köplinger a042e25e88 Merge pull request #3091 from alexanderkyte/mobile_static_fix_mcs_tests
[mobile_static] Allow mcs/class tests to run to completion
2016-07-06 00:12:21 +02:00
Zoltan Varga 00bf4b43d1 [bcl] Fix a random failure in a DataView test which happened because DataViewListener keeps a weak reference on the DataView and stops raising events if the view is GCd. Fixes #41035. 2016-07-05 16:30:21 -04:00
Andi McClure 086f9a53bc Switch Android GC bridge default from new-bridge to tarjan-bridge 2016-07-05 13:11:36 -04:00
Alexander Kyte 1a0c6a5a8c [mobile_static] Skip aot-ing ilasm 2016-07-05 12:22:27 -04:00
Alexander Köplinger 79e23ab784 Merge pull request #3236 from kumpera/coreclr-testsuite-fixes-2
Reduce coreclr test failures by 10. A bunch of fixes and a bunch of disables.
2016-07-05 16:27:14 +02:00
Aleksey Kliger (λgeek) 0d06b59726 [profiler] Actually link against libmono where necessary (#3232)
Previously $(LIBMONO) was empty and bitcode targets (which set
-no-undefined) had linker errors.
2016-07-05 10:21:55 -04:00
Marcos Henrich 8fad9cb484 Merge pull request #3226 from esdrubal/soap_headers_fix
[System.Web.Services] Fixes bad XmlMapping.Key.
2016-07-05 11:31:14 +01:00
Marcos Henrich 80d015b2df Merge pull request #3210 from esdrubal/connectasyncUHE
[System] Fixes ConnectAsync UnhandledEx
2016-07-05 10:46:03 +01:00
Rodrigo Kumpera 11e7e44399 Merge pull request #2958 from kumpera/visibility
Fix a visibility check bug
2016-07-04 15:46:33 -04:00
Rodrigo Kumpera 3d74189386 [jit] Set vret_var when emiting a jmp call. 2016-07-04 15:14:23 -04:00
Rodrigo Kumpera 113f0c4a18 [coreclr-tests] Disable a test that fails verification. 2016-07-04 14:08:54 -04:00
Rodrigo Kumpera 2b7b2f6a99 [coreclr-tests] Disable another broken test. 2016-07-04 10:27:37 -04:00
Rodrigo Kumpera 03b3030deb [coreclr-tests] Disable another broken test. 2016-07-04 10:24:07 -04:00
Marek Safar f66524ab9c [mcs] More tweaks in betterness improvements. Fixes #42057 2016-07-04 15:04:17 +02:00
João Matos f104d6b81c Merge pull request #3234 from tritao/zip_non_seekable_streams
[System.IO.Compression] Fixes ZipArchive to support non-seekable streams
2016-07-04 12:10:51 +01:00
Marek Safar 7493195f07 [System.Numerics.Vectors] Update type forwarders 2016-07-04 12:39:42 +02:00
Marek Safar 21dbf2ea4e [System.Numerics] Update .net 4.6 api 2016-07-04 11:28:07 +02:00
Alexander Kyte b10af779c3 [mobile_static] Use make parallelism to aot compile .dlls in parallel 2016-07-02 21:33:08 -04:00
Alexander Kyte accce74440 [mobile_static] Use MonoPInvokeCallbackAttribute on MobileStatic 2016-07-02 21:33:08 -04:00
Alexander Kyte 2af9da505d [mobile_static] Make Mono.CSharp excludes for tests that require compilation 2016-07-02 21:33:07 -04:00
Alexander Kyte cbda3a28d7 [mobile_static] Blacklist app domain creation test 2016-07-02 21:33:07 -04:00
Alexander Kyte cd04fa35c7 [mobile_static] Remove some duplicated excludes 2016-07-02 21:33:07 -04:00
Alexander Kyte f59ebb3ee0 [mobile_static] Fix misformatted excludes, tests excluded due to lack of System.Configuration 2016-07-02 21:33:07 -04:00
Alexander Kyte 2fbf908ef0 [mobile_static] Tracked down unpassable ServiceModel tests, blacklisted 2016-07-02 21:33:06 -04:00
Alexander Kyte 540e26a05b [mobile_static] Add MOBILE_STATIC to preprocessor guard 2016-07-02 21:33:06 -04:00
Alexander Kyte 8b5f755b2b [mobile_static] Blacklisted unpassable tests for System 2016-07-02 21:33:06 -04:00
Alexander Kyte ef65c56fa7 [mobile_static] Fix System.Runtime.Serialization tests with preprocessor
usage
2016-07-02 21:33:06 -04:00
Alexander Kyte b0faf2ad9a [mobile_static] Fix libraries provided when building System 2016-07-02 21:33:05 -04:00
Alexander Kyte 56b0093236 [runtime] Add System.Data app config. 2016-07-02 21:33:05 -04:00
Alexander Kyte ab33176867 [runtime] Implement TLS_OP_GET_REG on linux (#3227) 2016-07-02 20:26:04 -04:00
Zoltan Varga 7c3890bf49 [runtime] Abort the finalizer thread first instead of stopping it, to allow an orderly shutdown and to avoid hitting the 'finalizer_thread_exited' assert. Hopefully fixes #41833. (#3233) 2016-07-02 20:25:06 -04:00
João Matos 77e2521d8c [System.IO.Compression] Fixes ZipArchive to support non-seekable streams.
This is the same behavior as documented on MSDN.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=30686.
2016-07-02 02:02:25 +01:00
Rodrigo Kumpera 749dbde308 [jit] Add fixme to AA. 2016-07-01 20:08:44 -04:00
Rodrigo Kumpera 893faba65c [mini] Ensure that an endfinally outside of a finally block fails to JIT. 2016-07-01 20:08:38 -04:00
Rodrigo Kumpera 90e7004a63 [ilasm] Side with parent declaration when deciding if a type is an enum or a value type.
The conflict happens when a type is declared like this:

.class value private auto ansi serializable sealed foo extends [mscorlib]System.Enum

The value keyword would make it a value type and ignore the parent declaration.

.net ilasm favors the later, which makes more sense.
2016-07-01 20:08:28 -04:00
Rodrigo Kumpera 281fc599e3 [jit] Remove silly debug spew. 2016-07-01 20:08:20 -04:00
Rodrigo Kumpera 155dc6fb61 [coreclr-tests] Disable another test that depends on array size limits on .net. 2016-07-01 20:07:37 -04:00
Rodrigo Kumpera f580e18de5 [amd64] The prolog stack probe code sequence is 11 bytes each chunk and not 10. Fixes coreclr test. 2016-07-01 20:06:24 -04:00
Rodrigo Kumpera 8aba35630f [coreclr-tests] Disable some tests that are not supposed to work under mono. 2016-07-01 20:06:13 -04:00
Rodrigo Kumpera 028dba1a01 [jit] Return NULL on zero sized localloc. Fixes coreclr test. 2016-07-01 20:03:45 -04:00
Rodrigo Kumpera e56d29f7a3 [verifier] Do method visibility checks for virtual final methods. Enable type visibility for all methods. Fixes #5644.
I addressed the issue mentioned in the comments of mono_method_can_access_method:

* FIXME:
* with generics calls to explicit interface implementations can be expressed
* directly: the method is private, but we must allow it. This may be opening
* a hole or the generics code should handle this differently.
* Maybe just ensure the interface type is public.

The way to do it is to check access between gmds
2016-07-01 19:57:07 -04:00
Vlad Brezae 6b1b08cc60 Merge pull request #3211 from BrzVlad/fix-finalizer-thread-exited
[sgen] Speed up domain finalization at shutdown
2016-07-01 23:56:31 +03:00
Aleksey Kliger (λgeek) 8e61507bba [remoting] If remoting is disabled, don't assert looking for LoadRemoteFieldNew (#3229) 2016-07-01 11:11:54 -04:00
Vlad Brezae 77c26ff205 [sgen] Make suspend_finalizers volatile
It is used for signaling on separate threads.
2016-07-01 18:10:01 +03:00
João Matos 64b439f135 Merge pull request #3225 from tritao/zip_stream_getters
[System.IO.Compression] Fixed Zip entry stream length/position getters in Update mode
2016-07-01 15:05:57 +01:00
Zoltan Varga 7a0a39aed9 [llvmonly] Fix the name of a few llvmonly icalls. 2016-06-30 22:42:51 -04:00
Zoltan Varga 50cab13bc3 [llvmonly] Unwrap RuntimeWrapperExceptions if needed. 2016-06-30 22:31:12 -04:00
Zoltan Varga 098d79564b [sgen] Avoid throwing exceptions from inside the critical region in the managed allocators. (#3230) 2016-06-30 22:28:55 -04:00
Zoltan Varga 36f7bf2c22 [corlib] Mark some StackTrace/StackFrame methods as NoInlining to prevent llvm from inlining these methods, which breaks the stacktrace computation code in the runtime. 2016-06-30 22:07:54 -04:00
Zoltan Varga fe991525f6 [tests] Probe for a different type than System.IO.Pipes.PipeOptions which is not part of the mobile_static profile. Fixes #41955. 2016-06-30 21:15:05 -04:00
Zoltan Varga 9515b7047e [llvmonly] Avoid asserting when caching non-open generic instances. 2016-06-30 20:49:17 -04:00
Zoltan Varga 6c9b5969dc [llvmonly] Emit gsharedvt wrappers for Nullable.Unbox calls. 2016-06-30 20:48:42 -04:00
Zoltan Varga 2def45a262 [llvmonly] Fix a case where an ftnptr was invoked as a method address. 2016-06-30 20:35:26 -04:00
Zoltan Varga 60bee25211 [llvmonly] Fix invocation of string ctors. Emit Array.Set/Get wrappers for more types. 2016-06-30 19:34:50 -04:00
Zoltan Varga 44fed99f09 [jit] Avoid emitting seq points inside alloc wrappers, they contain critical regions, and if thread self suspend in the seq point handler, it cannot be suspended by other threads. Fixes #42191. 2016-06-30 17:40:24 -04:00
Marcos Henrich aa68415f7b [System.Web.Services] Fixes bad XmlMapping.Key.
Fixes #41564

Calling xmlImporter.ImportMembersMapping would set the key with the
underlying message type [1], thus if a service had remote calls using
the same types a key already exists exception would be thrown.

Furthermore reference source has special logic to set headers
XmlMappings key [2].

This pull request fixes the issue by overriding the XmlMappings.Key with
the values similar to those used in the reference source version.

[1] http://referencesource.microsoft.com/#System.Xml/System/Xml/Serialization/XmlMembersMapping.cs,28
[2] http://referencesource.microsoft.com/#System.Web.Services/System/Web/Services/Protocols/SoapReflector.cs,515
2016-06-30 18:12:44 +01:00
Marcos Henrich 631d5dd49f [System.Web.Services] Test Header sharing issue.
Covers #41564

When multiple methods shared soap header a duplicate key exception would
be thrown.

This issue only occurs on XAMMAC and MOBILE where the non reference
source serializer is still used.
2016-06-30 17:56:16 +01:00
Andi McClure 2a6315ca00 Restore NULL check which PR #3040/#3105 mistakenly removed (bug 41623) (#3219)
Could cause crash while stepping over in SDB.
2016-06-30 12:44:46 -04:00
João Matos 4fc860ec21 [System.IO.Compression] Fixed Zip entry stream length/position getters in Update mode.
This does away with the lazy writeable entry scheme in Update mode and converts the stream to be writeable when its opened in Update mode.

From local testing, .NET does the same in this case.

Fixes another issue reported by @Numpsy in https://github.com/OfficeDev/Open-XML-SDK/issues/64.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42274.
2016-06-30 14:15:52 +01:00
João Matos c167f3abe3 Merge pull request #3216 from tritao/zip_duplicate_entries
[System.IO.Compression] Fixed handling of Zip archives with duplicate entries with same name.
2016-06-30 12:58:00 +01:00
Jon Purdy ee7491ffba [runtime] Document MonoDomain.static_data_array. (#3223)
Saw a confusing comment, updated it.
2016-06-30 03:00:36 -04:00
Alex Rønne Petersen f101186786 Merge pull request #3220 from alexrp/master
Revert changes to profiler library linking
2016-06-30 04:08:28 +02:00
Alex Rønne Petersen 46b920abb1 Revert "[profiler] Don't build shared libraries under bitcode."
This reverts commit cfd9870f83.

There is no need for this as of 79b99a989d8d4cf2636b738a623bb3656e048ebf.
2016-06-30 00:50:31 +02:00
Alex Rønne Petersen d577ffac0f [profiler] Link profiler libraries against libmono (revert of 92341a).
This caused issues with symbol resolution at runtime on Android and we haven't
seen any *actual* cases where linking against libmono caused problems.
2016-06-30 00:50:26 +02:00
Zoltan Varga f16741a60a [bcl] Add a workaround for a watchos limitation to a memory mapped file test. Fixes #41747. 2016-06-29 09:39:44 -04:00
João Matos 7a9a7b2373 [System.IO.Compression] Fixed handling of Zip archives with duplicate entries with same name.
.NET supports this, from MSDN: "If an entry with the specified path and name already exists in the archive, a second entry is created with the same path and name.".

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42219.
2016-06-29 11:28:16 +01:00
João Matos 0d5ea337a6 Merge pull request #3214 from tritao/zip_new_entries_writes
[System.IO.Compression] Fixed writes to newly-created Zip archive entries in Update mode.
2016-06-29 11:20:44 +01:00
Aleksey Kliger (λgeek) 787e34ae2d [remoting] Convert mono_load_remote_field_new_checked to managed code (#3149)
* [remoting] Convert mono_load_remote_field_new_checked to managed code.

* [corlib] Expose runtime struct MonoRemoteClass and MonoClass to managed

Also expose  mono_class_get_type to managed code.

* [corlib] Add Mono.RuntimeClassHandle to encapsulate MonoClass*

and Mono.RuntimeRemoteClassHandle to encapsulate MonoRemoteClass*

* [runtime] mono_marshal_get_ldfld_remote_wrapper invoke the managed TransparentProxy.LoadRemoteFieldNew method directly

Don't bother going through a native call and back out to managed.

* [runtime] Get rid of MONO_WRAPPER_LDFLD_REMOTE

When the MONO_WRAPPER_LDFLD is operating on a proxy, it always invokes
the TransparentProxy::LoadRemoteFieldNew managed method

* [runtime] Remove dead mono_load_remote_field_new_icall

* [mini] Bump AOT file format version

Because we removed the LDFLD_REMOTE wrapper type so all the
MonoWrapperType enum values shifted.
2016-06-28 18:22:04 -04:00
Alexander Köplinger 842b97f3cd Merge pull request #3187 from akoeplinger/mstestsuite-on-prs
[ci] Add ms-test-suite step to default test runs
2016-06-28 21:35:42 +02:00
Alexander Köplinger f358a708c0 [ci] Skip ms-test-suite on non-OSX workers
Some locale tests are running into issues on Linux, they should be investigated separately.
2016-06-28 19:48:45 +02:00
João Matos dab5ef4d6e [System.IO.Compression] Fixed writes to newly-created Zip archive entries in Update mode.
This regression was reported by RichardW of Open XML SDK project.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=39282.
2016-06-28 17:59:00 +01:00
monojenkins 4239ddd9f1 Merge pull request #3204 from BrzVlad/fix-lock-free-alloc2
[utils] Fix retiring of live block for the lock free allocator

Freeing a block descriptor (along with the block) can happen either when freeing a pointer in the block (we do this in order to prevent situations where we need to wait for the next alloc in order to free a block), either when we acquire an empty block while allocating. Either way, in order to free a block descriptor, we need to acquire it first.

When freeing a slot in a block, we are checking if the block is now empty in which case we acquire the block descriptor in order to free it (along with the block). While doing so, we were failing to account for the case where, by the time we make the block descriptor empty and the time we acquire it, another thread would try to allocate from the same descriptor, see that it's empty, free it, allocate a new descriptor (which would happen to have the same address as the retired one) to fulfill the allocation and then set it as the active descriptor for the allocator. When the first thread finally acquires the descriptor, we need to double check that it is still empty since it might be logically a different descriptor than the one we actually freed from. In the unlikely case it's not empty, we need to put it back in the allocator's data structures.
2016-06-28 00:08:47 +01:00
Vlad Brezae 90e6a2d949 [sgen] Use sgen_qsort instead of qsort (#3205)
qsort is not signal safe.
2016-06-27 12:30:45 -04:00
Alexander Köplinger fdd84f680e Merge pull request #3202 from dlahoti/patch-1
make monodis exit with value 1 on an error
2016-06-27 13:07:08 +02:00
Marcos Henrich 992d27a8e6 [System] Fixes ConnectAsync UnhandledEx
Fixes #41616

ConnectAsyncCallback now throws an exception when called a second time.
ConnectAsync reuses SocketAsyncEventArgs in BeginConnect which
already updates its state and calls ConnectAsyncCallback.

The changes make sure that ConnectAsyncCallback no longer called on
ConnectAsync catch block, while the state is still updated with the
exception.
2016-06-27 10:42:05 +01:00
Marcos Henrich a05bc5465a [System] Test Unhandled Ex on ConnectAsync
Covers #41616

Our console runner is currently swallowing this test unhandled
exceptions.

To make it test show the failure I had to set legacyUnhandledExceptionPolicy
to 0 in mcs/class/lib/net_4_x/nunit-console.exe.config

Then running we can observe the crash by running:
make -C mcs/class/System check TESTNAME=System.Net.Sockets.SocketTest.ConnectAsyncUnhandledEx

Other tests appear to crash with legacyUEP set to 0, while the runner
shows no errors.
2016-06-27 10:42:05 +01:00
Vlad Brezae 3668b437ea [sgen] Speed up domain finalization at shutdown
When we cleanup the gc at shutdown, we no longer care about running the remaining finalizers so we set the suspend_finalizers flag. This flag skipped running the finalizers but we would still traverse and modify the sgen finalizer hashes (on an arm box this could take even longer than 1s and lead to finalizer_thread_exited assertion failure since it's over the 100ms limit).

Avoid traversing sgen finalization hashes as soon as we see that we are shutting down.
2016-06-25 17:43:00 +03:00
João Matos 5221f80822 Merge pull request #3209 from tritao/master
[System.IO.Compression] Fixed stream writes when Zip archive is opened in Update mode
2016-06-24 20:25:09 +01:00
Ludovic Henry 8892b1da77 Merge pull request #3208 from ludovic-henry/iolayer-remove-shared
[io-layer] Remove remaining pieces for cross-process mutex, semaphore and event
2016-06-24 19:23:30 +02:00
Neale Ferguson e70a8aca1c Enhanced logging - attempt 2.5 (#3191)
* Revert "Revert "Enhance log tracing""

This reverts commit 565c6ac080.

* Better handle legacy log handler processing with suggestions from lamdageek

* Remove unnecessary assignment

* Restore mono_trace_set_log_handler parameters to their original specification
2016-06-24 12:47:01 -04:00
Ludovic Henry 7d8b8c08c0 [io-layer] Replace remaining pthread_cond_t by mono_cond_t 2016-06-24 15:47:19 +02:00
Ludovic Henry f42c7004be [io-layer] Fix potential buffer overrun 2016-06-24 15:43:17 +02:00
Ludovic Henry 2e41a15c5e [io-layer] Remove _wapi_shared_layout
This effectively remove any remaining code regarding the cross-process sharing of certain io-layer facilities.
2016-06-24 15:30:47 +02:00
João Matos 4a4d34f489 [System.IO.Compression] Fixed stream writes when Zip archive is opened in Update mode.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=39282.

Also helps with https://github.com/OfficeDev/Open-XML-SDK/issues/64.
2016-06-24 01:27:46 +01:00
Alexander Köplinger cafe2f9290 Merge pull request #3207 from ntherning/fix_broken_libmonosgen_dll_on_cygwin
Fix broken libmonosgen-2.0.dll on Cygwin due to -ggdb3 flag in CFLAGS
2016-06-24 00:37:04 +02:00
Ludovic Henry 2cbdc10bfd [io-layer] Merge _WapiHandleShared type into _WapiHandleUnshared 2016-06-23 18:42:33 +02:00
Ludovic Henry a3fde0a6b9 [io-layer] Make shared and unshared handle have the same fields 2016-06-23 18:42:33 +02:00
Ludovic Henry c162a18223 [io-layer] Remove mutex and namedmutex pid field
We do not support shared process handles anymore, so the pid is always going to be the same
2016-06-23 18:42:33 +02:00
Ludovic Henry 96c67c2e2f [io-layer] Remove _wapi_handle_timedwait_signal 2016-06-23 18:42:33 +02:00
Niklas Therning ba79e78de5 Don't pass -ggdb3 in CFLAGS on Windows builds as it somehow corrupts the
libmonosgen-2.0.dll and breaks the build of monograph.exe which links against
it.

Also adds -O2 to CFLAGS on all platforms to align with how releases are built.
2016-06-23 14:27:01 +02:00
dlahoti d7962daf42 make monodis exit with value 1 on an error
This should make it easier to programmatically check for errors, since it will remove the need to test the output string, which is an unreliable way of doing things.
2016-06-22 23:24:25 -05:00
Vlad Brezae 76fa75aed0 [utils] Fix retiring of live block for the lock free allocator
Freeing a block descriptor (along with the block) can happen either when freeing a pointer in the block (we do this in order to prevent situations where we need to wait for the next alloc in order to free a block), either when we acquire an empty block while allocating. Either way, in order to free a block descriptor, we need to acquire it first.

When freeing a slot in a block, we are checking if the block is now empty in which case we acquire the block descriptor in order to free it (along with the block). While doing so, we were failing to account for the case where, by the time we make the block descriptor empty and the time we acquire it, another thread would try to allocate from the same descriptor, see that it's empty, free it, allocate a new descriptor (which would happen to have the same address as the retired one) to fulfill the allocation and then set it as the active descriptor for the allocator. When the first thread finally acquires the descriptor, we need to double check that it is still empty since it might be logically a different descriptor than the one we actually freed from. In the unlikely case it's not empty, we need to put it back in the allocator's data structures.
2016-06-23 03:18:01 +03:00
Vlad Brezae c3648e7f82 [runtime] Bump corlib version for recent Thread layout changes 2016-06-22 17:43:31 +03:00
Alexander Köplinger 61f34e5928 Merge pull request #3197 from BrzVlad/fix-thread-layout
[sgen] Fix Thread layout after changes in #3123
2016-06-23 00:35:18 +02:00
Marek Habersack 850d468d2d Don't run the ping test on certain Android devices
As described in https://bugzilla.xamarin.com/show_bug.cgi?id=34883 at
least Samsung SG3 doesn't allow access to the local network
interface (in fact, even ifconfig doesn't work on the device). Therefore
the test needs to be disabled on those devices. This is the first part
of the fix, the second one will be implemented in Xamarin.Android test
suite which will provide the AndroidShouldPingWork method which will
check the device id against list of those that do not work for this
test.

Part #1 of fix for https://bugzilla.xamarin.com/show_bug.cgi?id=34883
2016-06-22 14:46:40 +02:00
Vlad Brezae b56cf46a56 [sgen] Fix Thread layout after changes in #3123 2016-06-22 12:17:22 +03:00
João Matos 70012f5ae0 Merge pull request #3195 from tritao/zip_stream_getters
[System.IO.Compression] Fixed stream length/position getters for ZIP entries
2016-06-22 00:52:27 +01:00
João Matos efe3c753e4 [System.IO.Compression] Fixed stream length/position getters for ZIP entries.
Partial fix for https://bugzilla.xamarin.com/show_bug.cgi?id=39282.

Partial fix for https://github.com/OfficeDev/Open-XML-SDK/issues/64.
2016-06-22 00:51:20 +01:00
Marek Safar 27482448e9 [System] Overwrite Console encoding to match mcs text output for CodeDOM compiler. Fixes #41979 2016-06-21 19:46:14 +02:00
Alexander Köplinger f094041420 Merge pull request #3188 from akoeplinger/mozroots-fix
[tools] Fix mozroots URL for Mozilla's certdata.txt and add deprecation warning
2016-06-21 17:15:57 +02:00
Alexander Köplinger e8bd8e656d [tools] Fix mozroots URL for Mozilla's certdata.txt and add deprecation warning
MXR is not coming back (see https://bugzilla.mozilla.org/show_bug.cgi?id=1279952 and https://github.com/SuaveIO/mono-script-buildpack/issues/9#issuecomment-226749314)
and this broke everyone who still relied on mozroots. Fix by using the version from the hg repository instead.

Starting from Mono 3.12 we've been shipping cert-sync to import CA certificates from the local computer trust store to Mono's trust store,
we strongly encourage everyone to move to that instead. Added a deprecation warning to mozroots to further strengthen this message.

Note that when fetching the CA list over the new https URL we need to skip cert validation errors, as the common use case for mozroots is when
no certs are present on the system (bootstrapping). This enables MITM but we don't really have any other options. Another reason why cert-sync is superior.
2016-06-21 17:14:22 +02:00
Marek Safar 33f95a1486 [System] Update IPInterfaceProperties initialization on windows. Fixes #41897 2016-06-21 15:50:02 +02:00
Marek Safar c476c4c468 [corlib] Add range check for minimal date in dst calculation. Fixes #41667 2016-06-21 15:16:45 +02:00
Alexander Köplinger cf1b844a98 [scripts/submodules] Add branch to check if fetch is needed
In some cases the "git log -1 <remote>" check fails even though the remote is configured
and an unnecessary fetch is done. Adding the branch to the check fixes this.
2016-06-21 03:03:07 +02:00
Neale Ferguson 89bf42b05f Use thread priority at thread start time (#3123)
* An enhancement to the thread priority work added earlier. This will support starting a thread with a specified priority. Currently, the thread will start with the priority of the creator. The semantics of threads allow you to specify the priority of a thread before it has started. Therefore, we take note of this value at thread creation time.

* Missed committing this file the first time

* Correct typo

* Fix creation_flags reference

* MonoThreadParm really should not be in objects-internal

* Place priority in MonoInternalThread where it can be accessed by GetThreadPriority(). This enablses the priority to be set/retrieved before the thread is started. It also ensures that new threads default to a priority of THREAD_PRIORITY_NORMAL rather than inheriting the parent thread's priority.

* Revert changes to MonoInternalThread/Thread.cs. Properly use the handle for thread lookup. Initialize priority at thread creation time. Use stored value of priority if thread has not been started.

* Add code to handle retrieving the thread priority from a started thread that had been set before thread had started. This is necessary as before the thread is started the priority value can be manipulated. This value is stored in the MonoThread structure. Before the thread is started the value can be interrogated so we return this value rather than invoking the GetThreadPriority() API. When a thread is started this value is used to set the threads priority (if scheduling policy is SCHED_FIFO or SCHED_RR). For POSIX threads, after the thread is started we now keep the priority in the _Wapi_thread structure which is located via the thread handle. This structure doesn't exist until after the thread is started so we can't store the value there but after we can cache the priority value there and return it for non-SCHED_[RR|FIFO] threads. This way the expected value will always be set and returned by ThreadPriority property (currently for these threads it will simply return Normal). A test case has been added to the mono/tests directory.

* Use a copy of creation_flags so local modifications aren't propagated

* Use pthread_setschedparam as OSX doesn't support pthread_setschedprio
2016-06-20 10:26:51 -04:00
Marek Safar 081781dd93 [reflection] Improves 1a820fcdc0 to do vslot match as optimization only 2016-06-20 13:43:15 +02:00
Alexander Köplinger 88bf878a7f Merge pull request #3179 from gttds/patch-2
[System.Web] Fixes 50 year form authentication
2016-06-20 13:33:59 +02:00
João Matos d1d72cdfa9 Merge pull request #3184 from tritao/zip_datetime
[System.IO.Compression] Fixed Zip entries with unset last write time to return the same as .NET.
2016-06-20 12:18:12 +01:00
Alexander Köplinger 5bf6df828c [ci] Add ms-test-suite step to default test runs 2016-06-20 13:00:54 +02:00
Marek Safar 1d73474cbc Merge pull request #3183 from marek-safar/bug41874
[reflection] Properties always use name and signature hidding rules. …
2016-06-20 11:44:42 +02:00
Marek Safar b7734fb631 [System.Web] Fixes SkinID property declaration 2016-06-20 11:33:07 +02:00
Zoltan Varga 1190e15f01 [llvm] Fix the allocation of vregs for the OP_MIN/MAX opcodes. Fixes #41947. 2016-06-18 20:01:42 -04:00
Zoltan Varga 72998aa615 Revert "[llvm] Fix the allocation of vregs for the OP_MIN/MAX opcodes. Fixes #41947."
This reverts commit 4cbef26bb7.

Revert this to see if it fixes the windows build.
2016-06-18 16:16:43 -04:00
Alexander Kyte d7eaad3f48 [runtime] Don't call ExecutionEngine constructor in aot mode (#3185) 2016-06-18 13:12:15 -04:00
Zoltan Varga 1d69617204 [aot] Add support for array accessor methods for multi-dimensional arrays. Fixes #41937. 2016-06-17 20:46:26 -04:00
Zoltan Varga 4cbef26bb7 [llvm] Fix the allocation of vregs for the OP_MIN/MAX opcodes. Fixes #41947. 2016-06-17 17:26:47 -04:00
João Matos bd938a4818 [System.IO.Compression] Fixed Zip entries with unset last write time to return the same as .NET.
.NET on Windows returns a fixed date for this, replicate the same behaviour in Mono.

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

See also: https://github.com/NuGet/Home/issues/2518
2016-06-17 18:23:05 +01:00
Marek Safar 1a820fcdc0 [reflection] Properties always use name and signature hidding rules. Fixes #41874 2016-06-17 18:44:45 +02:00
Dunati 15fedcada9 Fix for x86 and amd64 continuations (#3182) 2016-06-16 19:15:14 -07:00
Dolphin Hawkins b5702212bb Fix for x86 and amd64 continuations 2016-06-16 16:55:57 -07:00
Zoltan Varga 3c9f7f0967 [aot] Fix leaking a MonoError. 2016-06-16 19:07:22 -04:00
Zoltan Varga caf57b42be [aot] Avoid asserting if loading a type fails. 2016-06-16 19:04:33 -04:00
Bernhard Urban 2243eec53b Merge pull request #3163 from alexanderkyte/fast_context_clean
[runtime] Store abremoval context statuses seperately to use memset for cleanup
2016-06-16 11:51:59 -07:00
Alexander Kyte 123aa41caf [bcl] Remove cosmetic target that always triggers a rebuild (#3180) 2016-06-16 11:51:31 -07:00
Marek Safar 4ef940ca14 Merge pull request #3175 from marek-safar/cas-cleanup
[bcl] Make mono cas opt-in features instead of opt-out for mobile pro…
2016-06-16 20:35:13 +02:00
gttds b499a3e00b [System.Web] Fixes 50 year form authentication
This fixes the bug where form authentication tickets do not expire until 50 years later.
I bumped into this bug after upgrading mono from 4.2.2 to 4.4.0

Firstly, the authentication ticket's expiry must always equal to the timeout attribute on the <forms/> element. It doesn't matter whether persistent or session cookies are used. 

Secondly, if the cookie is persistent, then it's expiry should be set to the same as that of the authentication ticket.

Reference: https://blogs.msdn.microsoft.com/dansellers/2006/02/15/change-to-asp-net-2-0-forms-authentication-persistent-cookies/
2016-06-16 23:46:21 +08:00
Marek Safar d35b5d2188 [System] Put back handling of direct ip addresses to ServicePoint::HostEntry (removed in 932359f3d6). Fixes #41782 2016-06-16 17:46:18 +02:00
Alexander Kyte f8977a0f6c [runtime] Return early so mono_value_box_checked doesn't clobber error (#3172) 2016-06-16 11:18:19 -04:00
Alexander Kyte 1796ad4200 [runtime] Store abremoval context statuses seperately to use memset for cleanup 2016-06-16 11:06:23 -04:00
Marek Safar ed989a8e9e [bcl] Make mono cas opt-in features instead of opt-out for mobile profiles 2016-06-16 14:37:55 +02:00
João Matos 934fe68aea Merge pull request #3176 from lateralusX/jlorenss/win-fix-test-dllimport-path
Update to tests config file reflecting changed libtest module location on Windows.
2016-06-16 12:14:41 +01:00
João Matos dfb71501df [System.IO.Compression] Fixed version needed to extract value in Zip central directory record entry.
This should fix some problem with Nuget archives created by Mono.

No test case for this one because it would involve writing a mini-ZIP file parser to make sure the value is written correctly (or hardcore the value offset in the generated file, which could lead to a very flakey test).

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=41775.
2016-06-16 12:12:32 +01:00
lateralusX 04b168129d Update to tests config file reflecting changed libtest module location.
Updated Visual Studio build uses a different default build location of modules
compared to previous version. The tests config file includes a relative
path to libtest used for by all pinvoke tests. Since the module is now
placed at a different location the load failed during the test.
2016-06-16 13:10:04 +02:00
Alexander Kyte b10c89c904 Merge pull request #3174 from alexanderkyte/revert_jay_relative
Revert "[runtime] Fix jay path in Microsoft.Build"
2016-06-15 18:30:52 -04:00
Alexander Kyte 2fb5ec70eb Revert "[runtime] Fix jay path in Microsoft.Build"
This reverts commit 6780bb169c.
2016-06-15 18:29:21 -04:00
Zoltan Varga fd2a124926 [llvm] Enable support for Selector.GetHandle (). Enable it for Xamarin.Mac as well. 2016-06-15 17:54:36 -04:00
Alexander Kyte c486ddc4fc Merge pull request #3173 from alexanderkyte/jay_build_path_fix
[runtime] Fix jay path in Microsoft.Build
2016-06-15 17:47:02 -04:00
Alexander Kyte 6780bb169c [runtime] Fix jay path in Microsoft.Build 2016-06-15 17:37:11 -04:00
Zoltan Varga eb34dbd0fc [llvm] Add suport for OP_OBJC_GET_SELECTOR, not enabled yet. 2016-06-15 16:05:24 -04:00
monojenkins bc6f673c13 Merge pull request #3169 from lambdageek/fix-regression-70561
[coop] Fix regression in bug-70561.cs

Match behavior of non-coop and don't set an exit code if the main method
throws an unhandled exception.
2016-06-15 16:18:42 +01:00
Alexander Kyte d2cc9be75b Merge pull request #3171 from alexanderkyte/net_4x_mdoc_fixup
[runtime] Fix inverted build check related to mcs docs
2016-06-15 10:25:28 -04:00
Alexander Kyte f17ae9e2cd [runtime] Fix inverted build check related to mcs docs 2016-06-15 10:22:50 -04:00
João Matos 611325c072 Merge pull request #2972 from lateralusX/jlorenss/vs2015-upgrade
Visual Studio project/solution upgrade and enhancement.
2016-06-15 10:56:04 +01:00
lateralusX 5adfe65a07 Fix pedump build errors due to moved source file.
Changes done in commit 2f6e404ed1 moving
pedump.c to different location cause build errors of pedump on Windows.
2016-06-15 11:08:16 +02:00
lateralusX fc9396edf2 Reverted back to use target name for library pdb files and default
naming for intermediate pdb files for exe/dll's.

All artifacts will now have the same name of their final pdb file as
the library/dll/exe target file name.

The problem with the naming turns out to be a problem in Visual Studio
when a exe/dll use the same name of its intermediate pdb files and final
pdb file. In that case the final pdb file produced by the linker will be
incorrect and not usable by the debugger. This was the reason for the initial
change, giving intermediate pdb files a different name. Moving back to the
default naming for intermediate pdb files for exe/dll's will give the same
effect (a different name) and since libraries are not affected by this
problem, libraries can use the target name for their pdb files as well.
2016-06-15 09:44:24 +02:00
lateralusX 91e96b3d7f Added new sources to Source Folder filter in libmonoutils. 2016-06-15 09:44:24 +02:00
lateralusX 69e25e0087 Disable build of boehm GC on Windows x64. 2016-06-15 09:44:24 +02:00
lateralusX 2cad193fc5 Added support to select static or dynamic c-runtime based on user property.
All projects will inherit the RuntimeLibrary from mono.props where it now
can be controlled using a user property, MONO_USE_STATIC_C_RUNTIME.
2016-06-15 09:44:24 +02:00
lateralusX 0e0002e255 Fixed .bat file to handle xcopy command not in path.
Also added support to not always replace config.h/version.h since that triggers
unnecessary rebuilds during development. New script will check if there is
an actual difference in the config.h/version.h file before doing the copy.
2016-06-15 09:44:24 +02:00
lateralusX c60a49439a Added support to split GC builds into different build folders. 2016-06-15 09:44:24 +02:00
lateralusX 106908689a Added files to corresponding filter folders (header files/source files). 2016-06-15 09:40:06 +02:00
lateralusX 6052043fd9 Fixes to default build/distribution location. 2016-06-15 09:40:06 +02:00
lateralusX 35f830a6f2 Added additional build dependecies + setting up source availabilty depending on platform. 2016-06-15 09:40:06 +02:00
lateralusX aa4f4e6962 Added support for 64 toolchain + default log level masks. 2016-06-15 09:40:06 +02:00
lateralusX d966314db5 Added regression tests as visual studio projects.
* Added regression test running mono/mini --regression [regression_tests]
* Added regression test running mono/mini --aot [regression_tests]
* Added default debugging options to run regression tests from within visual studio debugger.
* On new build system, setting up include folder if not availalble.

All changes applies to debug/release 32/64 bit.
2016-06-15 09:40:06 +02:00
lateralusX e13440bf6a Added missing include path for test projects.
On a clean system there was a missing include path for some of the embedded samples.
2016-06-15 09:40:06 +02:00
lateralusX 2ed1acdf7b Added regression test project.
* Updated vs project files to resolve winsock, winsock2 build dependecies.
* Added vs project running basic mono-mini regression tests.
2016-06-15 09:40:06 +02:00
lateralusX 3360c14f65 Added suffix to intermediate build .pdb files in order to avoid potential naming conflicts when linking. 2016-06-15 09:40:06 +02:00
lateralusX 5ffb067e88 Added support for optional target build suffix. 2016-06-15 09:40:06 +02:00
lateralusX 51870b34bd Better property manager and user macros support.
* Added support for user macros in order to set build/install/sgen.
* Added support for more arguments to bat files + support for quoted paths.
* Added support for verbose/quite output in bat files.
* Moved libmono xcopy post build step into separate bat file.
* Cleaned some sgen configs still left in vcxprojs.
2016-06-15 09:40:06 +02:00
lateralusX b1c604eee2 Separate build tree and target suffix support.
* Enabled build target suffix in order to lable a build (primarly for sgen).
* Enabled separate build tree.
* Dropped all sgen configurations, replaced by properties and target suffix.
* Fixed pdb naming of intermediate pdb files.
2016-06-15 09:40:06 +02:00
lateralusX c371f4f33c Restructured build/package/install targets and split GC libraries.
* Added package/install targets.
* Moved sgen into separate library.
* SGEN set as default GC for build (used GC controlled through mono.props).
2016-06-15 09:40:06 +02:00
lateralusX 01551beda6 Refactored VS depdencies + restructring VS solution and projects. 2016-06-15 09:40:06 +02:00
lateralusX 8938bfd232 Upgrade to vs2015 for native projects.
* Upgraded all projects to new vs2015 tool chain.
* Used mono.props through property manager instead of import.
* Fixed dependencies to be more explicitly in additional dependecies.
* Fixed error in mono.props, switched $ to % when referencing internal variables.
* Added property variables for includes and libraries, defined in mono.props.
2016-06-15 09:40:06 +02:00
Miguel de Icaza 0aa112f9dd [mkbundle] Improve error checking 2016-06-14 23:25:30 -07:00
Miguel de Icaza ab73f54d42 [main] replace computed value by a constant
The reason why mkbundle is not working is that for some reason
this constant expression is producing different code than the
-24 that it is supposed to.

What is odd is that the return value from the lseek system
call is the same, but yet, read fails with an end-of-file with
this value, and otherwise it passes.

With this call:

     lseek (fd, -(16+sizeof(uint64_t)), SEEK_END)

strace displays:

lseek(0x3, 0xFFFFFFE8, 0x2)		 = 19375512 0

With this call:

     lseek (fd, -24, SEEK_END)

strace displays:

lseek(0x3, 0xFFFFFFFFFFFFFFE8, 0x2)	 = 19375512 0

Now, while both results from lseek are the same, a subsequent read
with 24 bytes to read returns zero on the former case, and 24 on
the latter case.
2016-06-14 23:25:30 -07:00
Alexander Köplinger 3e22f8a53f [mcs] Use $(RESGEN) instead of resgen
It broke the .deb package build
2016-06-15 03:12:02 +02:00
Alexander Köplinger 5479142e8b Merge pull request #3168 from alexanderkyte/default_4_x_preset
[runtime] Make the default preset only build net_4_x
2016-06-15 01:16:49 +02:00
Aleksey Kliger 43d8951c78 [coop] Fix regression in bug-70561.cs
Match behavior of non-coop and don't set an exit code if the main method
throws an unhandled exception.
2016-06-14 19:11:19 -04:00
Alexander Kyte 1586896f99 [runtime] Make the default preset only build net_4_x 2016-06-14 19:08:31 -04:00
Alexander Kyte 65efedb894 Merge pull request #3089 from alexanderkyte/mobile_static_jenkins_script
[mobile_static] Update jenkins build script for mobile_static profile
2016-06-14 18:24:26 -04:00
Zoltan Varga 0f996d6020 [runtime] [runtime] Fix the printing of unhandled exceptions in coop. 2016-06-14 18:06:58 -04:00
Zoltan Varga d71f485af7 [runtime] Return after setting the error in mono_jit_runtime_invoke (), otherwise mono_value_box_checked () initializes it again. 2016-06-14 18:06:58 -04:00
Miguel de Icaza aff1a51a38 WIP [library.make] Make resource usage declarative in the class libraries (#3159)
[library.make] Make resource usage declarative in the class libraries
2016-06-14 13:57:09 -07:00
Zoltan Varga 6b3a592de0 [jit] Set the 'real_offset' field of bblocks in mono_replace_ins (), the EH code generator in llvm depends on it being set. 2016-06-14 15:36:44 -04:00
Alexander Köplinger ca606bbefa Merge pull request #3165 from akoeplinger/fix-clock-monotonic-macos1012
[utils] Work around CLOCK_MONOTONIC being defined on macOS 10.12 SDK despite targeting earlier releases
2016-06-14 19:08:11 +02:00
Marek Safar bc5e8fbf5c [mcs] Support System.Object forwarded to any assembly in any references order 2016-06-14 19:03:59 +02:00
Alexander Köplinger b821c8e33c [utils] Work around CLOCK_MONOTONIC being defined on macOS 10.12 SDK despite targeting earlier releases
Should fix https://bugzilla.xamarin.com/show_bug.cgi?id=41786
2016-06-14 16:39:41 +02:00
Alexander Kyte d6025dec80 Merge pull request #3162 from alexanderkyte/ignore_pkits
[mobile_static] Skip PKITS tests on mobile_static due to missing
2016-06-13 16:06:28 -04:00
Aleksey Kliger (λgeek) fdfa5d8461 [coop] Protect copy_stack_data from GCC optimizations. (#3157)
[coop] Protect copy_stack_data from GCC optimizations.

GCC 5.3.1 (Debian sid/amd64) "optimizied" the previous incarnation of
`void *stackdata_end = return_stack_ptr ()` to
`void *stackdata_end = 0`.
2016-06-13 15:58:44 -04:00
Alexander Kyte 0b3e113656 [mobile_static] Make bitcode preset enable llvm 2016-06-13 14:53:51 -04:00
Alexander Kyte 53b79e4a91 [mobile_static] Skip PKITS tests on mobile_static due to missing
fixtures
2016-06-13 14:31:40 -04:00
Bernhard Urban 06c67d8075 Merge pull request #3160 from JustArchi/patch-1
SGen: Fix parsing of default-allowance-ratio
2016-06-13 09:56:27 -07:00
Alexander Kyte 6f876c4bbc [runtime] Rename the net_4_x runtime preset to all 2016-06-13 12:16:24 -04:00
Alexander Kyte 280906915b [runtime] Keep one-off jenkins disabling in script 2016-06-13 12:16:24 -04:00
Alexander Kyte cc9a2a0379 [runtime] Allow presets to disable runtime features 2016-06-13 12:16:24 -04:00
Alexander Kyte 62898add79 [mobile_static] Update reported FX version to 4.x 2016-06-13 12:16:23 -04:00
Alexander Kyte cd81b965b8 [mobile_static] Set default value for disabling MCS docs 2016-06-13 12:16:23 -04:00
Alexander Kyte b6af11c6a9 [mobile_static] Split jenkins tests out, enable running from top level 2016-06-13 12:16:23 -04:00
Alexander Kyte 6e5479c540 [runtime] Make cooperative gc default on our bitcode profile 2016-06-13 12:16:22 -04:00
Alexander Kyte a1800e89ce [mobile_static] Use runtime_preset configuration option 2016-06-13 12:16:22 -04:00
Alexander Kyte 67ccd74036 [mobile_static] Disable NLS by default on OSX 2016-06-13 12:16:22 -04:00
Alexander Kyte 87d30ece8b [mobile_static] Added in runtime_profile autoconf flag, make set
defaults
2016-06-13 12:16:21 -04:00
Alexander Kyte b5a550bb97 [mobile_static] Make mobile_static default profile when building with it
When building a mobile_static build, we need to pass a lot of flags
which disable features. These make the net_4_x profile not build
correctly when using the official jenkins script. This helps.
2016-06-13 12:16:21 -04:00
Alexander Kyte 630bea6983 [mobile_static] Fix configure.ac handling of with_profile4_x option 2016-06-13 12:16:21 -04:00
Alexander Kyte 12b32e2334 [runtime] Specialize run-jenkins script for mobile_static when it runs 2016-06-13 12:16:20 -04:00
Aleksey Kliger (λgeek) c6f75c367a Merge pull request #3106 from lambdageek/dev/monoerror-unhandled
[runtime] Okay to raise MonoError in thread start functions.
2016-06-13 11:52:35 -04:00
Marek Safar b5dc9a4951 [System] Fixes crash during implicit file uri parsing with unicode characters 2016-06-13 17:21:51 +02:00
Alexander Köplinger 288535ce9d Merge pull request #3161 from ntherning/use_msvc_built_libtest_dll_for_runtime_tests_on_windows
Use the MSVC built libtest.dll when running the P/Invoke tests in mono/tests/ on Windows
2016-06-13 16:42:20 +02:00
Niklas Therning 0bbf9c3a73 Use the MSVC built libtest.dll when running the P/Invoke tests in mono/tests/
on Windows. Updates the tests-config.in file with Windows specific <dllmap>
elements that map 'libtest' to the MSVC built libtest.dll for the current
architecture. test-runner.cs has been modified to accept a --config option to
be able to use a specific config file. Makefile.am now configures test-
runner.exe to use the tests-config config when running the tests.
2016-06-13 10:50:19 +02:00
Łukasz Domeradzki 6ceccb40de SGen: Fix parsing of default-allowance-ratio
Parsing ```default-allowance-ratio``` in ```MONO_GC_PARAMS``` is completely broken and accepts only one value - 1.0, while it should accept range of 1.0-10.0. We can clearly notice that when setting ```default-allowance-ratio``` to e.g. ```2.0``` and trying to run any program through Mono runtime:

```
Warning: In environment variable `MONO_GC_PARAMS': `default-allowance-ratio` must be between 1.00 - 1.00. - Using default value.
```

Therefore, correct this for using proper 1.0-10.0 range.
2016-06-13 05:28:22 +02:00
Aleksey Kliger (λgeek) 81a6cf5ece [runtime] Don't raise ArgumentNullException in mono_monitor_enter_fast (#3158)
Just return that you couldn't enter the monitor and let the slow path handle it.

Fixes [#41705](https://bugzilla.xamarin.com/show_bug.cgi?id=41705)
2016-06-12 17:32:07 -04:00
Sebastien Pouliot 999ed78aa7 [System.Net.Http] Fix CFNetworkHandler.CookieContainer not to return null (#3141)
* [System.Net.Http] Fix CFNetworkHandler.CookieContainer not to return null

This aligns the handler with the managed HttpClientHandler [1] and make
it easier to switch between them without additional or conditional code.

[1] https://github.com/mono/mono/blob/14f8acced5bbb2f6d55fb3e7800382700bcc65eb/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs#L97
2016-06-11 14:21:21 -04:00
Zoltan Varga fe50acb6ff [runtime] Avoid building the tools dir when cross-compiling, some tools don't seem to compile. 2016-06-10 22:48:27 -04:00
Zoltan Varga d21e1be2b1 [amd64] Handle native types correctly in mono_arch_get_llvm_call_info (). 2016-06-10 22:48:27 -04:00
Zoltan Varga f098db9484 [jit] Add some missing opcodes to MONO_IS_SETCC. 2016-06-10 22:48:27 -04:00
Alexander Köplinger 171a69b668 Merge pull request #3152 from ntherning/use_env_configured_mono_exe_in_runtime_tests
Make mono/tests/Makefile.am use MONO_EXECUTABLE if set
2016-06-10 23:39:25 +02:00
Marek Safar 129e6c3220 [mscorlib] Better handling of unix timezones which have offset not specified in whole minutes. Fixes #41492 2016-06-10 21:53:29 +02:00
Alexander Köplinger b6b1525709 [tools] Add a few missing files to the tarball
Those turned out to be missing when building tools/ was enabled by default.
Also ignore some stuff in .gitignore
2016-06-10 21:11:03 +02:00
Aleksey Kliger (λgeek) 78e5ac0f8f [runtime] Fix MonoError lifecycle in do_try_exec_main (#3145)
The do_try_exec_main function is always called in contexts where any
exception from doing the invoke is going to be stored in the exc outarg.
That means any MonoError will be handled locally by do_try_exec_main.
So we don't need a MonoError argument, we just need an inner_error.
2016-06-10 14:59:53 -04:00
Martin Baulig aef549e364 Merge pull request #3144 from Unity-Technologies/fix-recursive-property-call
Fix recursive property call in MonoSslStreamImpl
2016-06-10 20:23:35 +02:00
Aleksey Kliger (λgeek) 8b57a81993 Merge pull request #3154 from lambdageek/fix-initmessage-linker
[linker] Add MonoMethodMessage::InitMessage to mscorlib descriptor
2016-06-10 11:54:29 -04:00
Aleksey Kliger 8799f317dd [linker] Add MonoMethodMessage::InitMessage to mscorlib descriptor
That method gets called from the runtime, it shouldn't be linked out.
2016-06-10 11:23:12 -04:00
Alexander Köplinger 0fa5f5fb4f [tests] Bump timeout in sleep.exe
We're seeing it randomly fail on Wrench with durations of 1550 - 1800ms.
Talked to Zoltan, this might be normal so bumping the timeout to reduce the failure rate.
2016-06-10 16:32:21 +02:00
Marek Safar 78bf2b6cc2 [System] Read all values of unknown/uncommon headers with multiple entries. Fixes #41552 2016-06-10 13:00:06 +02:00
Alexander Kyte b1dccbc236 [runtime] Ensure uniqueness of icall wrappers (#3143)
The llvmonly backend will use `mono_aot_init_gshared_method_this`
and other initializers to initialize methods. These will transitively call
`mono_icall_get_wrapper_full` when icall wrappers are needed.

The init functions will set the
initialized flag after initialization. They set it in a non-atomic manner. This means that
in a multithreaded environment, it's possible to call the functions
twice.

When `mono_icall_get_wrapper_full` is called without this patch, the
pointers to wrappers it gets from `mono_marshal_get_icall_wrapper`
will not have the same addresses. They will hash to the same value
though.

This will lead to them not being found or inserted by
`find_aot_method_in_amodule`.
The fact that we already have a value with this hash means that
the new wrapper doesn't get inserted. The fact that the pointers differ
mean that we don't say that we've found our desired wrapper.

This leads to an assertion in `mono_icall_get_wrapper_full`
crashing the runtime.

Since we intend to have the semantics of a wrapper for each icall,
this change uses a cache to ensure uniqueness. The observed crashes
do not happen when this change is applied.
2016-06-10 05:05:51 -04:00
Marek Safar b0fd769485 Merge pull request #3151 from akoeplinger/fix-islocal
[System] Fix HttpListenerRequestTest.HttpRequestIsLocal intermittently failing
2016-06-10 10:13:59 +02:00
Niklas Therning 68af1e0192 Modifies mono/tests/Makefile.am to pass along the value set in the
MONO_EXECUTABLE env variable to test-runner.exe using the --runtime command
line parameter. Defaults to 'mono' which is also the defult in test- runner.cs
if no --runtime argument is given.
2016-06-10 09:46:04 +02:00
Zoltan Varga 2f6e404ed1 [runtime] Move 'pedump' to tools/pedump, build tools by default. (#3133)
* [runtime] Move 'pedump' to tools/pedump, build tools by default.

* Add missing file.

* [runtime] Mark mono_opcodes[] with MONO_API.

* [runtime] Build monograph when sgen is supported instead of boehm.

* [runtime] Link monograph against the static runtime libraries.

* [runtime] Use the same SUBDIRS/DIST_SUBDIRS for the CROSS_COMPILING case.
2016-06-10 02:52:03 -04:00
Alexander Köplinger ff55074476 Merge pull request #3140 from esdrubal/syscall_details
[runtime] Fixed interruptible wapi_sendfile part2.
2016-06-10 01:48:19 +02:00
Alexander Köplinger 0178821e50 [System] Fix HttpListenerRequestTest.HttpRequestIsLocal intermittently failing
We're seeing the following exception on devices in CI:

```
[FAIL] HttpListenerRequestTest.HttpRequestIsLocal : System.Net.Sockets.SocketException : Could not resolve host 'XQA-AppleTV-1'
	  at System.Net.Dns.Error_11001 (System.String hostName) [0x00000] in /Users/builder/data/lanes/1381/d8287824/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/Dns.cs:292
	  at System.Net.Dns.GetHostByName (System.String hostName) [0x00024] in /Users/builder/data/lanes/1381/d8287824/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/Dns.cs:419
	  at System.Net.Dns.GetHostEntry (System.String hostNameOrAddress) [0x00061] in /Users/builder/data/lanes/1381/d8287824/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/Dns.cs:380
	  at System.Net.Dns.GetHostAddresses (System.String hostNameOrAddress) [0x00065] in /Users/builder/data/lanes/1381/d8287824/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/Dns.cs:406
	  at MonoTests.System.Net.HttpListenerRequestTest.HttpRequestIsLocal () [0x00006] in /Users/xamarinqa/QABot/data/lanes/2441/d8287824/source/xamarin-macios/external/mono/mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs:197
	  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
	  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/data/lanes/1381/d8287824/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:309
```

From looking at the code, resolving the hostname to IP addresses via DNS fails so the test doesn't even run.
We don't care where the local IPs come from so we can use an alternative way of getting them - via querying the network interfaces.

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

PS: fixed a hardcoded port while I was touching the code
2016-06-10 01:39:14 +02:00
monojenkins cadf391bea Merge pull request #2921 from lewurm/lower-typechecks-later
[mini] lower typechecks later

lower typecheck instructions later in the compilation, so we've a chance to do high-level optimization after `method-to-ir`
2016-06-10 00:05:15 +01:00
monojenkins 59ec6fd3d6 Merge pull request #3121 from lambdageek/dev/managed-init_message
Rewriite `MonoMethodMessage::InitMessage` in managed code

Change icall
`System.Runtime.Remoting.Messaging/MonoMethodMessage::InitMessage` to
managed code.

Also update `mono_message_init()` to invoke `InitMessage`.
2016-06-09 23:15:10 +01:00
Rodrigo Kumpera 10fb3e1955 [sgen] Inform on configure and --version when the concurrent GC is the default. 2016-06-09 13:39:53 -07:00
Bernhard Urban 4b094daa6a [mini] execute decompose_typechecks only if there's a typecheck operation 2016-06-09 13:32:36 -07:00
Bernhard Urban a13370db72 [mini] comment about empty BBs for graph visualization 2016-06-09 13:32:36 -07:00
Bernhard Urban 0340dfb1ec [mini] do decomposition of typechecks later in the compilation pipeline 2016-06-09 13:32:36 -07:00
Bernhard Urban 9cd83a3c06 [method-to-ir] get rid of additional reg introduced for isinst and castclass 2016-06-09 13:32:36 -07:00
Bernhard Urban 82b0502f7c [mini] add time tracking for decompose_typechecks pass 2016-06-09 13:32:36 -07:00
Bernhard Urban 31db83596d [mini] decompose isinst and castclass in a later pass 2016-06-09 13:32:36 -07:00
Bernhard Urban 0975b0d13b [cfgdump] insert NOP in empty basic blocks in order to not confuse graph dumper 2016-06-09 13:32:36 -07:00
Bernhard Urban 70b42fc580 [debug] print class name for OP_{isinst,castclass} 2016-06-09 13:32:36 -07:00
Bernhard Urban 7ab1f37abb [mini] introduce OP_{isinst,castclass} 2016-06-09 13:32:36 -07:00
Vlad Brezae b2cf7bbf84 Merge pull request #3136 from BrzVlad/fix-stw-stopped
[sgen] Don't try to stop a stopped world
2016-06-09 23:13:56 +03:00
Aleksey Kliger 5a7f490680 [runtime] Switch mono_message_init to invoke managed
Invoke the managed
System.Runtime.Remoting.Messaging.MonoMethodMessage::InitMessage method.
2016-06-09 14:52:52 -04:00
Aleksey Kliger 83f3716119 [corlib] Implement MonoMethodMessage::InitMessage in managed
Change icall
System.Runtime.Remoting.Messaging/MonoMethodMessage::InitMessage to
managed code.
2016-06-09 14:52:52 -04:00
Alex Rønne Petersen d43ea3ac56 Merge pull request #3127 from alexrp/arm32-on-arm64
[arm] Correctly detect hardware features when running as arm32 on arm64 hardware.
2016-06-09 20:29:31 +02:00
Bernhard Urban 95e805c52a Merge pull request #3137 from BrzVlad/fix-sgen-critical-region
[sgen] Exit the critical section also on the slowpath of managed allocators
2016-06-09 10:31:49 -07:00
monojenkins 68be3904cf Merge pull request #3142 from henricm/fix-for-win-mono_string_to_utf8
Using mono_marshal_free n mono_string_builder_to_utf8

`mono_string_builder_to_utf16` is allocating using `mono_marshal_alloc` which, on windows, allocates memory using `CoTaskMemAlloc`. This buffer was then released in `mono_string_builder_to_utf8` using `g_free` which resulted in a crash since that's a different memory on windows. The fix in this PR makes sure `mono_marshal_free` is called instead which has the correct behaviour and results in a `CoTaskMemFree` on windows.
2016-06-09 17:55:12 +01:00
Marek Safar 0f93f3f98d [mcs] Add probing conversion for FormattableString. Fixes #41575 2016-06-09 17:55:19 +02:00
Mike Voorhees ef0c4d2c1b Fix recursive property call in MonoSslStreamImpl 2016-06-09 10:50:37 -04:00
Johan Lorensson 14f8acced5 Merge pull request #3085 from lateralusX/jlorenss/win-x64-pinvoke-empty-struct
Fix for non GCC win x64 calling convention when passing empty structs over pinvoke.
2016-06-09 15:49:33 +02:00
Henric Müller 18c8694c0d Making sure mono_marshal_free is used instead of g_free in mono_string_builder_to_utf8 2016-06-09 15:40:30 +02:00
monojenkins 975fc21341 Merge pull request #3139 from akoeplinger/dns-test
[System] Make ServicePointTest.DnsRefreshTimeout test more reliable

We are still seeing quite rare failures of this test:

```
HostEntry should result in the same IPHostEntry object.
  Expected: same as <System.Net.IPHostEntry>
  But was:  <System.Net.IPHostEntry>

+++++++++++++++++++
STACK TRACE:
at MonoTests.System.Net.ServicePointTest.DnsRefreshTimeout () [0x00045] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System/Test/System.Net/ServicePointTest.cs:228
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/corlib/System.Reflection/MonoMethod.cs:309
```

Since the test is only checking if expiring of the cached DNS lookup works, we don't really need to use an external domain name for this as "localhost" works just fine as well and typically doesn't trigger a DNS query which makes the test more reliable against network issues.

@monojenkins merge
2016-06-09 14:35:12 +01:00
Marek Safar 19880afc7a [mcs] Recognize indexer with accessors using different names. Fixes #41602 2016-06-09 14:59:49 +02:00
Marcos Henrich fff8e4e1c5 [runtime] Fixed interruptible wapi_sendfile part2.
Fixed issue where underlying system without HAVE_SENDFILE
would not interrupt while sending a file even when the socket was
set as a non blocking one.
2016-06-09 12:42:15 +01:00
Alexander Köplinger ea4ad81185 [System] Make ServicePointTest.DnsRefreshTimeout test more reliable
We are still seeing quite rare failures of this test:

```
HostEntry should result in the same IPHostEntry object.
  Expected: same as <System.Net.IPHostEntry>
  But was:  <System.Net.IPHostEntry>

+++++++++++++++++++
STACK TRACE:
at MonoTests.System.Net.ServicePointTest.DnsRefreshTimeout () [0x00045] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System/Test/System.Net/ServicePointTest.cs:228
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/corlib/System.Reflection/MonoMethod.cs:309
```

Since the test is only checking if expiring of the cached DNS lookup works, we don't really need to use an external domain name for this
as "localhost" works just fine as well and typically doesn't trigger a DNS query which makes the test more reliable against network issues.
2016-06-09 13:24:13 +02:00
Alexander Köplinger 2774428b2d Merge pull request #3138 from akoeplinger/fix-win
[metadata] Fix Windows gcc build break
2016-06-09 11:52:05 +02:00
Marek Safar 4021e61ab1 [mcs] Bump ikvm to fix assembly unification rules 2016-06-09 10:30:40 +02:00
Alex Rønne Petersen 738521b8cf [arm] Correctly detect hardware features when running as arm32 on arm64 hardware. 2016-06-09 07:22:57 +02:00
Alexander Köplinger 13f87866a9 [metadata] Fix Windows gcc build break
After 680fe21e69 it failed with:

```
coree.c: In function '_CorExeMain':
coree.c:200:2: error: implicit declaration of function 'mono_runtime_run_main_checked' [-Werror=implicit-function-declaration]
  mono_runtime_run_main_checked (method, argc, argv, &error);
  ^
[...]
Makefile:2137: recipe for target 'libmonoruntime_la-coree.lo' failed
make[3]: *** [libmonoruntime_la-coree.lo] Error 1
```
2016-06-09 02:53:48 +02:00
Mark Probst 37bb54b503 [sgen] Scatterplot option for gcpauseviz. 2016-06-08 16:03:14 -07:00
Vlad Brezae eaa2627cf5 [sgen] Exit the critical section also on the slowpath of managed allocators
We were not exiting the critical section on this code path. This was leading to hangs at stw since the native code would take locks when compiling the code.
2016-06-09 01:50:51 +03:00
Vlad Brezae b136605a73 [sgen] Don't try to stop a stopped world
On domain unload we were calling sgen_perform_collection even though we had a stopped world, when finishing a running concurrent collection.
2016-06-09 01:49:16 +03:00
Rodrigo Kumpera 916fb1aa3e Merge pull request #3135 from kumpera/enable_conc_gc_on_mainline_archs
[jenkins] Make the concurrent GC the default on mainline archtectures.
2016-06-08 15:33:27 -07:00
Rodrigo Kumpera a0866bdd34 [jenkins] Make the concurrent GC the default on mainline archtectures. 2016-06-08 15:12:47 -07:00
Alexander Köplinger d74cf1d5dc Merge pull request #3090 from alexanderkyte/remove_deprecated_assertions
[mobile_static] Remove deprecated assertions
2016-06-08 23:04:00 +02:00
Rolf Bjarne Kvinge 627fe81dc1 [corlib] Fix tests for watchOS. (#3131) 2016-06-08 16:46:11 -04:00
Alexander Kyte 87ede5a9b6 [mobile_static] Give libmono{sgen,boehm} the platform ldflags 2016-06-08 15:45:57 -04:00
Zoltan Varga 0652b7069c [llvm] Enable support for the atomic store intrinsics when running with llvmonly. 2016-06-08 14:58:15 -04:00
Alex Rønne Petersen 91734968b8 Merge pull request #3117 from alexrp/master
Fix a few socket test failures on Android
2016-06-08 18:04:48 +02:00
Aleksey Kliger dae1630a21 [runtime] Okay to raise MonoError in thread start functions.
They just trigger the unhandled exception handlers.
2016-06-08 10:55:14 -04:00
Aleksey Kliger (λgeek) 4cf9ffd6cf Merge pull request #3093 from lambdageek/dev/monoerror-exec
[runtime] Mark mono_runtime_{run,exec}_main external only.
2016-06-08 10:35:46 -04:00
Alex Rønne Petersen 57e8af467a [sockets] Correctly report that Linux supports double binding for UDP, even on old kernels. 2016-06-08 15:40:12 +02:00
Marek Safar 7800c71e39 [mcs] Improve betterness changes in b12385e9fd 2016-06-08 15:26:32 +02:00
Marek Safar fed1f25cab [System] Fixes compiler warning 2016-06-08 15:26:31 +02:00
Alex Rønne Petersen 5893ae1883 [System] Make SocketAsyncTest.SendAsync give more helpful failures. 2016-06-08 15:04:18 +02:00
Alexander Köplinger d3c2d9c5f4 [build] Add llvm folder to SUBDIRS/DIST_SUBDIRS
This ensures all the right files are packaged in the tarball.
2016-06-08 14:05:50 +02:00
Alexander Köplinger 7b20c1b851 Merge pull request #3122 from akoeplinger/fix-41530
[System] Make TimerTest.EnabledInElapsed more reliable
2016-06-08 12:47:41 +02:00
Marcos Henrich 02f5cd35f2 Merge pull request #3120 from esdrubal/syscall_details
Fixes SendAsyncFile flaky failures
2016-06-08 09:03:20 +01:00
Zoltan Varga 5df50b299a [runtime] Only print out the value of MONO_EXTRA_CONFIGURE_FLAGS when it is set. 2016-06-08 03:05:16 -04:00
Rodrigo Kumpera 28b0808a7c Merge pull request #3118 from kumpera/fix_getname
[corlib] Handle user Assembly subclass and Assembly::GetName.
2016-06-07 17:22:55 -07:00
Alexander Köplinger bab393e095 [System] Make TimerTest.EnabledInElapsed more reliable
We were seeing intermittent failures on devices like:

```
	[FAIL] TimerTest.EnabledInElapsed :   #1 loss of events
  Expected: True
  But was:  False

		  at MonoTests.System.Timers.TimerTest.EnabledInElapsed () <0x33b168 + 0x0014f> in <filename unknown>:0
		  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
		  at System.Reflection.MonoMethod.Invoke (System.Object , BindingFlags , System.Reflection.Binder , System.Object[] , System.Globalization.CultureInfo ) <0x66d400 + 0x000b7> in <filename unknown>:0
```

Since OS scheduling and GCs can influence the exact timing of the timer intervals sleeping for 200ms is likely just too short.
Instead of bumping the timeout, I decided to rewrite the test to not rely on Thread.Sleep ().
I also added another test which verifies setting AutoResetEvent=false stops the timer event from firing after the first one,
which was implicitly tested before by the other test.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=41530
2016-06-08 01:52:59 +02:00
Rodrigo Kumpera 968540b28b Merge pull request #3114 from alexanderkyte/mono_conf_gc
[runtime] Add configuration for the default sgen gc mode
2016-06-07 15:44:03 -07:00
Alexander Köplinger cd12b91372 Merge pull request #3112 from akoeplinger/test-runner-nofile
[test-runner] Write stdout/stderr into StringBuilder instead of an intermediate file
2016-06-08 00:18:39 +02:00
Miguel de Icaza 842da704cc More updates 2016-06-07 17:53:46 -04:00
Rodrigo Kumpera 36116e1de4 [corlib] Handle user Assembly subclass and Assembly::GetName.
Remove UnprotectedGetName and replace with overriding of GetName.

dotnet throws NIE if you subclass Assembly and call GetName on it.
We hard crashed.
2016-06-07 14:12:39 -07:00
Alexander Köplinger 9e7182c7d6 Fix make dist
It got broken when the versions.py file was moved around in d110f52670.
Also add the new locations to EXTRA_DIST so they get distributed too.
2016-06-07 22:44:54 +02:00
Rodrigo Kumpera 19daae6f46 Merge pull request #3119 from kumpera/fix-getname-and-shadowcopy
[corlib] Take shadow copying when computing CodeBase in Assembly::GetName.
2016-06-07 12:51:27 -07:00
Aleksey Kliger (λgeek) 022ebf4501 Merge pull request #3082 from alexanderkyte/no_alloc_klass_error
[runtime] Set klass-error-based MonoError state without allocating
2016-06-07 15:23:17 -04:00
Alexander Kyte e5ccb30a0c [mobile_status] Fix nullable type ambiguity that nunit-lite complains about 2016-06-07 14:56:52 -04:00
Alexander Kyte cd9dfae952 [mobile_static] Remove use of CollectionAssert, missing in nunit-lite 2016-06-07 14:56:51 -04:00
Alexander Kyte ac19ad8a47 [mobile_static] Remove uses of deprecated Assertion.cs nunit helper. 2016-06-07 14:56:51 -04:00
Rodrigo Kumpera 028fe45243 Merge pull request #3110 from BrzVlad/fix-complex-conc-scan
[sgen] Fix concurrent scan of complex objects
2016-06-07 11:38:27 -07:00
Alex Rønne Petersen 4d9acdafed [Socket] Check for SocketOptionLevel.Socket before checking for SocketOptionName.ReuseAddress.
Without doing this, the check would consider a valid option name like
IpTimeToLive to be the same as ReuseAddress, as they share the same enum
value.

Fixes SocketTest.TtlChange and SocketTest.UdpMulticasTimeToLive on Android and
other platforms that don't support ReuseAddress.
2016-06-07 20:21:00 +02:00
Alexander Köplinger 5c1615a27d Merge pull request #3124 from mono/revert-2734-master
Revert "Enhance log tracing"
2016-06-07 18:45:29 +02:00
Alexander Köplinger 565c6ac080 Revert "Enhance log tracing" 2016-06-07 18:45:09 +02:00
Alexander Kyte 16c5c2e6ed [runtime] Add environment variable to pass additional configure options 2016-06-07 12:29:39 -04:00
Alexander Kyte c0d56727c8 [runtime] Add new configure option for default sgen GC mode 2016-06-07 12:29:23 -04:00
Zoltan Varga 41784378fb [amd64] Fix an off-by-one in the dyn call code. 2016-06-07 12:17:08 -04:00
Zoltan Varga d110f52670 Llvm submodule (#3108)
* Move the versions.mk infrastructure to scripts/submodules so it can be used elsewhere too.

* Add a conditional submodule for llvm.

* Fix commit messages emitted by the bump- targets.

* Use a anonymous git url for llvm.
2016-06-07 10:46:33 -04:00
Marcos Henrich 11743177c7 [runtime] Fixed interruptible wapi_sendfile.
Before closing a socket we try to interrupt and wait for all socket
pending system calls to return. For that we set the socket as non
blocking which makes the system calls to return with EAGAIN\EWOULDBLOCK.

This issue was caught by System.Net.Sockets.SocketTest.SendAsyncFile
that was intermittently failing, we were only able to reproduce it while
running multiple test suites in parallel. We now can say that it only failed when
the the socket was closed and the sendfile was waiting for the OS to
allocate enough resources to send the file.

This was fixed by changing wapi_sendfile to return on EAGAIN.
2016-06-07 14:25:04 +01:00
Marcos Henrich 91c68de23f [System] Improved "Could not abort" exception.
Stack traces of blocked threads are now displayed on the exception.

The threads stacktraces are only stored when MONO_TESTS_IN_PROGRESS env
var is set to yes.
2016-06-07 14:01:00 +01:00
Alexander Kyte 07bb23a4d4 [runtime][mobile_static] Add flag for rgctx_fetch_trampolines and use it (#3088)
* [runtime] Add commandline option for rgctx fetch trampolines.

* [mobile_static] Increase the number of trampolines
2016-06-07 07:44:40 -04:00
lateralusX aaf8b8dbbf Smaller adjustments based on PR feedback. 2016-06-07 11:35:02 +02:00
Zoltan Varga 97634ecfae [runtime] Call mono_class_init () for classes in mono_class_is_subclass_of (). Fixes #41466. 2016-06-07 04:08:46 -04:00
Rodrigo Kumpera 72f2128755 [corlib] Take shadow copying when computing CodeBase in Assembly::GetName. 2016-06-06 23:36:32 -07:00
Alex Rønne Petersen 614e1a10e6 Merge pull request #3116 from alexrp/master
Some improvements to the profiler makefile
2016-06-07 03:35:36 +02:00
Mark Probst 326caca175 [sgen] Make gcpauseviz histograms more meaningful.
There were too many bins, because the x axis was not logarithmic, and
there were no meaningful labels.
2016-06-06 16:36:38 -07:00
Mark Probst 34c779eed0 [sgen] Fix gcpauseviz.
It didn't detect starts of concurrent collections anymore because of how
the binary protocol outputs it.
2016-06-06 16:36:38 -07:00
Alex Rønne Petersen c5a914bcbc [profiler] Don't install the coverage suppression file if the profiler is disabled. 2016-06-07 00:49:04 +02:00
Alex Rønne Petersen fa8cfb0254 [profiler] Don't run the test suite when the profiler is disabled.
Also clean up the makefile logic surrounding tests a bit.
2016-06-07 00:44:58 +02:00
Alexander Köplinger a5beea4126 Merge pull request #3113 from akoeplinger/boehm-fixes
[ci] Turn off Boehm on Windows x64 gcc build
2016-06-06 23:44:35 +02:00
Zoltan Varga 1197df8e64 [offsets-tool] Generate offsets for SgenClientThreadInfo. 2016-06-06 16:48:02 -04:00
Vlad Brezae b940b99c81 [sgen] Fix define argument
The code worked by accident because the function in which the define was expanded had an argument with the name desc.
2016-06-06 23:32:14 +03:00
Vlad Brezae feeda9992c [sgen] Fix race between complex descriptor allocation and complex object scanning
When we allocate the complex descriptor for a new type we might have the concurrent marker scan objects. While the concurrent marker scans the bitmap for a complex object, which resides in the complex_descriptor array, another thread might allocate a new complex descriptor, thus reallocate the complex_descriptor array, which would lead to corruption of the bitmap used by the concurrent marker.

We reuse the SgenArrayList which never reallocates, using instead a list of exponentially increasing arrays.
2016-06-06 23:32:12 +03:00
Alexander Köplinger 6e1443d029 Only define Boehm variables in configure.ac when it is enabled
Fix the message that is printed in the configure summary at the end to contain only "sgen" when Boehm is disabled.
2016-06-06 21:18:45 +02:00
Alexander Köplinger 1311dd46a8 [ci] Turn off Boehm on Windows x64 gcc build
It was never supported there, turn it off to fix the build on Jenkins.
2016-06-06 21:07:07 +02:00
Zoltan Varga d631febd56 [amd64] Fix a loop variable reuse in a58c2ef804. 2016-06-06 15:04:11 -04:00
Aleksey Kliger (λgeek) 150cd3f9f1 Merge pull request #3100 from lambdageek/dev/monoerror-exns
[runtime] Pass MonoError to exception creation utilities
2016-06-06 14:39:05 -04:00
Vlad Brezae 248ef6ea73 [sgen] Make sure we will scan the bits correctly for complex objects 2016-06-06 21:07:21 +03:00
Vlad Brezae c9d37d3686 [sgen] Add missing memory type description 2016-06-06 21:07:20 +03:00
Aleksey Kliger (λgeek) 395888e241 Merge pull request #3104 from lambdageek/dev/monoerror-resolve_vcall
[llvm] Raise MonoError using mono_llvm_throw_exception
2016-06-06 14:01:44 -04:00
Zoltan Varga 5092923485 [jit] Fix the emission of Selector.GetHandle () implementation to avoid the creation of string objects, which could cause GCs don't work in a cross compiler. Fixes #41431. 2016-06-06 13:22:18 -04:00
Alexander Köplinger 0d88c053bf [test-runner] Write stdout/stderr into StringBuilder instead of an intermediate file
We don't need to write out and then read back in the contents. Additionally, this will prevent
an unhandled exception we've seen on Jenkins due:

```
Unhandled Exception:
System.IO.IOException: Sharing violation on path /media/ssd/jenkins/workspace/test-mono-mainline-linux/label/debian-8-arm64/mono/tests/finalizer-wait.exe.stdout
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) <0x7f7eb4a740 + 0x00650> in <filename unknown>:0
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) <0x7f7eb4a620 + 0x00053> in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize, System.Boolean checkHost) <0x7f7e9b2170 + 0x000f3> in <filename unknown>:0
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize) <0x7f7e9b2120 + 0x00037> in <filename unknown>:0
  at System.IO.StreamReader..ctor (System.String path, System.Boolean detectEncodingFromByteOrderMarks) <0x7f7e9b2040 + 0x0003b> in <filename unknown>:0
  at System.IO.StreamReader..ctor (System.String path) <0x7f7e9b2010 + 0x0001f> in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string)
  at System.IO.File.ReadAllText (System.String path) <0x7f7eb48c70 + 0x0003b> in <filename unknown>:0
  at TestRunner.DumpPseudoTrace (System.String filename) <0x7f7cfc6450 + 0x00023> in <filename unknown>:0
  at TestRunner.Main (System.String[] args) <0x7f8128b770 + 0x01ed3> in <filename unknown>:0
```
2016-06-06 18:09:14 +02:00
Alexander Köplinger 6c74957217 [test-runner] Print timeout value when test times out
This is useful when multiple timeouts are in place e.g. like in the runtime testsuite.
2016-06-06 18:06:06 +02:00
Marek Safar 5ed50ba7e3 Merge pull request #3111 from directhex/sed-before-sign
Move call to sn.exe to *after* cil-stringreplacer.exe
2016-06-06 18:01:19 +02:00
Aleksey Kliger (λgeek) 883a0ae745 Merge pull request #2734 from nealef/master
Enhance log tracing
2016-06-06 12:00:47 -04:00
Jo Shields 439f0bea1f Move call to sn.exe to *after* cil-stringreplacer.exe
This makes sure mscorlib.dll still has a valid signature (fixes nightly builds on Linux)
2016-06-06 16:57:24 +01:00
Rodrigo Kumpera 02e48b67ba Merge pull request #3070 from kumpera/runtime-handles
Local handles initial drop
2016-06-06 08:42:34 -07:00
Rodrigo Kumpera 60f85567e2 Merge pull request #3083 from alexrp/gc-pointless-memory-barrier
[sgen] Remove a pointless memory barrier from the middle of the managed allocator.
2016-06-06 08:37:39 -07:00
Marek Safar 88217fa1ad [System] Override SupportsHeaders in all WebResponse overrides 2016-06-06 16:59:33 +02:00
Zoltan Varga 43914d3d0f [amd64] Enable dyncall tests on amd64. 2016-06-06 09:52:28 -04:00
Zoltan Varga a58c2ef804 [amd64] Support stack args in dyn calls. 2016-06-06 09:50:31 -04:00
Zoltan Varga e54b75c074 [amd64] Handle ArgValuetypeAddrInIReg in dyncalls. 2016-06-06 07:39:36 -04:00
Aleksey Kliger (λgeek) 42975530c3 [mini] Set pending MonoError in mono_vcall_trampoline (#3107) 2016-06-04 05:02:48 -04:00
Rodrigo Kumpera 5286dfc857 Remove unused header. 2016-06-03 14:29:23 -07:00
Rodrigo Kumpera ea865faee1 [coop] New local handles implementation.
This is the initial code drop of a new handles implementation.

It differs from the previous one is a few ways:

- It keeps a separate stack of handles which is shared by all "arenas".
This eliminates malloc in the majority of the cases without the need for any tuning

- Custom gc scanning code for the handles stack.
The original implementation registered the chunks as a GC roots. Which is a terribly
slow operation as it takes the GC lock.

Instead of allocating a new handle arena for each icall, we compute a stack mark,
which is the position in the handles stack at icall entry. On exit, we simply restore that
position, which is just a couple of stores.

Since the stack is implemented using arraylets, addressed are stable in the face of
expansion.

Only the typed handles function/macros are in as having both typed and untyped handles
adds extra complexity for no clear value.

The macros only handle what was needed to port a sizeable chunk of locales.c.

This commit just sets the stage for the feature, there's quite some work left
before we can start using it, as it can be seen in the big TODO in handle.c
2016-06-03 14:28:05 -07:00
Rodrigo Kumpera e81430a7d6 [sgen] Fix scan thread data job to set ops so it can do precise scanning. 2016-06-03 13:05:47 -07:00
Rodrigo Kumpera 3da98be66a [mono-error] Fix error_init macro to work with MonoError pointers. 2016-06-03 13:05:47 -07:00
Aleksey Kliger 7fe8716cc9 [llvm] Propagate MonoError out of mini_resolve_imt_method
To the enclosing llvm jit icalls
2016-06-03 15:00:00 -04:00
Neale Ferguson e29996786e Use %Y-%m-%d %H:%M:%S for Windows log message header 2016-06-03 13:33:23 -04:00
Andi McClure 28d9e844c0 Merge pull request #3040 from xmcclure/debugger-step-recursive
Debugger stepping does not understand recursion (bug 38025)
2016-06-03 13:08:23 -04:00
Miguel de Icaza 638f79df43 [genproj] Update project files 2016-06-03 12:42:16 -04:00
Aleksey Kliger 7a1baa941d [jit] Pass MonoError to resolve_vcall 2016-06-03 12:38:58 -04:00
Marek Safar 9fd9c7c851 [System] Flush few colliding changes 2016-06-03 18:04:33 +02:00
Alexander Kyte 356d3c3e25 [runtime] Use new mono_error_set_for_class_failure where applicable.
We were seeing an issue where attempts to create the MonoClass for an
exception in a no-exec context was causing failure. No-exec will forbid
the constructor call. Our solution was to realize that there was no
need to allocate an exception, as MonoError could already encode the
errors.
2016-06-03 11:24:33 -04:00
Alexander Kyte 7a29fbf203 [runtime] Make helper to set MonoError directly from MonoClass error 2016-06-03 11:24:32 -04:00
Neale Ferguson c41ea7babe Correct typo 2016-06-03 10:56:34 -04:00
Neale Ferguson 9100c240c5 Correct for widechar on Windows 2016-06-03 10:34:35 -04:00
Marek Safar 4a2bb8c261 [mcs] Fixes NRE during error reporting 2016-06-03 16:21:46 +02:00
Marek Safar 4ee86125fb [System] Remove duplicate file entry 2016-06-03 16:21:46 +02:00
Neale Ferguson b5ec75b264 Several corrections thanks to Johan Lorensson 2016-06-03 09:57:11 -04:00
Alexander Köplinger 6277093677 [WinForms] Fix build broken by 5d54803af7 2016-06-03 15:13:57 +02:00
Jonathan Chambers fbe5fc6e2a Correcty initialize image ref_count. Ensures image is correctly unloaded during appdomain unload. (#3084) 2016-06-03 09:13:41 -04:00
Marek Safar ef82a75735 Merge pull request #3102 from alexrp/master
[System] Add back IWebProxyScript to the mobile profile.
2016-06-03 11:04:40 +02:00
Alex Rønne Petersen eb1072dc1c [System] Add back IWebProxyScript to the mobile profile. 2016-06-03 10:09:00 +02:00
Jiří Volejník 5d54803af7 SWF - Fixed exiting modal runloop. (#2980)
Fixes a bug in exiting modal runloop that caused not really exiting it
(not calling XplatUI.SetModal(..., false).

It caused issues with menu, for example, if you first ran a modal
dialog (a wizard), and then you started the application.
2016-06-03 03:09:24 -04:00
Marek Safar 4f252f1492 Merge pull request #3099 from marek-safar/rs-Semaphore
[System] Semaphore from referencesource
2016-06-03 08:23:12 +02:00
Alexander Kyte 27e1646959 [mobile_static] Removed use of StringAssert nunit helper. 2016-06-02 19:49:45 -04:00
Ludovic Henry bea97b9d05 [sgen] Use raw mutex for pin_queue_mutex as it's only used during a collection 2016-06-02 23:25:31 +02:00
Ludovic Henry d462b209dd [coop] Reuse local info variable for polling
This would lead to a crash when unregistering the thread from the currnt MonoThreadInfo* destructor, as `mono_thread_info_current_unchecked` would return NULL. This would trigger an infinite loop in `mono_threads_enter_gc_safe_region_unbalanced_with_info`.
2016-06-02 23:25:31 +02:00
Ludovic Henry 5ce106b096 [marshal] Fix unused variable warning 2016-06-02 23:25:31 +02:00
Ludovic Henry d5cf286306 [threads] Make mono_thread_detach_if_exiting return if it detached 2016-06-02 23:25:31 +02:00
Ludovic Henry 12e53bcd36 [coop] Use mono_thread_info_is_current in checked build 2016-06-02 23:25:31 +02:00
Ludovic Henry 299f33e9b9 [coop] Remove unecessary assertion 2016-06-02 23:25:31 +02:00
Ludovic Henry fa65f20cb6 [coop] Switch to GC unsafe state in SIGILL signal handler as it may throw an exception 2016-06-02 23:25:31 +02:00
Ludovic Henry f303f385fc [runtine] We should always ignore SIGPIPE signal 2016-06-02 23:25:31 +02:00
Ludovic Henry b89cb4c62d [coop] Ensure GC unsafe state when throwing exception 2016-06-02 23:25:31 +02:00
Ludovic Henry e5f46c5360 [coop] Switch to GC safe around pthread_join 2016-06-02 23:25:31 +02:00
Ludovic Henry f90ff09854 [coop] Do not pass current thread to mono_threads_enter_gc_unsafe_region_cookie 2016-06-02 23:25:31 +02:00
Ludovic Henry c847599f8b [coop] Fix state transition when unregistering the thread
unregister_thread is the destructor for the current MonoThreadInfo* TLS key, meaning that when in this function, calling mono_thread_info_current_unchecked will always return NULL.
2016-06-02 23:25:31 +02:00
Ludovic Henry e53d878fb1 [coop] Make GC safe/unsafe unbalanced transitions public
This is needed by Xamarin.iOS for unbalanced transitions, for example aroung a ObjC @throw.
2016-06-02 23:25:31 +02:00
Ludovic Henry ab7f366947 [coop] Do not include mono-threads-coop.h and mono-threads-api.h in mono-threads.h
This leads to circular dependency between them, while mono-threads.h does not depends on the other 2.
2016-06-02 23:25:31 +02:00
Ludovic Henry d015b99f51 [coop] Do not allow transition on not-attached, not-current and not-live thread 2016-06-02 23:25:31 +02:00
Ludovic Henry 22eb4a02c7 [coop] Remove unecessary GC unsafe transition 2016-06-02 23:25:31 +02:00
Ludovic Henry f3a4be103b [marshal] Fix setting of last error for P/Invoke
On Unix, errno value might change between the native call and the call to mono_marshal_set_last_error, if we exit the gc safe region. We need to ensure that it's done right after the native call.
2016-06-02 23:25:31 +02:00
Ludovic Henry d07f4ec67b [checked-build] Fix warning 2016-06-02 23:25:31 +02:00
Ludovic Henry 5c16034406 [coop] Remove DoneBlockingAborted state transition
This state transition would only be possible in case something went wrong. It's better to fix where this issue comes from.
2016-06-02 23:25:31 +02:00
monojenkins f1dd6fe748 Merge pull request #2881 from alexrp/gc-sample-managed-alloc
[gc] Register a critical region when executing managed allocators.

Previously, if we stopped a thread and it had a stack looking like this:

    ...
    profiler_signal_handler
    <signal handler called>
    managed_allocator
    ...

We would fail to identify the fact that we've just interrupted a thread that's
in a managed allocator (uninterruptible code) because we only look at the very
latest instruction pointer of the thread, which will be pointing into
profiler_signal_handler or some other function called by it. So we would
happily continue along with the STW process and proceed to doing the actual GC,
where we would see a broken heap.

We could solve this by unwinding the stack and checking all frames, but that's
complicated and error-prone. Instead, register a critical region while the
managed allocator runs. This way, if we don't identify it by instruction pointer, we
will identify it by the fact that the thread is in a critical region.
2016-06-02 21:45:26 +01:00
Alexander Köplinger b2cf10659d Merge pull request #3066 from alexanderkyte/pedump_sgen
[runtime] Replace pedump boehm dependency with sgen dependency
2016-06-02 22:00:38 +02:00
Aleksey Kliger 1a3d55d848 [runtime] Mark mono_exception_from_token_two_strings external only
Runtime should use mono_exception_from_token_two_strings_checked
2016-06-02 15:56:02 -04:00
Aleksey Kliger aa0c3ca98f [runtime] Mark mono_exception_from_name_two_strings external only.
Runtime should use mono_exception_from_name_two_strings_checked
2016-06-02 15:56:02 -04:00
Marek Safar e76193b5b2 [System] Semaphore from referencesource 2016-06-02 21:33:22 +02:00
Neale Ferguson 583d1a2580 Correct use of localtime() in Win32 2016-06-02 15:33:12 -04:00
Neale Ferguson 927a3d1cff Use localtime for Win32 and localtime_r for others 2016-06-02 14:40:05 -04:00
Neale Ferguson b7ba3d54bd Correct syntax error and G_LOG_xxx identifier 2016-06-02 14:09:26 -04:00
Neale Ferguson c53c93791f Correct use of Windows APIs 2016-06-02 13:40:15 -04:00
Neale Ferguson 6db4cc54f0 Use correct APIs for Windows; Remove sys/time.h 2016-06-02 13:14:56 -04:00
Neale Ferguson c5327b6a02 Correct conditional compilation & move logger source files to correct place 2016-06-02 11:59:45 -04:00
Aleksey Kliger 680fe21e69 [runtime] Mark mono_runtime_run_main external only.
Runtime should use mono_runtime_run_main_checked or mono_runtime_try_run_main
2016-06-02 10:42:46 -04:00
Aleksey Kliger 985a6bb043 [runtime] Mark mono_runtime_exec_main external only.
Runtime should use mono_runtime_exec_main_checked or mono_runtime_try_exec_main
2016-06-02 10:42:46 -04:00
Aleksey Kliger (λgeek) 79451d22e7 Merge pull request #3087 from lambdageek/dev/monoerror-mono_object_to_string
[runtime] Mark mono_object_to_string external only.
2016-06-02 10:31:29 -04:00
Marek Safar f965a4e5db [System] Internal connectionpool from referencesource 2016-06-02 16:19:42 +02:00
Alex Rønne Petersen 817f874aac Merge pull request #3096 from alexrp/master
[bcl] Avoid ObjectDisposedException in EndPointListener.
2016-06-02 15:11:51 +02:00
Marek Safar 7e4adb9ef4 [corlib] Fixes mobile tests 2016-06-02 14:40:47 +02:00
Marek Safar 8f6567bebf Merge pull request #3097 from rolfbjarne/mono-api-info-compare-generic-method-parameters
[mono-api-info] Take number of generic parameters into account when comparing methods.
2016-06-02 13:11:16 +02:00
Rolf Bjarne Kvinge 624f29b583 [mono-api-info] Take number of generic parameters into account when comparing methods. 2016-06-02 12:12:35 +02:00
Zoltan Varga 164c74028e [arm] Return structures with sizes up to 16 bytes in int registers on watchos. Fixes #41393. 2016-06-02 06:01:40 -04:00
Alex Rønne Petersen d9fc8f866a [bcl] Avoid ObjectDisposedException in EndPointListener.
This fixes a regression introduced in 123aaa5db0.
We would sometimes see an ObjectDisposedException when calling AcceptAsync ()
because that patch removed the try-catch around it.
2016-06-02 11:27:38 +02:00
Marek Safar 20d025bb28 Merge pull request #3094 from mbrophy1/master
Add missing type forwarder for System.Diagnostics.Tracing.EventSource…
2016-06-02 09:51:50 +02:00
Alexander Kyte 1c99d720d6 Merge pull request #3095 from alexanderkyte/typespec_cache_fix
[runtime] Don't free null cache hash table in aot compiler
2016-06-01 18:42:38 -04:00
Alexander Kyte 62ba7ca6b4 [runtime] Don't free null cache hash table in aot compiler 2016-06-01 18:39:35 -04:00
Andi McClure 34d0fdb5a3 Halve the stack depth for both the new single step tests 2016-06-01 18:04:35 -04:00
Miguel de Icaza ed75412ec1 [genproj] More updates to the project files, getting closer, down to 5 errors 2016-06-01 16:18:11 -04:00
Matthew Brophy 9ebb048e80 Add missing type forwarder for System.Diagnostics.Tracing.EventSourceSettings. ASP.net Core 1.0 RC2 apps will not run against mono without this. 2016-06-01 21:17:29 +01:00
Aleksey Kliger 598b8290de [runtime] Comment external only functions that call mono_error_raise_exception 2016-06-01 15:39:55 -04:00
Aleksey Kliger bcbd0ac0c0 [runtime] Mark mono_object_to_string external only.
Runtime should use mono_object_to_string_checked and mono_object_try_to_string.
2016-06-01 15:39:46 -04:00
Marek Habersack 9d18dc706c Xamarin.Android test suite updates
Xamarin.Android internal test suite takes advantage of the BCL tests
in Mono, so far their inclusion was a manual process and this commit
fixes it. A set of source inclusion and exclusion lists is added
and a handful of code fixes to make them compile on Xamarin.Android
2016-06-01 20:35:51 +02:00
Marek Safar 29556e2cd8 [corlib] Disable even more cas in mobile 2016-06-01 20:06:54 +02:00
Alexander Kyte 7bbf991bff [runtime] Replace pedump boehm dependency with sgen dependency 2016-06-01 13:04:19 -04:00
Aleksey Kliger (λgeek) 3f435390aa Merge pull request #3081 from lambdageek/coop-no-prof
[coop] Disable profiler tests if coop is enabled
2016-06-01 12:55:58 -04:00
monojenkins 4e928f6338 Merge pull request #3086 from esdrubal/master
[System] Fixes socket async exception.

SendAsyncFile uses StartSocketServer to start a server and at the same
time begins to accept a client socket. The issue is that when
the accept callback is called SendAsyncFile already closed the socket.

Fixed race condition by moving StartSocketServer and ReceiveCallback
logic into SendAsyncFile, and by using a new MRE to ensure that the
client receives all the data before the server is closed.

Fixes [#41264](https://bugzilla.xamarin.com/show_bug.cgi?id=41264)
2016-06-01 17:25:11 +01:00
Marek Safar ca82b187d2 [corlib] Disable more CAS code 2016-06-01 18:01:10 +02:00
Aleksey Kliger 830f7eec99 [coop] Disable profiler tests if coop is enabled 2016-06-01 10:25:33 -04:00
Marcos Henrich 0693884580 [System] Fixes socket async exception.
SendAsyncFile uses StartSocketServer to start a server and at the same
time begins to accept a client socket. The issue is that when
the accept callback is called SendAsyncFile already closed the socket.

Fixed race condition by moving StartSocketServer and ReceiveCallback
logic into SendAsyncFile, and by using a new MRE to ensure that the
client receives all the data before the server is closed.

Fixes #41264
2016-06-01 15:08:05 +01:00
Marek Safar d76164a203 [mcs] Use only mcs specific assembly references resolver. Fixes #29189 2016-06-01 13:41:48 +02:00
lateralusX 21e166b9ae Fix for non GCC win x64 calling convention when passing empty structs over pinvoke.
Standard C and C++ doesn't allow empty structs, empty structs will always have a
size of 1 byte. GCC have an extension to allow empty structs,
https://gcc.gnu.org/onlinedocs/gcc/Empty-Structures.html. This cause a
little dilemma since runtime build using none GCC compiler will not be
compatible with GCC build C libraries and the other way around. On platforms
where empty structs has size of 1 byte it must be represented in call and cannot
be dropped.

Libraries build using for example MSVC failed pinvoke call when empty
structs where used in pinvoke2.cs tests. The problem was that current
implementation dropped value types of size 0, eliminating them from the
call. Since MSVC implements C/C++ standard regarding empty structs (no extension used),
the function expected the parameter to be present, even if was not used.
This became a problem if the empty struct ended up in one of the 4 first
parameters (backed by registers) since if excluded, wrong parameter gets
into wrong registers (the same will apply to stack slots as well). For example,
a C signature like this, (int a, EmptyStruct es, int b) will get lowered to the
following on MSVC win x64, a -> rcx, es -> rdx and b -> r8, but since caller
eliminated es from the call, the register assignment from the caller was
a -> rcx and b -> rdx causing a violation of the calling convention and
error in callee.

The fix is to make sure that empty structs are still represented on none GCC
compilers on windows x64 (MSVC), since they must be represented in the call
to pinvoked methods. Fix will also use a const value of 0 to represent the value
passed as the struct instead of loading a value from stack into register/stack slot,
this is inline with the value the .NET runtime passes to pinvoked method. The reason
why we use a 0 instead of loading from stack is because a struct of size 0 is not explicitly
represented on stack and will have garbage data if loaded. Since it’s an empty struct value
type there is no need to load anything, just represent it as 0 in the register/stack slot passed
to caller.

There is also a case when returning an empty struct from a pinvoked method. Result will be returned
as 0 in RAX by MSVC compiled libraries (or whatever value stored in the 1 byte representation).
Since we have similar issues as above with empty structs of size 0 not explicitly represented on the
stack, the store will be eliminated and not written back to stack by caller since an empty struct doesn’t
represent any unique data.

Calling convention for managed->managed code is kept intact since it is working as expected
handling the case with empty structs as input and return values.

With fix all pinvoke2.cs tests now pass running on Windows x64 JIT.
2016-06-01 10:33:22 +02:00
Marek Safar 3c2c4168e0 [mcs] Adjust correctly newline counter inside pragma warning 2016-06-01 10:03:10 +02:00
Marek Safar 827bc97d5d [System] Fixes bootstrap build with old mcs 2016-06-01 10:03:09 +02:00
Zoltan Varga 6e36e18c92 [arm] Pass structures larger than 16 bytes by ref on watchos. Fixes #41393. 2016-06-01 03:28:51 -04:00
Alex Rønne Petersen 50c3c48143 [sgen] Remove a pointless memory barrier from the middle of the managed allocator.
This appears to serve no purpose as tlab_next is a thread-local variable. It's
only ever accessed by other threads in order to write to it, not read it. We
also don't do this memory barrier in the native allocation functions.
2016-05-31 23:40:29 +02:00
Alex Rønne Petersen f9ef2ce122 [arm] Don't emit memory barriers for relaxed atomic loads/stores. 2016-05-31 23:40:09 +02:00
Alex Rønne Petersen f0868d79d9 [sgen] Cache the SgenThreadInfo pointer in a local when emitting managed allocators. 2016-05-31 23:40:08 +02:00
Alex Rønne Petersen 755056dd25 [gc] Register a critical region when executing managed allocators.
Previously, if we stopped a thread and it had a stack looking like this:

    ...
    profiler_signal_handler
    <signal handler called>
    managed_allocator
    ...

We would fail to identify the fact that we've just interrupted a thread that's
in a managed allocator (uninterruptible code) because we only look at the very
latest instruction pointer of the thread, which will be pointing into
profiler_signal_handler or some other function called by it. So we would
happily continue along with the STW process and proceed to doing the actual GC,
where we would see a broken heap.

We could solve this by unwinding the stack and checking all frames, but that's
complicated and error-prone. Instead, register a critical region while the
managed allocator. This way, if we don't identify it by instruction pointer, we
will identify it by the fact that the thread is in a critical region.
2016-05-31 23:40:08 +02:00
Miguel de Icaza 9dc91ef0d3 [genproj] Another library works, System.Json.Microsoft 2016-05-31 17:18:13 -04:00
Rodrigo Kumpera 07b2a10491 Merge pull request #3080 from BrzVlad/feature-enable-conc-master
[sgen] Enable concurrent major by default on desktop platforms
2016-05-31 13:58:09 -07:00
Miguel de Icaza dd0b8f31d9 [genproj] support for using prebuilt resources 2016-05-31 16:50:55 -04:00
Andi McClure 42573c7fce Fixes for peer feedback on recursive step patch
Made breakpoint uniqueness test switch to a hash after 8th item added,
consolidated the code that handles the uniqueness test and makes the
breakpoint in one function, fixed style issues.
2016-05-31 16:36:45 -04:00
Miguel de Icaza b078895e89 [genproj] Getting closer to a full build
* Add TODO list
* Use -useSourcePath when building resources, so we do not need to add the explicit extra path
* More updates, now battling resource generation across the board
* Use newlines in the Unix commands to avoid generating things like cs-parser.cs^M
2016-05-31 15:36:59 -04:00
Mark Probst d15602739b Merge pull request #2871 from BrzVlad/feature-conc-sweep-nrs
[sgen] Run sweep concurrently with nursery collections
2016-05-31 11:07:42 -07:00
Mark Probst 9c3b78485a Merge pull request #3019 from schani/fix-major-pinning
Fix major pinning, and cheap pinning stats by default
2016-05-31 11:03:43 -07:00
Marek Safar b12385e9fd [mcs] Add more of undocumented C#6 improved overload resolution 2016-05-31 18:40:50 +02:00
Miguel de Icaza 65b46a6eaf [genproj] Update build files 2016-05-31 12:23:41 -04:00
Miguel de Icaza 4ad48cec41 [mconfig] Remove dependency on build time settings 2016-05-31 12:11:40 -04:00
Jonathan Pryor 8c32f9c042 Merge pull request #2377 from joelmartinez/docs-multiassembly-extension-fix
[mdoc] Extension method crash fix, removes -multiassembly
2016-05-31 12:01:02 -04:00
Neale Ferguson 166a8df8f1 Make log header message consistent 2016-05-31 11:51:23 -04:00
Joel Martinez ff4ab341c3 [mdoc] Extension method crash fix, removes -multiassembly
The tests added during the initial development of the -multiassembly argument failed to test the presence of extension methods;
the result was a crash that occurred when there were extension methods present in multiple assemblies.

This patch addresses the issue by putting a guard clause around the code that adds the extension method to the index.
Tests have been modified accordingly to verify this bug and include extension methods

Additionally, the -multiassembly parameter was removed entirely. This behavior is now triggered by the presence of -apistyle,
which is where support for "multiple assemblies" was meant to work anyways. To review, this is to support cross-platform
development, where you have multiple -- *different* -- assemblies for each platform. These assemblies will share a certain
cross-section of APIs that will be *exactly* the same in each assembly (as opposed to multiple versions of literally the same assembly).
As a result, every member will now contain an individual `AssemblyInfo` tag that also contains the name of the assembly.
2016-05-31 11:48:11 -04:00
Vlad Brezae 40c3b472e6 [sgen] Enable concurrent major by default on desktop platforms 2016-05-31 18:41:06 +03:00
Alexander Köplinger c1bc0f76fd Merge pull request #3078 from akoeplinger/fix-test-exclude-filename
[build] Make exclusion filename consistent between library and test
2016-05-31 17:24:11 +02:00
Aleksey Kliger (λgeek) 82128fe28f Merge pull request #3067 from lambdageek/dev/monoerror-stringy
[runtime] Deal with MonoErrors from string_to_utf8_checked changes
2016-05-31 11:13:53 -04:00
lateralusX 0ef9fdb669 Merge pull request #3059 from lateralusX/jlorenss/win-x64-dyncall-gsharedvt-support
[aot] Added support for GSHAREDVT and DYNCALL on Windows x64 for full AOT builds.
2016-05-31 16:32:40 +02:00
Alexander Köplinger 919edbf2e4 Merge pull request #3076 from akoeplinger/fix-ziptime-offbyone
[WindowsBase] Fix off-by-one error in ZipTime
2016-05-31 16:06:41 +02:00
Alexander Köplinger 07baa1cce4 [WindowsBase] Fix off-by-one error in ZipTime
The date/time struct in zip.h defines the month value as

    uInt tm_mon;            /* months since January - [0,11] */

.NET's DateTime object in turn stores months from 1-12. We didn't
take this into account when passing the values from managed->native
so the month ended up being off by one.

We didn't use this codepath before https://github.com/mono/mono/pull/3036
that's why it didn't show up until now.
2016-05-31 13:55:05 +02:00
Alexander Köplinger 87b1150070 [build] Make exclusion filename consistent between library and test
The test assembly used *.dll.excludes before while the library uses *.dll.exclude.sources.
Make this consistent to reduce confusion.

Also remove corlib_cmp.dll.excludes which is from a profile that no longer exists.
2016-05-31 13:54:04 +02:00
Marek Safar 059d656a9b [System] Fixes build 2016-05-31 13:44:43 +02:00
Marek Safar e8ca290f1e Merge pull request #3075 from knocte/man_bump
[man] bump man's mono version number too (to 4.5.2)
2016-05-31 11:44:36 +02:00
Andres G. Aragoneses 99f7b148e3 [man] bump man's mono version number too (to 4.5.2)
Following this version bump:
https://github.com/mono/mono/commit/069cea3712a5bd4959e505260cdc4a0c37861e77

(Also add a note to configure.ac as a hint until
someone comes up with a way to sync man/mono.1's
version automatically.)
2016-05-31 16:51:23 +08:00
Marek Safar 86b5cde6c0 [System] Keep broken api in mobile profiles only 2016-05-31 10:07:11 +02:00
Marek Safar 24230862fe [WindowsBase] Fixes test assert expectation logic 2016-05-31 10:07:11 +02:00
Marek Safar 90979903d7 [System] Remove empty test 2016-05-31 10:07:11 +02:00
Marek Safar 599adb0774 Merge pull request #3063 from marek-safar/rs-Net
[System] WebRequest from referencesource
2016-05-31 10:00:21 +02:00
Marek Safar a2147aa78a [System] WebProxy from referencesource 2016-05-31 09:58:26 +02:00
Alexander Köplinger 9f23956396 [ci] Bump timeout in runtime test step
We were seeing timeouts in the runtime step if two builds happen to be scheduled
at the exact same time on the ARM workers on Jenkins, causing increased load and
longer test times. They aborted the runtime step right before it'd finish.

Bump the timeout a bit to avoid this.
2016-05-31 07:05:51 +02:00
Zoltan Varga 7c884f8f63 [bcl] Comment out a win32 pinvoke on the mobile profile, since ios can't have unresolvable pinvokes. 2016-05-30 23:14:52 -04:00
Alex Rønne Petersen 069cea3712 Bump version to 4.5.2. 2016-05-30 20:14:22 +02:00
Vlad Brezae 4ae209510f Merge pull request #3056 from BrzVlad/fix-multiple-binprot
[sgen] Exclusive write on binary protocol file
2016-05-30 19:06:09 +03:00
Vlad Brezae 9afab40925 Merge pull request #3057 from BrzVlad/fix-major-log3
[sgen] Refactor collection logging
2016-05-30 19:04:28 +03:00
Alexander Köplinger 72ef3fb1f6 Merge pull request #3071 from adamburgess/fix-ci-links
Update README with new CI builds/badges
2016-05-30 12:36:55 +02:00
Zoltan Varga d743c659c5 [jit] Emit code to throw method access exceptions instead of throwing them from the JIT, so the stack trace is correct. Fixes #41280. (#3072) 2016-05-30 03:40:56 -04:00
Zoltan Varga ab989b84c7 Revert "[jit] Emit code to throw method access exceptions instead of throwing them from the JIT, so the stack trace is correct. Fixes #41280."
This reverts commit 04171d2c26.
Revert this as it causes test failures.
2016-05-29 22:25:53 -04:00
Zoltan Varga 23e73fd7b7 Revert "[jit] Fix 04171d2c26 so it actually works."
This reverts commit 6683c128e4.
Revert this as it causes test failures.
2016-05-29 22:25:53 -04:00
Alexander Köplinger 340f106a35 [System.Transactions] Fix the build broken by https://github.com/mono/mono/pull/3061 2016-05-30 02:11:33 +02:00
Marek Safar c6d3cc5fa7 Merge pull request #3061 from Thorium/master
#23050 TransactionScopeAsyncFlowOption
2016-05-29 08:22:45 +02:00
Zoltan Varga 6683c128e4 [jit] Fix 04171d2c26 so it actually works. 2016-05-29 00:24:08 -04:00
Zoltan Varga 04171d2c26 [jit] Emit code to throw method access exceptions instead of throwing them from the JIT, so the stack trace is correct. Fixes #41280. 2016-05-29 00:21:58 -04:00
Adam Burgess 0160beb486 Update README with new CI builds/badges
Adds the debian arm64 build and also changes the amd64/i386 builds to be ubuntu-specific
2016-05-28 20:03:20 +10:00
Zoltan Varga 53777008dd [gsharedvt] Fix the mapping of reference generic instances in gsharedvt wrappers, they need to be the same as references. 2016-05-28 01:52:05 -04:00
Bernhard Urban 39bcba8568 Merge pull request #3002 from lewurm/typespec-caching
[aot] use hashtable for caching typespec of classes
2016-05-27 16:50:06 -07:00
Vlad Brezae a3311fab4c [sgen] Exclusive write on binary protocol file
If we have binary protocol enabled and the debugged executable will spawn a new mono instance, both of the processes will write to the same debug file, because they share the environment variable, producing invalid results. Add a pid sufix if output file exists in order to separately obtain binary protocol outputs from all mono instances.
2016-05-28 00:24:55 +03:00
Aleksey Kliger 6af169ff25 [s390x] Fix the build2 2016-05-27 16:19:29 -04:00
Aleksey Kliger 848c482cc6 [s390x] Fix the build
Broken by b884d17
2016-05-27 16:16:21 -04:00
Miguel de Icaza 85d89274bb [genproj] Update from Ankit's project 2016-05-27 16:13:27 -04:00
Aleksey Kliger c18f296c9b [runtime] Avoid mono_error_raise_exception in icalls and debugging utilities 2016-05-27 15:54:47 -04:00
Aleksey Kliger eb4fc33b66 [perfcounters] Convert instance name to C string in the icall entrypoint.
Convert MonoString to UTF8 early to simplify exception handling.
2016-05-27 15:54:46 -04:00
Aleksey Kliger 3ac653123e [reflection] Don't raise in {Module,Assembly}Builder icalls 2016-05-27 15:15:59 -04:00
Alexander Köplinger ee5a06c1a0 Merge pull request #3037 from mono/system_io_compression_datetime
[System.IO.Compression/.Filesystem] Fixed handling of date/time for Zip entries
2016-05-27 20:20:18 +02:00
Vlad Brezae 9dd9ab1c9d [sgen] Don't register pinned objects if pin stats are disabled
On some collections of fsharp, which had many pinned objects, this took up to 10 ms.
2016-05-27 21:10:58 +03:00
Vlad Brezae ead0e31c9c [sgen] Sweep concurrently with nursery collections
When we scan a block we need to have it checked for sweeping. Instead of waiting for all the blocks to be checked for sweeping, we traverse all the blocks (even though they might not have live objects), and do the sweeping check only for blocks that have dirty cards associated with them, without waiting for sweeping to end.
2016-05-27 21:10:58 +03:00
Vlad Brezae abd564253a [sgen] Don't wait for sweep finish when allocating major object
Allocating a major block needs addition to the allocated_blocks array, operation that needs sweep to be finished because sweep moves elements and changes the size when compacting the array. Do this operation in the sweep start instead, when we are not racing.
2016-05-27 21:10:58 +03:00
Vlad Brezae 03ec48b6b1 [sgen] Add missing binary protocol entries for block state set 2016-05-27 21:10:58 +03:00
Miguel de Icaza 87b55c5dc9 [genproj] Run update-solution-files to track master 2016-05-27 13:52:22 -04:00
Miguel de Icaza e4aae0e88f Add another build step 2016-05-27 13:27:32 -04:00
Miguel de Icaza 5515e33fb7 [genproj] Do not use \r on the Unix parts of the build hook, add RabbitMQ hooks 2016-05-27 13:24:16 -04:00
Vlad Brezae 52d58c1c5d [sgen] Refactor collection logging
We had the problem that we were logging at sweep finish which can happen anytime. If we happen to suspend a thread, while doing a GC, in the middle of logging we might deadlock if we wait for sweep to finish (which can be blocked waiting for logging).

When logging multiple collections in the same stw pause, we would not log the real results for both collections since we would compute the major sizes at the very end.

We logged collections in sgen_perform_collection, outside the function calls for specific collections, which makes it cumbersome to add additional log entries.

This refactoring solves these issues by having GC code log info at any time. This log entry is enqueued in a list of pending entries. We flush the list of logs, as before, at the end of the stw, when the world is restarted.
2016-05-27 20:17:43 +03:00
Aleksey Kliger 973dbcaa88 [file-mmap-posix] Don't use mono_error_raise_exception 2016-05-27 12:39:37 -04:00
Alexander Köplinger 0db9b0a3b9 Merge pull request #3060 from directhex/pr-in-version.h
[jenkins] Include PR number in version.h if PR builder env is set
2016-05-27 17:47:54 +02:00
Aleksey Kliger fea81c3ad9 [runtime] Don't raise in mono_assembly_apply_binding 2016-05-27 11:44:53 -04:00
Aleksey Kliger (λgeek) 29ddc7ee3c Merge pull request #3050 from lambdageek/dev/monoerror-to_utf8
[runtime] Mark mono_string_to_utf8 external only.
2016-05-27 10:54:45 -04:00
Alexander Köplinger 388486011e Merge pull request #3058 from rolfbjarne/git-instead-of-ssh
[offsets-tool] Use git protocol instead of ssh to allow anonymous access.
2016-05-27 16:16:09 +02:00
Alexander Köplinger 57e41fd88f Merge pull request #3062 from madewokherd/win32threadscompile
[win32_threads] Mark an inline function as static.
2016-05-27 16:06:57 +02:00
Marek Safar a9a6592513 [corlib] Clean up MonoType declaration 2016-05-27 16:00:05 +02:00
Marek Safar f2b187e972 [System] WebRequest from referencesource 2016-05-27 14:43:17 +02:00
Joao Matos b977ec8ef9 [System.IO.Compression.FileSystem] Fixed date time when creating Zip entries from filesystem files. 2016-05-27 13:03:57 +01:00
Joao Matos 2261009c64 [System.IO.Compression] Added test for Zip entry timestamp modification. 2016-05-27 13:03:02 +01:00
Tuomas Hietanen 1516f24d06 Made changes suggested by marek. 2016-05-27 10:40:09 +01:00
Jo Shields 186288686d [jenkins] Include PR number in version.h if PR builder env is set
A while ago, we switched our PR builders from using the Github-provided PR branch head (i.e. `pull/merge/XXXX`) to the exact sha1 of the latest commit on the PR (i.e. `abcdefabc`). This change was needed for the performance team, otherwise the changes they wanted to test would be rebased against a new master several times per day, breaking their ability to meaningfully track the changes in a PR.

As a side effect of this, `version.h` went from setting the version from `XXXX/abcdefabc` to `explicit/abcdefabc`, and the Jenkins PR packages use the branch name `explicit` instead of the actual PR number `XXXX`, which is pretty bad from a UX perspective.

This change checks for the `ghprbPullId` environment variable and uses it instead of the actual branch name or `explicit` - it is always set on PR builds.
2016-05-27 09:36:11 +01:00
lateralusX 197b70df90 Added support for GSHAREDVT and DYNCALL on Windows x64 for full AOT builds.
Support for GSHAREDVT added for Windows x64. Changes needed
(ones gsharedvt concept was understood, crashes debugged and adjustments located)
where quite small. Primarily around shadow stack used by windows + incorrect handling
of none volatile registers on windows when going over the gsharedvt trampolines.
All GSHAREDVT tests, gshared.exe and aot.tests.exe pass in full AOT builds with above adjustments.

Support for DYNCALL added/enabled for Windows x64. Current AMD64 support was working
for basic scenarios but not enabled on Windows. Identified a problem on AMD64
when structs are passed as input parameters or returned by methods for DYNCALL scenarios
in full AOT:ed builds. This scenario doesn't seem to work for any AMD64 platform for
full AOT and the tests in aot-test.exe handling these scenarios are not run on AMD64.

Adjusted categories on test in aot-tests.exe to reflect what’s really needed by the tests
to run correctly. Also added a new category to some DYNCALL tests that uses struct support
currently not implemented on AMD64, !FULLAOT-AMD64, so at least some of the DYNCALL tests
can be run on AMD64 platforms in full AOT:ed builds.
2016-05-27 10:22:32 +02:00
Zoltan Varga 2eab1a97dd Remove an unused icall. 2016-05-26 22:50:30 -04:00
monojenkins 82f74ede88 Merge pull request #3026 from lewurm/is-call-macro
[mini] small improvements around `MONO_IS_CALL` macro and `local-prop`

showed up in vtunes when running 
```
./mono/mini/mono-sgen --stats -O=all --aot=threads=1,asmonly ~/work/benchmarker/tests/fsharp/lib/bootstrap/4.0/FSharp.Compiler.dll
```

also, I think when `OP_DYN_CALL` was introduced, it wasn't added to the `MONO_IS_CALL` macro. @vargaz, what do you think?
2016-05-27 02:25:07 +01:00
Zoltan Varga ee6c7cf065 [sdb] Avoid calling mono_thread_current () in the profiler shutdown callback, sends a 0 thread id instead, the managed side ignores it. 2016-05-26 18:55:57 -04:00
Bernhard Urban bb806ba1d6 [mini] avoid checking condition twice in local-prop 2016-05-26 15:41:29 -07:00
Bernhard Urban e197d13f81 [mini] simplify MONO_IS_CALL macro 2016-05-26 15:41:29 -07:00
Zoltan Varga d88424370f Merge System/MonoType.cs into ReferenceSources/RuntimeType.cs, use th… (#3045)
* Merge System/MonoType.cs into ReferenceSources/RuntimeType.cs, use the latter in the runtime code.

* [sdb] Fix a test which referenced System.MonoType.
2016-05-26 18:33:41 -04:00
Vincent Povirk 0830b25dc3 [win32_threads] Mark an inline function as static.
If the C compiler decides not to inline the function, and it's not declared
static, it'll look for an extern version, and linking will fail.
2016-05-26 16:50:42 -05:00
Aleksey Kliger b884d173c7 [runtime] Mark mono_string_to_utf8 external only.
Runtime should use mono_string_to_utf8_checked.
2016-05-26 15:13:37 -04:00
Aleksey Kliger (λgeek) 5cb30c7c72 Merge pull request #3055 from lambdageek/dev/monoerror-cleanup-cleanup
[runtime] Disallow unintended reuse of MonoError after mono_error_cleanup
2016-05-26 11:26:33 -04:00
Tuomas Hietanen 820be6c036 Merge branch 'master' of https://github.com/mono/mono 2016-05-26 15:07:30 +01:00
Tuomas Hietanen c9c563fa5b #23050 First attempt to create TransactionScopeAsyncFlowOption on Mono.
This is a feature that is missing. However I don't have Mono,
so has to be compiled and tested.
2016-05-26 15:05:29 +01:00
Ludovic Henry 7ebae4c7f5 Merge pull request #3028 from lateralusX/jlorenss/threadpool_warning
Incorrect warning message on thread pool startup in full AOT:ed Windows build.
2016-05-26 15:26:51 +02:00
Marek Safar 478db45ebd Merge pull request #3047 from marek-safar/rs-corlib
[corlib] More System.Runtime.InteropServices from referencesource
2016-05-26 11:15:27 +02:00
Rolf Bjarne Kvinge b41f0700a2 [offsets-tool] Use git protocol instead of ssh to allow anonymous access. 2016-05-26 09:54:43 +02:00
Zoltan Varga b657c7b0e6 Aot runtime noraise3 (#3054)
* [aot] Make mono_aot_get_method () external only, use mono_aot_get_method_checked () instead.

* [aot] Avoid raising exceptions in the AOT runtime.
2016-05-25 23:58:36 -04:00
Aleksey Kliger ab24b51671 [reflection] Reinitialize MonoError after mono_error_convert_to_exception 2016-05-25 19:27:39 -04:00
Aleksey Kliger 169985dcd5 [mini] Use an inner MonoError in instance testing in first pass EH 2016-05-25 19:23:16 -04:00
Aleksey Kliger d64ef7799b [runtime] Disallow unintentional reuse of MonoError after mono_error_cleanup 2016-05-25 19:11:45 -04:00
Aleksey Kliger fc950dc5bc [reflection] Cleanup uses of mono_error_cleanup
MonoError must be explicitly reinitialized if it is used again after
mono_error_cleanup.  But it is better to introduce an explicit inner
MonoError when possible.
2016-05-25 18:34:43 -04:00
Mark Probst 4afc91e8b9 [sgen] Remove a stupid #define 2016-05-25 15:13:05 -07:00
Mark Probst 1800992952 [sgen] Cheap pinning statistics by default. 2016-05-25 15:13:01 -07:00
Mark Probst 0a7194b7c3 [sgen] Add an assertion. 2016-05-25 15:12:37 -07:00
Mark Probst 76bdd84ce9 [sgen] Do pin stats for small major objects, too. 2016-05-25 15:12:32 -07:00
Mark Probst 855bc894db [sgen] Don't pin empty slots in the major heap. 2016-05-25 15:12:10 -07:00
Zoltan Varga 50a7096539 [llvmonly] Avoid calling mono_error_raise_exception () to throw exceptions during method initialization, call mono_llvm_throw_exception () directly. 2016-05-25 16:59:57 -04:00
Alexander Köplinger 66ab64f2a0 Merge pull request #3051 from mono/revert-3043-aot-runtime-noraise
Revert "[aot] Avoid raising exceptions in the AOT runtime."
2016-05-25 21:50:30 +02:00
Alexander Köplinger 778bbe819c Revert "[aot] Avoid raising exceptions in the AOT runtime." 2016-05-25 21:48:39 +02:00
Sebastien Pouliot 8c14f0d410 Merge pull request #2996 from UCIS/patch-7
Generate RSA keys using public exponent 65537 (was 17)
2016-05-25 15:11:22 -04:00
Alexander Köplinger e765e70945 Merge pull request #3036 from tritao/windowsbase_zip_datetime
[WindowsBase] Fixed System.IO.Packaging creating Zip archive with wrong date time entries
2016-05-25 19:28:55 +02:00
Bernhard Urban 532e618a14 Merge pull request #3016 from lewurm/small-arm-cleanup
[mini-arm] remove useless case for iphone_abi
2016-05-25 09:56:39 -07:00
Bernhard Urban 34687fb5a6 [aot] use hashtable for caching typespec of classes
I had a look in vtunes for

```
$ mono/mini/mono-sgen --stats -O=all --aot=threads=1,asmonly ~/work/benchmarker/tests/fsharp/lib/bootstrap/4.0/FSharp.Compiler.dll
```

and that method showed up as hot.

With this change I get an improvement from ~27.4s down to ~24.3s on my
machine.
2016-05-25 09:48:55 -07:00
Zoltan Varga 39d436290e [aot] Avoid raising exceptions in the AOT runtime. (#3043) 2016-05-25 12:35:39 -04:00
Marek Safar aae26db0c2 [WindowsBase] Fix for the new .rels file when it's shorter than the old. A fix for #41203 2016-05-25 17:03:50 +02:00
Aleksey Kliger (λgeek) 07bcf1a3c2 Merge pull request #3038 from lambdageek/dev/monoerror-threads
[threadpool-ms] Assert if queuing work items fails in the IO selector
2016-05-25 10:36:20 -04:00
Aleksey Kliger (λgeek) effdfb78ac Merge pull request #3042 from lambdageek/dev/monoerror-upgrade_remote_class
[remoting] Pass MonoError to mono_upgrade_remote_class
2016-05-25 10:12:25 -04:00
Aleksey Kliger (λgeek) f6adb102d4 Merge pull request #3044 from lambdageek/dev/monoerror-llvm
[llvm] Convert MonoError to LLVM ctx failure in process_call
2016-05-25 09:56:53 -04:00
Marek Safar 58f4315bd8 Merge pull request #3046 from redbrain/cfnetworking-null-reference
ContentStream can be null
2016-05-25 15:24:41 +02:00
Philip Herron 6425014c8f ContentStream can be null if no bytes were available and is closed will cause null-exception 2016-05-25 14:18:59 +01:00
Marek Safar 08a3251b91 [corlib] More System.Runtime.InteropServices from referencesource 2016-05-25 14:59:06 +02:00
Marek Safar d3f789f3c9 [WindowsBase] Deal with deleted package parts. A patch from #41203 2016-05-25 11:02:50 +02:00
Miguel de Icaza 2f21472994 [genproj] Handle resources properly, add helper scripts to bootstrap 2016-05-24 17:44:11 -04:00
Zoltan Varga 0ce5f9c721 [amd64] Implement the general rgctx fetch trampoline. 2016-05-24 16:37:58 -04:00
Aleksey Kliger a93a43d0a7 [llvm] Convert MonoError to LLVM ctx failure in process_call 2016-05-24 16:33:21 -04:00
Aleksey Kliger 920c7ae031 [llvmonly] Assert gsharedvt wrapper compile always succeeds. 2016-05-24 16:33:21 -04:00
Zoltan Varga 157360864a [jit] Optimize ldnull+unbox.any pairs, mcs generates it for code like f = null where f is a field of a generic type with an open type. 2016-05-24 16:08:11 -04:00
Zoltan Varga 2fb2f261e2 [amd64] Add back an assert removed by the previous change. 2016-05-24 15:35:25 -04:00
Zoltan Varga b80c9c5438 [amd64] Handle genericinst return types in gsharedvt. 2016-05-24 15:30:35 -04:00
Aleksey Kliger 7d5a44d39c [remoting] Pass MonoError to mono_upgrade_remote_class 2016-05-24 13:41:02 -04:00
Aleksey Kliger 8468ba85ce [remoting] Pass MonoError to mono_remote_class_vtable 2016-05-24 13:41:02 -04:00
Aleksey Kliger 412a024351 [remoting] Pass MonoError to mono_class_proxy_vtable 2016-05-24 13:41:02 -04:00
Aleksey Kliger e3c54423eb [remoting] MonoError-ize arch_create_remoting_trampoline 2016-05-24 13:41:02 -04:00
Marek Safar 3f7e999303 [System.Net.Http] Disable default global proxy when only UseProxy is set. Fixes #41224 2016-05-24 19:12:30 +02:00
Zoltan Varga 7261f57e48 [arm64] Enable system AOT. 2016-05-24 11:47:42 -04:00
Zoltan Varga 5588e15905 Fix warnings. 2016-05-24 11:43:37 -04:00
Aleksey Kliger (λgeek) 875d3f6c5d Merge pull request #3024 from lambdageek/dev/monoerror-endinvoke
[threadpool-ms] MonoError-ize mono_threadpool_ms_end_invoke
2016-05-24 11:11:48 -04:00
Aleksey Kliger (λgeek) fe8558dcfc Merge pull request #3029 from lambdageek/dev/simplify-monoerror-threads
[runtime] Simplify MonoError handling in finalizer creation and in thread objects
2016-05-24 11:08:01 -04:00
Aleksey Kliger (λgeek) 939da2c3ac Merge pull request #3041 from lambdageek/dev/monoerror-mono_arch_patch_code
[ia64/mips/ppc/s390x/sparc] Add MonoError arg to mono_arch_patch_code
2016-05-24 10:29:26 -04:00
Aleksey Kliger f234736118 [ia64/mips/ppc/s390x/sparc] Add MonoError arg to mono_arch_patch_code 2016-05-23 19:17:42 -04:00
Andi McClure 37da53ace7 Debugger stepping does not understand recursion (bug 38025)
Testing with the debugger showed multiple failures around recursive
functions:

1. Step-out breakpoints can trigger on inner frames.
Solution: Extend existing inner-frame test from step-over to step out
also.

2. "Same source line, continuing" test triggers even on wrong frame
   (affects both step over and step out)
Solution: Check frame as part of this test

3. When step breakpoints pick next sequence points, they can register
   multiple breakpoints at the same place if a recursive call happens to
   exit there. (Possibly harmless but may have resulted in duplicate
   debugger events being generated in one test.)
Solution: Check for duplicates in step-request breakpoint list before
adding new breakpoints

4. Mono.Debugging.Soft in the debugger-libs repo sometimes resumes
   after breakpoints if it decides Mono.Debugger.Soft has not stepped
   far enough, but the check to trigger this was not recursion-aware.
Solution: This one is not addressed in this commit, but a fix was
checked in to debugger-libs. Any code using this commit therefore
needs to be run in conjunction with debugger-libs dfbf6d8b13.

Tests were also added for issues 1-3 above.
2016-05-23 19:04:06 -04:00
Aleksey Kliger (λgeek) 68ee996c8d Merge pull request #3032 from lambdageek/dev/monoerror-gc
[runtime] Don't raise MonoErrors in mono_gc_run-finalize
2016-05-23 18:37:10 -04:00
Rodrigo Kumpera dd0e3f8d96 [runtime] Cleanup how we map WAIT_FAILED to what managed expects. 2016-05-23 15:12:36 -07:00
Rodrigo Kumpera a9294c2e57 [coop] Change self_abort_internal to take a MonoError to report that an exception must be raised. 2016-05-23 15:11:25 -07:00
Rodrigo Kumpera 3330e5bc89 [runtime] Change mono_thread_internal_stop to only stop other threads. Mask mono_thread_stop as MONO_RT_EXTERNAL_ONLY.
This change makes it not need to throw exceptions.

In the runtime, use mono_thread_internal_stop instead of mono_thread_stop.
mono_thread_internal_stop only stops other threads, which is what runtime usage calls for.
mono_thread_stop will stop the current thread by raising and exception.
2016-05-23 15:11:25 -07:00
Rodrigo Kumpera 9ca8d98fd2 [runtime] Introduce mono_thread_internal_abort to be used instead of ves_icall_System_Threading_Thread_Abort. 2016-05-23 15:11:24 -07:00
Rodrigo Kumpera 20525c99e6 [runtime] Change mono_thread_current_check_pending_interrupt to use mono_set_pending_exception.
Callers now check its return and set a pending exception.
2016-05-23 15:11:23 -07:00
Rodrigo Kumpera ceba6204a1 [runtime] Simplify mono_wait_uninterrupted, remove two arguments that are needed.
The first argument is whether it's a single or multiple wait. We can infer that from the number of handles.
The second argument is alertable. All waits are alertable, so I baked the constant directly.
2016-05-23 15:11:23 -07:00
Rodrigo Kumpera 79c6ba6976 [coop] Use MonoError in mono_wait_uninterrupted.
This removes an usage of mono_raise_exception by a set_pending
2016-05-23 15:11:22 -07:00
Aleksey Kliger 9023662ce9 [threapool-ms] Assert if queuing work items fails 2016-05-23 17:46:29 -04:00
Aleksey Kliger 1472f2365a [runtime] Don't raise in mono_threads_get_thread_dump 2016-05-23 17:42:36 -04:00
Miguel de Icaza f06f1e62b9 [genproj] Properly include EmbeddedResources for .resx->resources 2016-05-23 17:03:03 -04:00
Zoltan Varga b00622cf66 [runtime] Remove some older glib workarounds. 2016-05-23 15:48:24 -04:00
Zoltan Varga fa9a113f7f [eglib] Use the PRi64 defines from inttypes.h to define G_GINT64_FORMAT etc. Get rid of support for older MSVC versions. 2016-05-23 15:48:08 -04:00
Joao Matos bc1967e73b [System.IO.Compression] Fixed date time handling of Zip entries. 2016-05-23 20:19:22 +01:00
Zoltan Varga 8d403e73a7 [runtime] Remove some dead code. 2016-05-23 14:46:09 -04:00
Aleksey Kliger f2868b89b3 [runtime] Push null check to callers of mono_object_register_finalizer
Simplify error propagation since most callers register a finalizer after
doing their own null check.
2016-05-23 13:48:52 -04:00
Aleksey Kliger 30a1a8a477 [runtime] Assert in create_thread_object and create_internal_thread
They can only ever fail if allocation fails, which we can't recover
from, so let's just assert that we succeed.

This in turn simplifies the error handling in a lot of other thread routines.
2016-05-23 13:48:52 -04:00
Aleksey Kliger 02446eebea [runtime] (remoting.c) Get rid of mono_error_raise_exception calls 2016-05-23 13:40:00 -04:00
Aleksey Kliger 33477fa35b [runtime] Don't raise MonoErrors in mono_gc_run-finalize
Ship them off to unhandled exception handling instead.
2016-05-23 13:33:36 -04:00
Aleksey Kliger e6deea5e3b [threadpool-ms] MonoError-ize mono_threadpool_ms_end_invoke 2016-05-23 13:26:16 -04:00
Alexander Köplinger 6890eab27f Redist the referencesource folder
Since referencesource is no longer a submodule under external/ after https://github.com/mono/mono/pull/2962
it didn't get included in the tarball anymore.

We need to add it again to fix the tarball build.
2016-05-23 19:16:05 +02:00
Zoltan Varga d02fa64e5f [arm64] Add missing mini-arm64-gsharedvt.h file to arm64_sources. 2016-05-23 12:50:25 -04:00
Alexander Köplinger f38d1b2adb [msvc] Update .def files 2016-05-23 16:44:40 +02:00
Alexander Köplinger b5e37e7a95 Merge pull request #3033 from akoeplinger/fix-xbuild
Various xbuild 14.0 fixes
2016-05-23 15:52:17 +02:00
Rodrigo Kumpera eaca1ba8ed Merge pull request #3035 from mono/revert-3025-mono_raise_exception_in_threads
Revert "[coop] Remove mono_raise_exception from threads.c"
2016-05-22 16:10:13 -07:00
Rodrigo Kumpera 5a32c69ec2 Revert "[coop] Remove mono_raise_exception from threads.c" 2016-05-22 16:09:43 -07:00
Ludovic Henry d0ffec1ae1 Merge pull request #3018 from ludovic-henry/coop-marshal-attach
[coop] Generate native-to-managed thread attaching in marshal + Reset mono_jit_thread_attach signature
2016-05-20 19:52:01 -04:00
Rodrigo Kumpera 81bd8db9cf Merge pull request #3025 from kumpera/mono_raise_exception_in_threads
[coop] Remove mono_raise_exception from threads.c
2016-05-20 16:22:43 -07:00
Rodrigo Kumpera 326b021383 [runtime] Cleanup how we map WAIT_FAILED to what managed expects. 2016-05-20 16:20:28 -07:00
Rodrigo Kumpera 9657f07a9b Merge pull request #3030 from kumpera/fix_locale
[eglib] Ignore nl_langinfo as it doesn't return the actual system default.
2016-05-20 14:44:05 -07:00
Alexander Köplinger 30dd64033c [xbuild] Add AssignLinkMetadata to xbuild 14
This is essentially the same as https://github.com/mono/mono/commit/639bf661715fc190b595d05193c335f70b3313eb but for the xbuild 14 profile.
2016-05-20 23:37:22 +02:00
Alexander Köplinger 4103bd9aae [xbuild] Make sure MSBuildFrameworkToolsPath is set for xbuild 14 2016-05-20 23:37:21 +02:00
Alexander Köplinger d44824b7f8 [xbuild] Fix DependsOnSystemRuntime returning false on xbuild 14
In https://github.com/mono/mono/commit/4164d9fbe19a1e6acb3a5ea122891020ff2868d7 the 14.0 target was updated to include
the DependsOnSystemRuntime property. However, it wasn't actually implemented in the code behind. This resulted in the
property not being set/true even if we depend on assemblies that reference System.Runtime, which in turn leads us to not
adding the Facades in ImplicitlyExpandDesignTimeFacades. This then breaks compilation because the System.Runtime lookup fails.

The fix is to actually implement the property.
2016-05-20 23:37:20 +02:00
Rodrigo Kumpera ef1f0fe899 [coop] Change self_abort_internal to take a MonoError to report that an exception must be raised. 2016-05-20 14:00:17 -07:00
Rodrigo Kumpera fc94a140b8 [runtime] Change mono_thread_internal_stop to only stop other threads. Mask mono_thread_stop as MONO_RT_EXTERNAL_ONLY.
This change makes it not need to throw exceptions.

In the runtime, use mono_thread_internal_stop instead of mono_thread_stop.
mono_thread_internal_stop only stops other threads, which is what runtime usage calls for.
mono_thread_stop will stop the current thread by raising and exception.
2016-05-20 13:57:53 -07:00
Rodrigo Kumpera fbedfe313c [runtime] Introduce mono_thread_internal_abort to be used instead of ves_icall_System_Threading_Thread_Abort. 2016-05-20 13:56:04 -07:00
Rodrigo Kumpera ccfd0ac779 [runtime] Change mono_thread_current_check_pending_interrupt to use mono_set_pending_exception.
Callers now check its return and set a pending exception.
2016-05-20 13:56:04 -07:00
Rodrigo Kumpera 5d8b146abc [runtime] Simplify mono_wait_uninterrupted, remove two arguments that are needed.
The first argument is whether it's a single or multiple wait. We can infer that from the number of handles.
The second argument is alertable. All waits are alertable, so I baked the constant directly.
2016-05-20 13:55:59 -07:00
Rodrigo Kumpera a884522d6a [coop] Use MonoError in mono_wait_uninterrupted.
This removes an usage of mono_raise_exception by a set_pending
2016-05-20 13:54:27 -07:00
Rodrigo Kumpera 69588659ab [eglib] Ignore nl_langinfo as it doesn't return the actual system default. Fixes #41128.
nl_langinfo doesn't query the right system value, it returns ASCII on OSX, for example.
2016-05-20 12:00:25 -07:00
Aleksey Kliger (λgeek) 8c8ce9f3bd Merge pull request #3023 from lambdageek/dev/monoerror-minisig
[mini] Propagate MonoError in mini_get_signature
2016-05-20 10:06:28 -04:00
lateralusX cfc1228c9b Incorrect warning message on thread pool startup in full AOT:ed Windows build.
When running mono/mini aot-tests.exe on full AOT:ed Windows build the following
warning message is incorrectly written to the console several times:

g_warning ("failed to get 100ns ticks");

This happens since the check triggering this warning is not taking into account
that startup time between first call to mono_ns100_ticks storing the start time
and the launch of the thread pool requesting 100ns ticks and convert it to
elapsed seconds can occur during the first second of the process lifetime.
This is more likely to happen in a full AOT:ed image since nothing needs to
be JIT:ed at startup, making it more likely to exploit the problem reaching this
code within the first second of process lifetime.

The purpose of the check is to validate that mono_ns100_ticks is returning “valid”
data, but currently it checks it after converting it to seconds, meaning that the result
of the division gets truncated to 0 during the first second. The only invalid, deterministic error
from mono_ns100_ticks that could be used to trigger this warning is either 0 or a negative time value,
but currently it just checks for 0 as an error. The fix is to make the check on the return from
mono_ns100_ticks instead of on the result of the division by 10 000 000 as it is today.
2016-05-20 11:27:48 +02:00
Alexander Köplinger 96dca28adb Merge pull request #3027 from akoeplinger/ci-bump-timeout
[ci] Bump timeout for runtime tests
2016-05-20 04:02:04 +02:00
Alexander Köplinger 9ff9d495ca [ci] Bump timeout for runtime tests
On the new Jenkins infrastructure with the new ARM64 bots we're hitting the 2h runtime test
limit right before they'd be finished. Bump the timeout a bit to fix this.
2016-05-20 02:29:25 +02:00
Rodrigo Kumpera 127f4b0cd1 [coop] Use set_pending in ves_icall_System_Threading_Thread_Sleep_internal, it's an icall. 2016-05-19 14:13:45 -07:00
Aleksey Kliger 1c15e9bf78 [mini] Propagate MonoError in mini_get_signature
Also mark mono_metadata_parse_signature external only, runtime should
use mono_metadata_parse_signature_checked
2016-05-19 16:53:17 -04:00
Aleksey Kliger 75b33af0f3 [runtime] (threads.c, marshal.c) Set pending exception in a few icalls 2016-05-19 16:53:17 -04:00
Miguel de Icaza e90c2a56eb Add missing project file 2016-05-19 14:07:09 -04:00
Miguel de Icaza 5100a64596 [msbuild projects] Use newlines without a carriage return for Unix targets to appease MS msbuild 2016-05-19 12:50:55 -04:00
Zoltan Varga fbe5d3d9b9 [llvm] Avoid emitting got slots of type MONO_PATCH_INFO_ICALL_ADDR when using direct pinvokes, since the patch is not needed, and it cannot be resolved on platforms without a working dlsym(). 2016-05-19 12:18:49 -04:00
Ludovic Henry 4294e09fea [coop] Reset mono_jit_thread_attach signature
XM depends on mono_jit_thread_attach signature, even if it's not a public API. So to avoid breaking it, we need to reset it to its previous signature.
2016-05-19 12:18:31 -04:00
Miguel de Icaza 869ca554f0 [genproj] Fix the Makefile THISDIR location, so MSBuild can work with nunit.core 2016-05-19 11:55:32 -04:00
Miguel de Icaza db86e3a3e4 Do not sign the assembly 2016-05-19 11:49:58 -04:00
Ludovic Henry cf61ae311e [coop] Generate native-to-managed thread attaching in marshal 2016-05-19 11:31:11 -04:00
Miguel de Icaza 596d1d1621 [genproj] Now we can build all executables with msbuild as well 2016-05-19 10:09:23 -04:00
Alexander Köplinger f89fef62f2 Merge pull request #3017 from akoeplinger/fix-drawing-arm64
[System.Drawing] Disable failing PngCodec 2bpp tests on ARM64
2016-05-19 15:53:57 +02:00
Alexander Köplinger 56ad07531d Merge pull request #2998 from lateralusX/jlorenss/win-x64-full-aot-support
Windows x64 full AOT support for mono/mini regression tests.
2016-05-19 13:36:19 +02:00
Marek Safar 85c642b521 Merge pull request #3020 from akoeplinger/fix-ttl
[System] Raise ArgumentOutOfRangeException for values > 255 in Socket.Ttl setter
2016-05-19 10:42:24 +02:00
Miguel de Icaza af5812c8f1 Update .gitignore, remove stale file 2016-05-18 23:49:26 -04:00
Miguel de Icaza a0ac8b2024 [System.Windows.Forms] Fix incorrect compare of IntPtr to null 2016-05-18 23:42:10 -04:00
Miguel de Icaza 1d95af860b [genproj] Fix THISDIR location in a few projects, so genproj can generate MSBuild files 2016-05-18 23:35:45 -04:00
Miguel de Icaza 689ca75d63 [System.Web] Remove duplicate file listings which break msbuild and update csprojs 2016-05-18 22:51:25 -04:00
Alexander Köplinger de13dc2532 [System] Raise ArgumentOutOfRangeException for values > 255 in Socket.Ttl setter
This is consistent with the .NET implementation: https://github.com/mono/mono/blob/8054793e5bc158015154fb8cdcdd56777a0c8351/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs#L734-L737 (sadly, MSDN says SocketException should be thrown in this case...).

It fixes the SocketTest.TtlChangeoverflow test that started failing after https://github.com/mono/mono/pull/2250.
The reason is we refactored the SetSocketOption () overload the Ttl setter is using so that it now
checks for `error == (int) SocketError.InvalidArgument` instead of just falling through to raising
a SocketException with the error code.
2016-05-19 04:27:12 +02:00
Alexander Köplinger 60497b4bfb [System.Drawing] Disable failing PngCodec 2bpp tests on ARM64
They fail on the new Jenkins ARM64 bots, disable them until we figure out the cause.
It looks like a libgdiplus issue to me which makes deploying a fixed version a bit more difficult.

Filed https://bugzilla.xamarin.com/show_bug.cgi?id=41171 to track.
2016-05-19 02:08:21 +02:00
Rodrigo Kumpera 8054793e5b Merge pull request #2992 from lambdageek/dev/monoerror-other-invokes
[runtime] MonoError mono_runtime_invoke_{array,delegate}
2016-05-18 16:44:52 -07:00
Rodrigo Kumpera 28c62efb8d Merge pull request #2989 from lambdageek/dev/monoerror-message
[runtime] MonoError for mono_message_init
2016-05-18 16:43:05 -07:00
Rodrigo Kumpera 58e23811aa Merge pull request #2977 from BrzVlad/fix-major-log2
[sgen] Improve logging
2016-05-18 16:41:50 -07:00
Miguel de Icaza de3aa63805 [genproj] Sync with latest set of changes to Makefiles 2016-05-18 18:08:38 -04:00
Miguel de Icaza 33ed1e451f [genproj] Use an explicit IntermediateOutputPath to prevent rebuilds on cyclic assemblies 2016-05-18 17:59:25 -04:00
Bernhard Urban 23a9263945 [mini-arm] remove useless case for iphone_abi 2016-05-18 14:52:05 -07:00
Vlad Brezae fd3e254da2 [sgen] Fix warnings at printing 64bit ints 2016-05-18 23:53:13 +03:00
Vlad Brezae cd14c006d1 [sgen] Refactor sgen_perform_collection
This enables logging for major concurrent collections and for nursery collections while a concurrent collection is running.
2016-05-18 23:53:13 +03:00
Vlad Brezae 1e2e111c38 [sgen] Log also the real size used by the major objects
Due to performance concerns, we don't account for the space wasted in blocks, since it would require dereferencing all vtables. We also don't account for allocation that might happen during sweep.
2016-05-18 23:53:13 +03:00
Vlad Brezae f9951e0d9a [sgen] Log also the total los memory usage 2016-05-18 23:53:12 +03:00
Vlad Brezae f639e5d1c0 [sgen] Don't log previous collection memory size
This information can be found in the previous log entries.
2016-05-18 23:53:12 +03:00
Vlad Brezae 1a9542c969 [sgen] Precisely log the size of the promoted objects during minors 2016-05-18 23:53:10 +03:00
Rodrigo Kumpera 0dc17dcc9e Merge pull request #3008 from lateralusX/jlorenss/win-x64-shutdown-crash
[runtime] Fix for random, timing dependent, mono runtime crash during shutdown on Windows.
2016-05-18 13:45:22 -07:00
Marek Safar 9e58da5408 Merge pull request #3012 from marek-safar/rs-Net
[System] WebHeaderCollection from referencesource
2016-05-18 21:58:06 +02:00
Aleksey Kliger d9fa4d34c9 [runtime] MonoError-ize mono_message_invoke 2016-05-18 15:41:13 -04:00
Aleksey Kliger 3c9ab3e991 [runtime] MonoError-ize mono_runtime_invoke_array
As with mono_runtime_invoke, we split up into three functions:
1. mono_runtime_invoke_array is external only.  Runtime should use
   one of the other two.
2. mono_runtime_invoke_array_checked threads exceptions and failures through
  MonoError in coop mode.  In non-coop managed exceptions unwind the
  stack as before.
3. mono_runtime_try_invoke_array sends exceptions from method invocation
through a MonoException* outarg, and other errors through MonoError.
2016-05-18 15:41:13 -04:00
Aleksey Kliger 413ec4e0ea [runtime] Refactor mono_runtime_invoke_array
Pull a helper function invoke_array_extract_argument out to simplify
error handling.
2016-05-18 15:40:26 -04:00
Aleksey Kliger 3e0081e924 [runtime] MonoError-ize mono_runtime_delegate_invoke
Mark it external only.  Runtime can use
mono_runtime_delegate_invoke_checked or mono_runtime_delegate_try_invoke.
2016-05-18 15:40:26 -04:00
Aleksey Kliger c22a9b2f75 [runtime] Don't raise while calling unhandled exception delegate. 2016-05-18 15:40:26 -04:00
Zoltan Varga 81f9ed3195 [runtime] Remove an unused variable. 2016-05-18 15:40:20 -04:00
Ludovic Henry 3ca530a8bd Merge pull request #2994 from ludovic-henry/remove-nacl
[runtime] Remove support for NaCl
2016-05-18 15:36:45 -04:00
Aleksey Kliger 53ae4aa5a5 [runtime] MonoError-ize mono_message_init 2016-05-18 15:35:09 -04:00
Aleksey Kliger 9acccc0529 [runtime] MonoError-ize mono_marshal_xdomain_copy_value 2016-05-18 15:35:09 -04:00
Aleksey Kliger 85f5330e8f [runtime] MonoError-ize mono_method_call_message_new 2016-05-18 15:35:09 -04:00
Aleksey Kliger 8e226498a1 [runtime] MonoError-ize mono_delegate_ctor 2016-05-18 15:35:09 -04:00
Aleksey Kliger ac0160c043 [runtime] MonoError-ize mono_async_result_new 2016-05-18 15:35:09 -04:00
Aleksey Kliger b0d64d0121 [runtime] MonoError-ize mono_ldstr
Mark it external only.  Runtime should use mono_ldstr_checked.
2016-05-18 15:35:09 -04:00
Miguel de Icaza 52b0510b10 Remove more deprecated stuff 2016-05-18 15:30:25 -04:00
Miguel de Icaza d12eae59dc Remove dead code, update solution files 2016-05-18 15:26:07 -04:00
Miguel de Icaza 6cf2c991e9 genproj: Improve handling of executables and projects with build dependencies 2016-05-18 15:19:27 -04:00
Aleksey Kliger (λgeek) 3fc2fee18d Merge pull request #2815 from lambdageek/dev/monoerror-mono_compile_method
[runtime] MonoError-ize mono_compile_method
2016-05-18 15:15:16 -04:00
Aleksey Kliger (λgeek) c3d14ecb94 Merge pull request #3014 from lambdageek/dev/coop-enabled
[coop] Make mono_threads_is_coop_enabled a normal function
2016-05-18 13:15:03 -04:00
Alexander Köplinger 5c89ec97cc Merge pull request #3007 from directhex/use-mingw64
[jenkins] Use mingw64 to build, not 32
2016-05-18 17:40:15 +02:00
Aleksey Kliger f99a0f713c [coop] Make mono_threads_is_coop_enabled a normal function
It doesn't need to live in the header.

In particular is_coop_enabled variable used to be in every translation
unit instead of just a single flag.
2016-05-18 11:19:23 -04:00
Alexander Köplinger 4cbd7a6ab6 Merge pull request #3011 from akoeplinger/ci-fixes
[ci] Move setting CFLAGS and MONO_CHECK_MODE into the run-jenkins.sh script
2016-05-18 17:18:38 +02:00
Marek Safar 9c351d5028 Merge pull request #3003 from marek-safar/rs-NetworkInformation
[System] Common NetworkInformation code from referencesource
2016-05-18 16:18:28 +02:00
Miguel de Icaza 5676287097 Graduate the csproj/solution to completed - you can now build with the toplevel net_4_x.sln 2016-05-18 10:15:17 -04:00
Alexander Köplinger 4c466bc318 Merge pull request #3009 from akoeplinger/fix-sockettest-catch
[System] Get rid of useless catch-all clauses in SocketTest
2016-05-18 16:06:11 +02:00
Marek Safar d3b0701f62 [System] Common NetworkInformation code from referencesource 2016-05-18 16:02:38 +02:00
Jo Shields 388a9c96b0 [jenkins] Use VS2015, not 2013 2016-05-18 14:56:44 +01:00
Miguel de Icaza f0a3d89bec Remove [assembly:TargetFramework] as no other assembly uses it, and causes our msbuild to fail 2016-05-18 09:45:18 -04:00
Miguel de Icaza 0c8816daa6 [WIP] Important change: more comprehensive Makefile to support csproj-local on System.Design (#3006)
* Important change: more comprehensive Makefile to support csproj-local on System.Design

* Change the dependency

* update
2016-05-18 09:28:42 -04:00
Marek Safar ba81e38ecc [System] WebHeaderCollection from referencesource 2016-05-18 14:44:07 +02:00
Rolf Bjarne Kvinge e4d33f70d4 [System] Throw PlatformNotSupportedException if NetworkInformation.NetworkChange is used on watchOS. (#3010)
NetworkInformation.NetworkChange requires the SystemConfiguration framework,
which isn't available on watchOS.
2016-05-18 08:21:23 -04:00
Alexander Köplinger 15c311adab [ci] Move setting CFLAGS and MONO_CHECK_MODE into the run-jenkins.sh script
So we can further reduce the state we keep on Jenkins itself.
2016-05-18 14:16:12 +02:00
Alexander Köplinger 3d2ddac37f [System] Get rid of useless catch-all clauses in SocketTest
When one of the tests doesn't fail with the expected exception, we'd get just a useless message
like "TtlChangeoverflow #3" instead of the much more useful exception info + stacktrace that
NUnit catches when an unhandled exception is thrown.
2016-05-18 13:38:48 +02:00
lateralusX be0e803812 Fix for rare mono runtime crash during shutdown sequence on Windows.
During mono shutdown on windows there is, on rare occasions, an exception
in CloseHandle indicating the closure of an invalid handle. This exception
is normally a strong indication of a much more severe underlying problem,
a doubled close on a handle, that could lead to random data corruptions
and very hard to track bugs in random areas of the code. If the system reused
the handle for a different object that silently gets incorrectly closed by above
call, the above bug could manifest itself into some completely different issues,
so getting a consistent repro with the above exception with CloseHandle was a good
point to start tracking down the bug.

The exception throwed in CloseHandle boils down to the fact that threads
in thread pool's that have their finalizer run on shutdown can end up in
a scenario where the thread handle has already been closed elsewhere.

When the threads are finalized in mono_gc_finialize_threadpool_threads,
the handle on the internal thread object, stored in MonoInternalThread,
will be closed by the thread objects finializer in ves_icall_System_Threading_InternalThread_Thread_free_internal.
Under some rare occasions, one of the handles are not valid and will cause
the exception in CloseHandle or even worse, pointing to a complete different
kind of object, potentially closed by the threads finalizer, causing an instable
process with random behavior related to WIN32 objects (files, mutexes, threads, events etc).

The reason why it rarely manifests itself is due to a race between the finializer thread and the
main thread during shutdown. Main thread gives finalizer thread 2000 ms to complete its work and
if it’s time outs, the main thread won’t call the code that will run the finalizers,
mono_gc_finalize_threadpool_threads for the thread objects added to an internal list
by the finalizer thread, so if the finalizer takes more than 2000 ms to complete during shutdown
the bug won’t manifest itself. By increasing the wait time in mono_domain_finalize to for example INFINITE,
the repro of this bug will be 100% and not timing dependent anymore.

Turns out that the offending CloseHandle on the thread object happens at an
earlier point in time during shutdown, when mono_thread_manage tries to wait for
threads to complete manage thread it will do remove_and_abort_threads for background
threads still around. The way this works is that it will setup a list of thread handles
that it will wait for using WaitForMultipleObjects and then close the handles.
It turns out that the implementation of remove_and_abort_threads adds the wrong
handle to the list, not the duplicated handle but the original thread handle,
and that will trigger this bug, since the original thread handle will be closed
(and the duplicated handle will leak). The fix is to use the duplicated thread
handle instead of the original, similar to how it was already done in other similar methods, like build_wait_tids.
Sinces this bug seems to been around for quite some time and is a race related to managed threads and mono
shutdown sequence it could give other weird side effects on windows during shutdown
(since it could have closed a random WIN32 object instead of the intended thread).

Looking at Bugzilla, there is one bug that very well could be related to this specific problem, 10108:

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

This bug should most likely be retested with this fix to see if it still reproducible once merged into master.
2016-05-18 12:20:55 +02:00
Jo Shields 0ad934fb25 [jenkins] Use mingw64 to build, not 32 2016-05-18 10:48:01 +01:00
Miguel de Icaza d57d91565b [genproj] Updates to project generator and csproj files.
* Adds support for a handful of new command line arguments that we now use in the build.

* Always attempts to match to a project name, to get the proper project dependency.

* Update to support .exe and .dll in the generation.

* Remove warnings and some dead code

* Update the resulting csproj files based on running:

make update-csproj
make package-inputs
mono genproj.exe
2016-05-17 21:31:14 -04:00
Rodrigo Kumpera f1bc138d68 Merge pull request #3004 from xmcclure/gc-bridge-various
Various GC bridge cleanup from looking at bug #40844
2016-05-17 16:49:12 -07:00
Ludovic Henry 4f678b2ab0 [runtime] Remove support for NaCl 2016-05-17 17:43:37 -04:00
Alexis Christoforides d1c2c7172d Merge pull request #2250 from esdrubal/master
[System] Check SocketOptionName.ReuseAddress support.
2016-05-17 16:36:14 -04:00
Andi McClure 30967bc73c Add some comments in new/old gc bridges 2016-05-17 13:23:02 -04:00
Andi McClure 1189773812 Fix error message in sgen-bridge which does not list all options 2016-05-17 12:47:35 -04:00
Andi McClure 5bb6b470bc Remove redundant flag set in sgen-tarjan-bridge
bridge_processing_in_progress is set by sgen-tarjan-bridge.c at the
start and end of each bridge, although sgen-bridge sets this flag at
the same time.
2016-05-17 12:47:05 -04:00
Andi McClure 30cc8f4fd2 More accurate trace reporting duration of android gc bridge
There is some code that reports the length of a gc bridge operation in
sgen-stw. This is dead code dating from a period when gc bridges
occurred synchronously as part of a stop the world operation. The new
code globally tracks the end of the last stw and reports time since
then when the bridge thread completes.
2016-05-17 12:45:49 -04:00
Alexander Köplinger 066284a9ca Merge pull request #2979 from akoeplinger/tests-simplify
[tests] Simplify 'test-sgen' target logic in Makefile.am
2016-05-17 18:09:38 +02:00
Marek Habersack 977199d9e2 Merge pull request #2988 from radical/xbuild-fix-processwrapper
[xbuild] Fix ProcessWrapper to WaitForExit(..) before accessing ExitCode
2016-05-17 17:54:11 +02:00
Miguel de Icaza c101aaa155 Change Url for raw runtimes 2016-05-16 22:07:06 -04:00
Miguel de Icaza ad9b308279 Fix man page 2016-05-16 22:06:56 -04:00
Aleksey Kliger bb7e3289ed [runtime] MonoError-ize mono_compile_method
Mark it external only.  Runtime should use mono_compile_method_checked.
2016-05-16 19:10:54 -04:00
Aleksey Kliger (λgeek) 937968f14a Merge pull request #3001 from ludovic-henry/coop-blocking-rename
[coop] Use GC safe/unsafe macros inside the runtime
2016-05-16 18:33:18 -04:00
Alexander Köplinger 73b9bd1ddd Merge pull request #2987 from spouliot/ipv6only
[System][tests] Tweak Dns unit tests so it does not fail on an IPv6 only network
2016-05-16 23:33:14 +02:00
Zoltan Varga 536046d860 [arm] Align the stack to 16 bytes in mono_arch_get_call_filter () so it works on watchos. 2016-05-16 17:02:07 -04:00
Ludovic Henry 5674f16357 [coop] Use GC safe/unsafe macros inside the runtime
This allow the removal of MONO_(PREPARE|FINISH)BLOCKING and MONO(PREPARE|FINISH)_RESET_BLOCKING, which were not explicit in their intent, leading to confusion. This also harmonize how the product and the runtime transition between thread states.
2016-05-16 16:26:52 -04:00
Rodrigo Kumpera 0d9b17942f Merge pull request #2969 from ludovic-henry/coop-no-try-finally
[coop] Remove try { ... } finally { ... } blocks from wrappers + Fix state transitions in trampolines
2016-05-16 13:05:53 -07:00
Marek Safar b96de28591 Merge pull request #2999 from marek-safar/rs-FileWeb
[System] FileWebResponse/FileWebRequest from referencesource
2016-05-16 21:42:51 +02:00
Alexander Köplinger e5f5e64254 [System] Use common assertion api in IPAdressTest to fix monodroid build
`Assertion.Fail` isn't supported by NUnitLite in monodroid, use `Assert` instead to fix the build:

```
[12:29:46] /Users/builder/data/lanes/1845/88dbce4e/source/monodroid/tests/bcl-test/BclTests.csproj (default targets) ->
[12:29:46] /Library/Frameworks/Mono.framework/Versions/4.2.1/lib/mono/4.5/Microsoft.CSharp.Targets (CoreCompile target) ->
[12:29:46] 
[12:29:46] 	src/System/Test/System.Net/IPAddressTest.cs(282,4): error CS0103: The name `Assertion' does not exist in the current context
[12:29:46] 
[12:29:46] 	 14 Warning(s)
[12:29:46] 	 1 Error(s)
```
2016-05-16 21:05:58 +02:00
Marek Safar c1f06f09e2 [System] FileWebResponse/FileWebRequest from referencesource 2016-05-16 18:09:13 +02:00
Ludovic Henry 36e585e6bf [coop] Ensure exception handling is done in GC unsafe mode 2016-05-16 10:57:02 -04:00
Ludovic Henry 31ecf06447 [debug] Print MonoMethod pointer in mono_pmip output 2016-05-16 10:57:02 -04:00
Ludovic Henry 71dd4095a0 [coop] Assert that trampolines are called from GC unsafe code 2016-05-16 10:57:02 -04:00
Ludovic Henry adc2d06ddf [coop] The magic trampoline might be called from BLOCKING state 2016-05-16 10:57:02 -04:00
Ludovic Henry 5ed682646f [coop] Add default ftnptr eh callback 2016-05-16 10:57:02 -04:00
Ludovic Henry 1099ab5a14 [coop] Use unbalanced state switching functions for managed-to-native wrapper 2016-05-16 10:57:02 -04:00
Ludovic Henry 00af262fe2 [coop] Add possibly unbalanced state switching functions
This will be used by managed-to-native and native-to-managed wrappers, as well as trampolines, to switch between states. This is necessary as their calls might be unbalanced (a prepare blocking, without the corresponding finish blocking).
2016-05-16 10:57:02 -04:00
Ludovic Henry a34627addf [coop] Throw exception from finally clause in native-to-managed wrapper
If we do not throw it from the finally clause, then in case of a Thread.Abort, we will not rethrow the catched exception, but the ThreadAbortException, and this without using the callback, leading to native stack unwinding.
2016-05-16 10:57:02 -04:00
Ludovic Henry a936d1d021 [coop] Remove try { ... } finally { ... } from managed-to-native wrapper 2016-05-16 10:57:02 -04:00
Ludovic Henry 150d896d19 [coop] Remove support for invoke thunk wrapper
The support will be broken when we will introduce MonoHandle, as we can't pass the exception naked object ref around, but need to wrap it in a MonoHandle, while still in RUNNING mode.
2016-05-16 10:57:02 -04:00
Aleksey Kliger (λgeek) 88dbce4ebc Merge pull request #2993 from lambdageek/dev/monoerror-mono_string_from_utf16
[runtime] MonoError-ize mono_string_from_utf16
2016-05-16 10:13:19 -04:00
Marek Safar 13a64c5dab [System] Fixes build 2016-05-16 13:38:17 +02:00
Marek Safar c92f928ff8 [System] Authorization from referencesource 2016-05-16 12:13:52 +02:00
Marek Safar 86462930c9 Merge pull request #2995 from marek-safar/rs-IPAddress
[System] IPAddress from referencesource
2016-05-16 11:07:38 +02:00
lateralusX 8e1fe02546 Windows x64 full AOT support for mono/mini regression tests.
Fixes needed in order to get full AOT working for mono/mini regression tests on windows x64 builds (currently disabling the gsharedvt and dyncall tests).

Fixes are done in two main areas, exception and thread local storage support.

SEH exception handling enabled in order to catch CPU generated exceptions. All exception related regression tests pass with fix and runtime won't attempt to JIT any code since it is prevented when running with --full-aot startup argument.

Thread local storage (TLS) support was not complete on windows x64. When running full AOT the sgen allocator uses TLS for its allocator. AOT compiler will issues OP_TLS_GET_REG operations when compiling the “Alloc” methods. On win x64 this was not implemented, just the default OP_TLS_GET, meaning that methods compiled using OP_TLS_GET_REG was "silently" dropped when full AOT:ed compiled. At runtime, the sgen allocator would tried to locate the “Alloc” method but fails to find it and since this will cause an exception (that also needs the allocator to be used) and the program entered a loop that will end in a stack overflow crashing the program.

The fix implements OP_TLS_GET_REG and other needed support for win x64. It also fixes the offset calculation needed by full AOT builds (translating to correct runtime TLS key) for keys used by mono/mini regression tests. Since windows TLS support is a little more complex (two different conditions depending on where the TLS key gets allocated) the max size of tls_get_reg for amd64 has been increased from 32 to 64 byte as well.
2016-05-16 10:31:38 +02:00
Zoltan Varga fd4faf475b [reflection] Avoid force-setting klass->has_finalize for dynamic classes, compute it normally. Fixes #40953. (#2997) 2016-05-15 05:18:21 -04:00
Zoltan Varga 7e899a93fa [llvmonly] Avoid generating gsharedvt out wrappers for non-generic signatures. 2016-05-14 17:44:58 -04:00
Ivo Smits 31142140da Generate RSA keys using public exponent 65537 (was 17)
OpenSSL and the MS RSA CSP (Win7 x64) generate RSA keys with a public exponent of 65537. Smaller public exponents are not allowed by some specifications and may be rejected by other software.
2016-05-14 15:05:52 +02:00
Miguel de Icaza 2e3c90564a mkbundle commands for cross compilation. (#2970)
* Start of packager for mkbundle

* [mkbundle] Add fingerprint and directory at end of package

* [mkbundle] Update embedding file format, add support for --options, support for --runtime, chmod +x

* [driver] Add a way to parse arbitrary command line options

* [mkbundle] Align the assemblies on a page boundary, do not release directory buffer

* Work-around odd compiler error by using memcpy

* Update makefile

* Fix the windows build

* [Windows] Export the new mono_parse_options_from API

* Implement the various cross-compiler target fetching commands

* Clean
2016-05-13 21:32:14 -07:00
Marek Safar 008f7272d3 [System] IPAddress from referencesource 2016-05-13 18:14:56 +02:00
Marek Safar cc3f4c6037 [System] Replace few System.Net types with referencesource 2016-05-13 18:09:51 +02:00
Zoltan Varga 10ade09940 [coop] Avoid calling mono_marshal_set_last_error () in the managed-to-native wrapper inside the blocking block. Also make sure the prepare/finish_blocking jit icalls have no wrappers, so calling them doesn't involve trampolines. 2016-05-13 11:35:27 -04:00
Aleksey Kliger (λgeek) 022dd1d160 Merge pull request #2974 from lambdageek/dev/monoerror-misc_fixes
[runtime] Eliminate some mono_error_raise_exception calls
2016-05-13 11:07:00 -04:00
Zoltan Varga 9db20c4c04 Fix a warning. 2016-05-13 10:11:01 -04:00
Zoltan Varga a0ac9b08a5 [llvmonly] Make sure that linkonce methods need no initialization since they could be called before the AOT module they belong to is loaded. Still not enabled, since they seem to actually increase executable size. 2016-05-13 10:09:37 -04:00
Marek Safar 0f9ea1a279 [System] Remove unused files 2016-05-13 14:06:47 +02:00
Aleksey Kliger 9ace789ec9 [runtime] MonoError-ize mono_string_from_utf16
Marked it external only.  Runtime should use mono_string_from_utf16_checked

Also mark mono_string_from_utf32 as external only.

(It's currently unused in the runtime, but in the future
 mono_string_from_utf32_checked is available)
2016-05-12 17:43:43 -04:00
Marek Safar 7c4fb8caf0 Merge pull request #2984 from amccague/ping-task-fix
Resolved bug (8554) with Task Based Ping API
2016-05-12 23:24:05 +02:00
Alexander Köplinger 4b2901be9f Merge pull request #2990 from akoeplinger/fix-fsharp
[bcl] Add stub Mono.Posix.dll to 4.0 folder so FSharp bootstrapping works
2016-05-12 18:01:32 +02:00
Zoltan Varga 97ee981022 [arm] Make sure MONO_CONTEXT_GET_CURRENT () sets sp to an aligned value on watchos. 2016-05-12 11:51:02 -04:00
Alexander Köplinger d2d32de261 [bcl] Add stub Mono.Posix.dll to 4.0 folder so FSharp bootstrapping works
It was checking the existence of the file which doesn't work anymore after the -api rename.
This was already fixed upstream in https://github.com/fsharp/fsharp/pull/525 but the bootstrap package doesn't have the fix yet.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=41052
2016-05-12 17:48:26 +02:00
Aleksey Kliger 9f08e118d7 [runtime] MonoError-ize mono_mlist_{alloc,prepend,append}
Mark the various functions external only.  Runtime should use the
_checked variants.
2016-05-12 11:16:31 -04:00
Aleksey Kliger 45928aa532 [runtime] Eliminate some uses of mono_error_raise_exception 2016-05-12 11:16:31 -04:00
Aleksey Kliger 7e4a2c74db [cominterop] Get rid of uses of mono_error_raise_exception
in icalls
2016-05-12 11:15:28 -04:00
Aleksey Kliger fdcb21b071 [cominterop] MonoError-ize mono_string_from_bstr
Runtime should use mono_string_from_bstr_checked. The icall is
mono_string_from_bstr_icall. Marked mono_string_from_bstr external only.
2016-05-12 11:15:28 -04:00
Zoltan Varga 405bf02e72 Fix an bug added by 5b9f9751ba. 2016-05-12 10:01:51 -04:00
Alex Rønne Petersen ce381295d9 Merge pull request #2853 from alexrp/thread-name-improvements
More thread name improvements
2016-05-12 14:14:30 +02:00
Alex Rønne Petersen 828e6451c8 [threads] Add a missing mono_hazard_pointer_clear () in thread_cleanup (). 2016-05-12 14:12:24 +02:00
Alex Rønne Petersen ee47a43002 [threads] mono_thread_set_name_internal (): Rename 'managed' arg to 'permanent'.
The actual meaning is about whether or not the name is allowed to change after
having been set by the mono_thread_set_name_internal () call; it has nothing to
do with whether the call came from managed per se.
2016-05-12 14:12:23 +02:00
Alex Rønne Petersen 92664ed7ab [threads] Don't consider MONO_THREAD_FLAG_NAME_SET when setting thread name at thread startup.
If we did consider this, an internal runtime thread that had its name set by a
mono_thread_set_name_internal (..., FALSE /*managed*/, ...) call prior to
starting would not have its native name set nor its name reported to the
profiler.
2016-05-12 14:12:23 +02:00
Alex Rønne Petersen 373c59f3b7 [threads] Don't exempt thread pool threads from the 'name already set' check + exception.
MS.NET doesn't, so we shouldn't either.

Bug: https://bugzilla.xamarin.com/show_bug.cgi?id=23206
2016-05-12 14:12:22 +02:00
Alex Rønne Petersen 3e56d1901c [threads] Only mark a thread as having a name set if the given name is non-null.
This is consistent with MS.NET behavior.
2016-05-12 14:12:22 +02:00
Alex Rønne Petersen e598bc1ef5 [threads] Rename mono_thread_info_set_name () to mono_native_thread_set_name ().
This function has nothing to do with MonoThreadInfo structures, so the name is
somewhat misleading. It only requires a native thread ID.
2016-05-12 14:12:18 +02:00
Alex Rønne Petersen 595ebeeaef [domain] Remove an unnecessary call to mono_thread_info_set_name ().
We now do this in the thread main function.
2016-05-12 14:01:26 +02:00
Rolf Bjarne Kvinge da3cc8deb7 Bump nunit-lite to get compiler warning fix.
commit //github.com/mono/NUnitLite@7065bc89e8661cad447140752c0fce118644e06e
Author: Rolf Bjarne Kvinge <[email protected]>
Date:   Thu May 12 12:30:28 2016 +0200

    Fix compiler warning.
2016-05-12 12:41:47 +02:00
Zoltan Varga fbf8838abd [arm] Implement a dummy version of MONO_CONTEXT_GET_CURRENT () on watchos, only the sp register is set, this is the only one needed by sgen. 2016-05-12 06:15:23 -04:00
Zoltan Varga f1837ef103 [arm] Fix the DISABLE_JIT build. 2016-05-12 03:52:17 -04:00
Zoltan Varga 5b9f9751ba [aot] Add some MonoError machinery to aot-runtime.c. 2016-05-11 22:31:22 -04:00
Sebastien Pouliot 4d3ebc5a19 [System][tests] Make sure Dns tests works in a mixed IPv4/IPv6 network too
Previous tweak could disable some tests in a mixed network, e.g.
if an IPv6 address was first but an IPv4 address was available.
2016-05-11 17:50:01 -04:00
Ankit Jain d47f479ba4 [xbuild] Fix ProcessWrapper to WaitForExit(..) before accessing ExitCode
Process.Exited event can get invoked before the process has really
exited. So, accessing process.ExitCode before the real exit can throw:

Error executing task Exec: System.InvalidOperationException: Process must exit before requested information can be determined.
  at System.Diagnostics.Process.EnsureState (System.Diagnostics.Process+State state) [0x000b9] in /Users/ankit/dev/mono/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/Process.cs:1439
  at System.Diagnostics.Process.get_ExitCode () [0x00000] in /Users/ankit/dev/mono/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/Process.cs:219
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_ExitCode ()
  at Microsoft.Build.Utilities.ToolTask.ExecuteTool (System.String pathToTool, System.String responseFileCommands, System.String commandLineCommands) [0x00101] in /Users/ankit/dev/mono/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs:185
  at Microsoft.Build.Tasks.Exec.ExecuteTool (System.String pathToTool, System.String responseFileCommands, System.String commandLineCommands) [0x00026] in /Users/ankit/dev/mono/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Exec.cs:83
  at Microsoft.Build.Utilities.ToolTask.Execute () [0x0001c] in /Users/ankit/dev/mono/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs:128
  at Microsoft.Build.BuildEngine.TaskEngine.Execute () [0x00000] in /Users/ankit/dev/mono/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs:134
  at Microsoft.Build.BuildEngine.BuildTask.Execute () [0x0008f] in /Users/ankit/dev/mono/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs:101

ProcessWrapper.WaitForOutput depends on the
`endEventExit`(ManualResetEvent) to be set, which is done in the event
handler for Process.Exited . So, effectively, WaitForOutput can return
before the process has really exited and ToolTask ends up throwing an
exception when it accesses the ExitCode.

Fix: Add a WaitForExit in WaitForOutput, to be sure!
2016-05-11 17:43:23 -04:00
Vlad Brezae 3c2fd4f371 Merge pull request #2971 from BrzVlad/feature-cross-binprot
[sgen] Cross platform binary protocol grep
2016-05-11 22:37:35 +03:00
Alexander Köplinger 0b8de1daf4 Merge pull request #2986 from akoeplinger/fix-mono310-bootstrapping
[System] Rename variable to fix bootstrapping with Mono 3.10 mcs
2016-05-11 21:29:21 +02:00
Marek Safar 93efeaebd5 [corlib] Put back instance creation using activation attributes. Fixes #40758 2016-05-11 18:27:40 +02:00
Ludovic Henry 7cb3a53502 Merge pull request #2982 from ludovic-henry/fix-cross-monocontext
Revert "[MonoContext] Make cross compiler a specific case"
2016-05-11 11:09:49 -04:00
Sebastien Pouliot 2114a13b23 [System][tests] Tweak Dns unit tests so it does not fail on an IPv6 only network
Some existing tests only works when IPv4 is available, which was fine as
it match how we historically ran those tests.

Apple has a new requirement [1] to test under an "IPv6 only network" and
the change facilitate this.

[1] https://developer.apple.com/news/?id=05042016a
2016-05-11 09:11:17 -04:00
Alexander Köplinger 04dcc661c6 Merge pull request #2985 from akoeplinger/fix-bug39305
[corlib] Make CountdownEventTests.Signal_Concurrent more reliable
2016-05-11 14:57:20 +02:00
Zoltan Varga c78cc36a0f [arm] Implement hardfp support in gsharedvt. Store the caller/callee CallInfo into GSharedVtCallInfo and iterate over it instead of extending the slot based code for simplicity. 2016-05-11 12:55:47 +00:00
Alexander Köplinger b56e03aa19 [System] Rename variable to fix bootstrapping with Mono 3.10 mcs
We were seeing compilation errors like this:

```
System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtension.cs(71,20): error CS0135: `oid' conflicts with a declaration in a child block
System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtension.cs(74,17): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 38 warnings
make[9]: *** [../../class/lib/basic/secxml/System.dll] Error 1
```

The new foreach variables introduced in 4a6e5d24e1 with the same "oid" name as the global constant apparently confused the older mcs compiler.

Rename them to avoid this.
2016-05-11 14:37:24 +02:00
Alexander Köplinger 5745b945a2 [corlib] Make CountdownEventTests.Signal_Concurrent more reliable
We were seeing random failures of the test in the iOS simulator and devices.

Looking at the test, it seems to me like the 1000ms timeout is just too short. In a single iteration we're
enqueuing 500 threadpool workitems and effectively give each of them just 2ms to run and signal the CountdownEvent.

Indeed I can easily repro this in the simulator on my box if I lower the timeout to 900ms.
This may be a side effect of the new threadpool which starts threads more conservatively afaik.

Bumping the timeout should fix this.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=39305
2016-05-11 14:12:28 +02:00
amccague c025009af8 Task Based Ping - removed illegal use of ?. 2016-05-11 13:06:15 +01:00
amccague a342863ba1 Resolved bug (8554) with Task Based Ping API
https://bugzilla.xamarin.com/show_bug.cgi?id=8554

Added unit tests to cover the Asynchronous API and the Task Based API.

Fixed an issue with the Task Based API that would previously throw a
`NullReferenceException` when started as the `CancellationTokenSource`
was not instantiated.
The `CancellationTokenSource` was also not disposed of after use.
2016-05-11 12:23:05 +01:00
amccague b1a2ead659 Merge remote-tracking branch 'mono/master' into ping-task-fix 2016-05-11 12:04:53 +01:00
Marek Safar 9c20705142 Merge pull request #2973 from marek-safar/rs-Uri
[System] Uri handling from reference source
2016-05-11 12:23:48 +02:00
Marek Safar 0c44dca122 [System] Uri handling from reference source
Fixes many issues in our uri handling
2016-05-11 09:59:46 +02:00
Zoltan Varga a5a388c82b [arm] Remove the unfinished nacl codegen code. 2016-05-11 07:36:20 +00:00
Zoltan Varga 73476d6b25 [arm] Implement hardfp support for dyncalls. 2016-05-11 07:18:24 +00:00
Zoltan Varga 3e78728d42 [arm] Fix float32 + hardfp support. 2016-05-11 06:38:08 +00:00
Aleksey Kliger (λgeek) b7f0eb2352 Merge pull request #2983 from akoeplinger/fix-bug40462
[corlib] Ignore DirectoryNotFoundException in FileStreamTest.OpenCharDeviceRepeatedly test
2016-05-10 17:06:54 -04:00
Ludovic Henry c520a61c43 [MonoContext] Fix sgen STW cross compilation 2016-05-10 15:45:45 -04:00
Alexander Köplinger 8fd52718cf [corlib] Ignore DirectoryNotFoundException in FileStreamTest.OpenCharDeviceRepeatedly test
It seems that older iOS6 devices don't allow access to /dev, as a DirectoryNotFoundException is
thrown when accessing /dev/zero in the FileStreamTest.OpenCharDeviceRepeatedly test there.

Ignore this exception and the test in those cases.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=40462
2016-05-10 21:05:32 +02:00
Ludovic Henry 1832571ad8 Revert "[MonoContext] Make cross compiler a specific case"
This reverts commit 09ae5b01c1.

This would break the XA and XI builds
2016-05-10 14:31:20 -04:00
Marek Safar 4176bb2dae Merge pull request #2981 from rolfbjarne/fix-rebuild-offsets-tool
[offsets-tool] Only create the .stamp-clone file if the clone succeeds.
2016-05-10 20:12:51 +02:00
Rolf Bjarne Kvinge cde9cf18cb [offsets-tool] Only create the .stamp-clone file if the clone succeeds.
This makes rebuilds work if the clone was cancelled.
2016-05-10 19:56:48 +02:00
Martin Baulig 5a701f39c7 [System]: Lazy-init X509ChainPolicy.ExtraStore when called from SystemCertificateValidator. Fixes #40899.
AppleTLS supports a lazily-initialized X509Certificate, but not X509Certificate2 so
we need to fall-back to using Mono.Security.X509 whenever we need an X509Certificate2.
To avoid unnecessary fallbacks, the private Mono.Net.Security APIs use X509Certificate
instead of X509Certificate2.

Since 'ExtraStore' returns X509Certificate2Collection, we need to convert these to
X509Certificate2.

(cherry picked from commit 05e2372339)
2016-05-10 13:40:33 -04:00
Ludovic Henry 22f277ad8d Merge pull request #2978 from ludovic-henry/coop-fix-reset-blocking
[threads] Fix reset blocking state transition
2016-05-10 13:38:02 -04:00
amccague f5e911b6b7 Merge remote-tracking branch 'mono/master' into ping-task-fix 2016-05-10 17:27:56 +01:00
Marek Safar 9324584359 Merge pull request #2933 from ludovic-henry/referencesource-monitor
[corlib] Import System.Threading.Monitor
2016-05-10 17:50:11 +02:00
Marek Safar 84e33bab27 [mcs] More tweaks to undefined tie-breaking rules. Fixes #40945 2016-05-10 17:38:04 +02:00
Zoltan Varga 1dbc9ab66b [llvmonly] Avoid sharing refs and intptrs in gsharedvt wrappers, it doesn't work yet. 2016-05-10 05:59:51 -04:00
Zoltan Varga 5f217496bc [llvmonly] Disable linkonce methods, they don't work yet. 2016-05-10 05:57:25 -04:00
Zoltan Varga 2e23232e33 [runtime] Check for a null argument in mono_monitor_enter_v4_fast () before calling mono_monitor_try_enter_internal (), the latter would set a pending exception, but the JITted code calling enter_v4_fast () doesn't check for it. 2016-05-10 02:17:49 -04:00
Zoltan Varga c42ecf6144 [jit] Set the real_offset of inlined bblocks to the il offset where the method was inlined, so get_most_deep_clause () in llvm works correctly with inlined methods. 2016-05-10 01:58:14 -04:00
Zoltan Varga 907d67487e [llvmonly] Transform the error returned by init_method () into an exception and throw it, it can be an exception thrown by a cctor. 2016-05-10 01:58:14 -04:00
Alexander Köplinger 274a79653a [tests] Simplify 'test-sgen' target logic in Makefile.am
The sgen tests should run on Windows x86 too (or at least they will in the near future), so we can get rid of all the special casing.
This also fixes an error in the ARM64 test run on Jenkins because test-sgen wasn't defined there.
2016-05-10 02:36:47 +02:00
Vlad Brezae 37006b206e [sgen] Support binary protocol cross platform grep-ing across platforms with unequal word sizes 2016-05-10 02:32:54 +03:00
Vlad Brezae 3eb249ce86 [sgen] Pack structs for binary protocol entries
We save space and support cross platform grep-ing across platforms with the same word size.
2016-05-10 02:31:43 +03:00
Vlad Brezae 932d9b3115 [sgen] Split protocol entry grep from argument parsing 2016-05-10 02:31:42 +03:00
Vlad Brezae 6b35377caa [sgen] Extract entry stream code into new file 2016-05-10 02:31:42 +03:00
Vlad Brezae 8e469b9d3d [sgen] Use types with explicit size for protocol entries, on the reader end 2016-05-10 02:31:40 +03:00
Ludovic Henry 2653868a27 [threads] Fix reset blocking state transition
There would previously be a race between reset blocking and a STW, that would happen as follow:
 - T1 goes into blocking - T1 state is BLOCKING(0)
 - T2 suspends T1  - T1 state is BLOCKING(1)
 - T1 does a reset blocking -> T1 state is SELF SUSPEND REQUESTED
 - T2 calls `mono_thread_info_get_suspend_state` on T1 --- SIGABRT as we cannot get suspend state when state is SELF SUSPEND REQUESTED
 - T1 does polling -> T1 state is SELF SUSPENDED

The fix is for reset blocking to work like done blocking: switch to BLOCKING AND SUSPENDED.
2016-05-09 19:10:43 -04:00
Alexander Köplinger 5099acaed4 Use available memory instead of physical memory as metric for allocation-heavy tests
We were seeing issues on the new Jenkins Azure boxes which had 7GB of physical memory but only about 1GB free at the time of the test, so it'd fail.
Checking the available memory should fix this.
2016-05-10 00:26:04 +02:00
Aleksey Kliger (λgeek) 65ab352de4 Merge pull request #2967 from lambdageek/dev/coop-threadpool-exceptions5
[runtime] Pending exception takes precedence over Thread.Abort ()
2016-05-09 15:11:47 -04:00
Aleksey Kliger (λgeek) 8ce78a5bd5 Merge pull request #2954 from lambdageek/dev/monoerror-field_static_get_value
MonoError for mono_field_static_get_value
2016-05-09 14:56:50 -04:00
Neale Ferguson 3f880e2bcf Fix checking of header environment variable 2016-05-09 12:57:38 -04:00
Aleksey Kliger 701965dc26 [runtime] Pending exception takes precedence over Thread.Abort ()
If there's a pending exception and an AbortRequested, the pending
excpetion should be thrown.

This fixes threadpool-exceptions5.cs in coop mode.

There are two situations where this could happen.

1. Like threadpool-exception5.cs we have a threadpool worker thread
  request an abort and then its async callback runs and throws an
  exception.  In this case apparently the async callback's exception
  should be allowed to unwind and hit the unhandled exception handler.

2. A thread catches ThreadAbortException and then posts a pending
  exception of some other excpetion from the catch clause.  In this case
  we unwind that other exception, and when it's caught we rethrow the
  abort.
2016-05-09 12:13:33 -04:00
Marek Safar 93b11fcdc9 [System] Cleanup uri tests 2016-05-09 17:39:13 +02:00
Aleksey Kliger 57b1ae750f [runtime] MonoError-ize mono_field_static_get_value
Mark it external only.  Runtime should use mono_field_static_get_value_checked.
2016-05-09 11:04:43 -04:00
Aleksey Kliger 30cebd4c3f [runtime] MonoError-ize mono_field_static_get_value_for_thread 2016-05-09 11:04:43 -04:00
Aleksey Kliger e027a53e15 [runtime] MonoError-ize get_default_field_value 2016-05-09 11:04:43 -04:00
Aleksey Kliger 488b3a09e9 [runtime] MonoError-ize mono_get_constant_value_from_blob 2016-05-09 11:04:43 -04:00
Zoltan Varga 55e3dbe9cb [arm] Enable native types for Xamarin.WatchOS.dll too. Enable Unwind_Backtrace support on watchos. 2016-05-09 07:15:51 -04:00
Zoltan Varga b244fd9303 [llvm] Enable OP_LADD_OVF opcodes on 32 bit platforms too. Avoid optimizing long shift opcodes when using llvm. Enable support for hardfp calling conventions on arm. 2016-05-09 07:14:50 -04:00
Zoltan Varga f257b5b3eb [arm] Use the hardfp abi on watchos. 2016-05-09 07:11:21 -04:00
Zoltan Varga 120dcce23f [ppdb] Avoid using pdb files for assemblies which are not compiled by csc using /debug:portable. Fixes #40886. 2016-05-08 21:13:38 -04:00
Zoltan Varga 8891a6d142 [llvm] Add support for OP_GC_SAFE_POINT. 2016-05-08 18:51:49 -04:00
Zoltan Varga 3e844ddcda [arm] Align the stack correctly in the gsharedvt trampoline on platforms with frame alignment greater than 8 (watchos). 2016-05-06 18:22:42 -04:00
Zoltan Varga 6da2178dd8 [arm] Define MONO_ARCH_DISABLE_HW_TRAPS on watchos. 2016-05-06 18:22:42 -04:00
Martin Baulig 209c8fc0dd [System]: Fix certificate validation with empty hostname.
When the system certificate validator is invoked with an empty hostname
(caller does not want us to validate the hostname), then we need to pass
null to SecPolicyCreateSSL() and not the empty string.

(cherry picked from commit f29804d149)
2016-05-06 16:11:55 -04:00
Martin Baulig 352b979ccd [System]: Add comment to the obsoletion of Mono-specific ServicePointManager APIs.
(cherry picked from commit 1b4921b573)
2016-05-06 15:58:55 -04:00
Martin Baulig 8b8d688fef [System]: Obsolete the Mono-specific cipher suite callbacks in ServicePointManager.
(cherry picked from commit fa75386bb8)
2016-05-06 15:58:44 -04:00
Martin Baulig 67d87ebc1e [corlib]: Cleanup X509Helper.Import().
Only attempt the automatic PEM->DER conversion when no password was given
and make this version of X509Helper.Import() also take care of the fallback.

(cherry picked from commit 63a214c3f0)
2016-05-06 15:58:44 -04:00
Aleksey Kliger (λgeek) b5bde9cf42 Merge pull request #2968 from lambdageek/dev/coop-unify-jit_thread_attach
[runtime] Unify codepath in mono_jit_thread_attach
2016-05-06 13:33:38 -04:00
Aleksey Kliger 1775972396 [runtime] Unify codepath in mono_jit_thread_attach
Previously we had separate codepaths in mono_jit_thread_attach for coop
and non-coop modes.

Now there's a common codepath for attaching the thread, and separate
code paths for performing coop state machine transitions and computing
the return value cookie.

Fixes Mono.Debugger.Soft tests under coop.
2016-05-06 10:26:12 -04:00
Rodrigo Kumpera d36d16618f Merge pull request #2963 from ludovic-henry/fix-unified-suspend
[threads] Fix some unified suspend bugs
2016-05-05 19:21:56 -04:00
Ludovic Henry 8796c59f1c [sgen] Fix possible race condition between world stop and restart 2016-05-05 16:52:30 -04:00
Ludovic Henry 69e950a4b7 [sgen] Do not skip starting and detaching thread during suspend
By skipping thread which have a NULL domain or lmf, we would also skip threads which are in RUNNING mode, but which are still attaching to the runtime. They could have in practice called `mono_thread_info_attach`, without having executed any managed code or set a domain yet. Because we would simply discard the suspending for these threads, we could potentially not suspend them, meaning they would keep running, even potentially run some managed code, while the GC is still running.

To fix that, we need to slightly modify the expectation of sgen STW when using unified suspend. The non-unified expectation of sgen STW would be that even if a thread has a non-initialized domain or lmf, it should still be suspended, but not scanned. The unified expectation of sgen STW would be that if a thread has a non-initialized domain or lmf, then the thread shouldn't be suspended. That second behaviour works well if we only consider that the domain or lmf could be non-initialized when the thread is detaching, but that consideration is just wrong. The main example is the beginning of `start_wrapper_internal` (in threads.c:637), where we have non-initialized domain and lmf, but where the thread is in RUNNING state, and about to access some managed memory.
2016-05-05 16:52:30 -04:00
Ludovic Henry 73a74eb0d7 [threads] Correct comment 2016-05-05 16:50:45 -04:00
Ludovic Henry 01e9012f97 [sgen] Improve STW debugging output 2016-05-05 16:50:45 -04:00
Ludovic Henry 218d8617d1 [threads] Make debugging output consistent
Other THREAD_SUSPEND_DEBUG would print the native thread TID, instead of the MonoThreadInfo*
2016-05-05 16:50:45 -04:00
Ludovic Henry 5f9fdd4556 [threads] Increase state machine verbosity when crashing 2016-05-05 16:50:45 -04:00
Ludovic Henry 0df82bae4b [threads] Fix segfault 2016-05-05 16:49:59 -04:00
Ludovic Henry 443d9d9700 [suspend] Don't try to suspend an already suspended thread 2016-05-05 16:49:59 -04:00
Ludovic Henry 5ac3f66978 [threads] Fix compilation warning 2016-05-05 16:49:59 -04:00
Ludovic Henry afe5b55f31 [sgen] Add some assertion for stack start and end 2016-05-05 16:49:59 -04:00
Ludovic Henry 8585306f73 [tests] Add sgen-new-threads-dont-join-stw-2 2016-05-05 16:48:31 -04:00
Ludovic Henry b34681ec2f [threads] Be more verbose in the case of an error 2016-05-05 16:48:31 -04:00
Ludovic Henry 3a76359581 [runtime] Use utils mono_thread_info_yield 2016-05-05 16:48:31 -04:00
Vlad Brezae 7429b9e1c4 [sgen] Remove old unused defines 2016-05-05 23:32:00 +03:00
Ludovic Henry b6eeb4d398 Merge pull request #2948 from ludovic-henry/coop-n2m-eh-callback
[marshal] Add EH callback for native-to-managed wrapper
2016-05-05 15:18:44 -04:00
Aleksey Kliger (λgeek) f0ad12b3e6 Merge pull request #2965 from lambdageek/dev/checked-pinvoke3
[coop] Allow BLOCKING->DETACHED transition
2016-05-05 13:18:47 -04:00
Zoltan Varga ad78b9f5ac Fix the cross compiler build. 2016-05-05 13:10:41 -04:00
Ludovic Henry 3265991ed9 Merge pull request #2964 from ludovic-henry/sgen-monocontext
[MonoContext] Migrate remaining architectures + [sgen] Kill USE_MONO_CTX and ARCH_NUM_REGS
2016-05-05 08:46:12 -04:00
Marek Safar 73537bbf06 Merge pull request #2966 from marek-safar/oid
[System] Oid from referencesource
2016-05-05 09:15:14 +02:00
Martin Baulig 0adfeefedd [corlib]: Try to convert the certificate from PEM to DER in X509Helper.Import(). 2016-05-04 20:05:37 -04:00
Alex Rønne Petersen 4e751100fc Merge pull request #2928 from alexrp/master
[profiler] Fix profiler compilation under bitcode.
2016-05-05 00:52:19 +02:00
Marek Safar 4a6e5d24e1 [System] Oid from referencesource. Fixes #40646 and other incompabilities 2016-05-04 23:59:22 +02:00
Ludovic Henry 873e0145c3 [corlib] Import System.Threading.Monitor 2016-05-04 16:13:10 -04:00
Ludovic Henry 45b8807844 Merge pull request #2955 from ludovic-henry/mono_msec_ticks-overflow
[runtime] Fix potential overflow when using mono_msec_ticks
2016-05-04 16:01:16 -04:00
Aleksey Kliger 7841b0a319 [coop] Allow BLOCKING->DETACHED transition.
On coop, an OS thread can go
STARTING->BLOCKING->RUNNING->BLOCKING->DETACHED.

For ordinary managed threads BLOCKING->DETACHED is still a bug like
before, but hopefully the checked build machinery will help us to catch
those situations.
2016-05-04 14:58:26 -04:00
Aleksey Kliger c20d1a9479 [checked] Use correct reset blocking cookie when attaching OS threads
When checked build is running with GC checking, it uses a non-zero
integer cookie instead of the thread info pointer.

This fixes pinvoke3.cs test_43_thread_attach() in checked coop builds.
2016-05-04 14:58:26 -04:00
Ludovic Henry 6eae03402a [marshal] Add EH callback for native-to-managed wrapper
This is going to be used by Xamarin.iOS to convert a managed exception to an Obj-C exception. We need this as if we don't do that, the managed exception mechanism will unwind native stack, which can lead to undefined behavior. By converting to an Obj-C exception, we let the native exception mechanism do what it's supposed to do.
2016-05-04 12:05:47 -04:00
Ludovic Henry 45d7c18d23 [marhsal] Always generate try { ... } finally { ... } in native-to-managed wrapper 2016-05-04 11:59:20 -04:00
Marek Safar 39ebee1253 [corlib] Update locale tables. Fixes #40697 2016-05-04 15:05:28 +02:00
Marek Safar d70777a333 Merge pull request #2962 from marek-safar/referencesource-submodule-move
Submodule referencesource removal
2016-05-04 08:16:55 +02:00
Zoltan Varga 5b5d0f8a3d [aot] Emit EmptyArray<enum>:.cctor () instances since mcs now generates accesses to EmptyArray<enum>.Value for new enum[0] expressions. 2016-05-03 17:37:51 -04:00
Ludovic Henry a665613192 [sgen] Kill USE_MONO_CTX and ARCH_NUM_REGS 2016-05-03 17:34:15 -04:00
Ludovic Henry 09ae5b01c1 [MonoContext] Make cross compiler a specific case 2016-05-03 17:14:57 -04:00
Ludovic Henry 2555869fcf [sgen] Make Sparc use MonoContext 2016-05-03 17:11:51 -04:00
Ludovic Henry f0a2c8ef30 [sgen] Make PowerPC use MonoContext 2016-05-03 17:11:49 -04:00
Ludovic Henry 71d181c3b3 [runtime] Fix potential overflow when using mono_msec_ticks
Because mono_msec_ticks would previously return the number of milliseconds since boot time, it would overflow after ~49 days. That would mean that anywhere you would use it, you would need to be careful of arithmetic overflow.

By simply returning a gint64 we will not overflow before ~30k years.

Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=38666
2016-05-03 14:15:25 -04:00
Marek Safar 79fa40e7f2 Remove referencesource submodule and move sources to mcs/class/referencesource
This simplified PR workflow and makes branching easier
2016-05-03 13:34:32 +02:00
Marek Safar e223b6f140 Update after merge conflicts 2016-05-03 12:49:05 +02:00
Marek Safar e518101d9f Unify error handling added in fdebd8a4d709002bb499555c35e1dfd3834e2f4f 2016-05-03 11:45:09 +02:00
Alexander Köplinger e83619a710 Raise an UnauthorizedAccessException on FileInfo.Delete with a directory
When FileInfo was imported in https://github.com/mono/mono/commit/bdd0de7ee52d9675dada0d19985b9daf4edab5bc the check in Delete()
got removed that raised an UnauthorizedAccessException when the FileInfo object holds a path to a directory instead of a file.

It happened to pass the MonoTests.System.IO.FileInfoTest.Delete_Directory test on OSX because unlink returns EPERM there
which got turned into the expected UnauthorizedAccessException, but on Linux it returns EISDIR so the test would fail.

Fix is to put the explicit check for directory back.
2016-05-03 11:45:09 +02:00
Marek Safar cfedfb76ad Mono friendly FileInfo 2016-05-03 11:45:09 +02:00
Marek Safar 7c78315c70 Mono friendly FileSystemInfo 2016-05-03 11:45:09 +02:00
Ludovic Henry e070b05e04 Fix WaitHandle.Wait{One,Any,All} when runtime returns WAIT_FAILED
In case the runtime would fail to wait on the wait handle(s), we would still return true, as if the WaitHandle was successfully signaled.
2016-05-03 11:45:08 +02:00
Marek Safar 9f6370d2c9 Remove MONO_X509_ALIAS 2016-05-03 11:45:08 +02:00
Alexis Christoforides 62d78a5234 Re-apply compatibility fix from 42504b8af5a0bf7f012e6c40668659ca45fd4e22, it was eaten up by the .NET 4.6 merge. Fixes #38712 2016-05-03 11:45:08 +02:00
Ludovic Henry 63eb8475d8 Fix HasExited for non-child process
NativeMethods.GetExitCodeProcess would inherently be broken on Unix platforms for non-child processes as it can't succesfully get the exit code. This would in turn break Process.HasExited, which should not break, as it is possible to check if a non-child process is alive or dead.
2016-05-03 11:42:43 +02:00
Andi McClure 61edfafacf Adapt System.Exception to be usable by Mono 2016-05-03 11:42:43 +02:00
Marek Safar fa115cfaf1 SymbolType in reflection only profiles 2016-05-03 11:42:43 +02:00
Marek Safar a0d5b2513b Mono friendly SymbolType 2016-05-03 11:42:43 +02:00
Marek Safar b2c34433d5 Better error message for missing codeset assembly 2016-05-03 11:42:43 +02:00
Marek Safar 502db1d684 Fixes hardcoded Windows path in Serialization compiler 2016-05-03 11:42:42 +02:00
Marek Safar 86659c322e More DISABLE_CAS_USE tweaks 2016-05-03 11:42:42 +02:00
Marek Safar 4bb1910666 Add CSC_SDK_PATH_DISABLED workaround 2016-05-03 11:42:42 +02:00
Marek Safar 9a925e3842 Mono friendly RuntimeEnvironment 2016-05-03 11:42:42 +02:00
Marek Safar df05a171cf Add feature option to build without System.Runtime.Serialization 2016-05-03 11:42:42 +02:00
Marek Safar 65547ad990 Replace string resource key names with local constants 2016-05-03 11:42:41 +02:00
Ludovic Henry 97a27a7c04 Import System.Threading.WaitHandle 2016-05-03 11:42:41 +02:00
Andi McClure fa63cd35ed Remove Marshal.GetHRForLastWin32Error call from Diagnostics.Process
GetHRForLastWin32Error breaks the build on AOT, and even on non-AOT is unimplemented.
2016-05-03 11:42:41 +02:00
Ludovic Henry 71c5cb404a Revert "[mscorlib] Undo part 3d0e1b71993dd236db78290852a62e9ed3218216 of which breaks build"
This reverts commit 0cb499950a7ae61c62c433c8cce353d535dbd09e.
2016-05-03 11:42:41 +02:00
Marek Safar 68b0fce81c Undo part 3d0e1b71993dd236db78290852a62e9ed3218216 of which breaks build 2016-05-03 11:42:41 +02:00
Marek Safar 14fd72a958 Mono friendly MethodInfo 2016-05-03 11:42:40 +02:00
Ludovic Henry e10efa398b Import System.Diagnostics.Process 2016-05-03 11:42:40 +02:00
Marek Safar 29ca3f2f1f Disable AppContextDefaults 2016-05-03 11:42:40 +02:00
Timotheus Pokorra 99c3ee5a17 fixing display of asmx help page (#37137)
if MONO_BROKEN_CONFIGURATION_DLL is defined, make sure that actualPath always gets set
2016-05-03 11:42:40 +02:00
Marcos Henrich 10270723c3 Unix paths fix
DiscoveryClientProtocol.GetRelativePath was harcoded to use '\\'.

Fixes #36116
2016-05-03 11:42:40 +02:00
Alexander Kyte 8056732b2a Only use patched AesManaged on MONOTOUCH 2016-05-03 11:42:39 +02:00
Marek Safar 29a24b8538 Fixes a race in CancellationTokenSource with no logic change. Fixes #32768
It's not easy to trigger but following repro works fairly reliably

using System;
using System.Threading;

class MainClass
{
	public static void Main (string [] args)
	{
		var r = new Random ();
		for (int i = 0, total = 10000000; i < total; ++i) {
			if (i % 50 == 0)
				Console.WriteLine ("{0}/{1}", i, total);

			var c1 = new CancellationTokenSource ();
			var wh = c1.Token.WaitHandle;
			GC.Collect ();
			c1.CancelAfter (r.Next(5));
			c1.Dispose ();
		}
	}
}

It crashes like

Unhandled Exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.ManualResetEvent'.
  at System.Threading.WaitHandle.CheckDisposed () <0x1f95be0 + 0x0005c> in <filename unknown>:0
  at System.Threading.EventWaitHandle.Set () <0x1f8d320 + 0x0007d> in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Threading.EventWaitHandle:Set ()
  at System.Threading.CancellationTokenSource.NotifyCancellation (Boolean throwOnFirstException) <0x1d92c70 + 0x00084> in <filename unknown>:0
  at System.Threading.CancellationTokenSource.Cancel (Boolean throwOnFirstException) <0x1d92330 + 0x00030> in <filename unknown>:0
  at System.Threading.CancellationTokenSource.Cancel () <0x1d92300 + 0x00025> in <filename unknown>:0
  at System.Threading.CancellationTokenSource.TimerCallbackLogic (System.Object obj) <0x1d925c0 + 0x0005d> in <filename unknown>:0
2016-05-03 11:42:39 +02:00
Marek Safar aa04c66583 Compute InvariantCaseInsensitiveHashCode without any culture data initialization. Fixes #37583 2016-05-03 11:42:39 +02:00
Rolf Bjarne Kvinge 6fc91cacbe Add support for intercepting threadpool work.
This is used to Xamarin.iOS to wrap threadpool work in an NSAutoreleasePool.
2016-05-03 11:42:39 +02:00
Rolf Bjarne Kvinge a8bd1c9197 Add feature define for multiple appdomains. 2016-05-03 11:42:39 +02:00
Marek Safar 0ab9a9a305 Remove WindowsBase type forwarders from mobile profile 2016-05-03 11:42:38 +02:00
Alexander Köplinger 0b65c9719e Revert "[System] Mono friendly QEncodedStream"
This reverts commit 5a7abfc46054c02fabde6398b7514a0fcff06cb7.

The code should be added to Mono's Uri instead.
2016-05-03 11:42:38 +02:00
Alexander Köplinger 37083826c2 Add a few MONO comments for System.Net.Sockets 2016-05-03 11:42:38 +02:00
Alexander Köplinger 4349e51224 Mono friendly QEncodedStream
Mono's Uri class doesn't have IsAsciiLetter, so we need to copy the MS implementation into QEncodedStream.
2016-05-03 11:42:38 +02:00
Marek Safar e531197ca0 Fix invariant text info hashcode builder. Fixes #36786 2016-05-03 11:42:38 +02:00
Marek Safar 4b0559c474 Cannot use regex fallback as its implementations is incompatible 2016-05-03 11:42:37 +02:00
Marek Safar 553a760680 Disable regex fallback on Mono 2016-05-03 11:42:37 +02:00
dotnet-bot 215901f51b Update Reference Sources to .NET Framework 4.6.1 2016-05-03 11:42:37 +02:00
Marek Safar 10e54be5f8 Mono exception to SocketException 2016-05-03 11:40:06 +02:00
Zoltan Varga 1704dc7618 Remove a workaround for a JIT limitation which doesn't exist any more. 2016-05-03 11:40:06 +02:00
Sebastien Pouliot 8b146afe46 Disable use of Win32 specific p/invokes when built for the mobile profile 2016-05-03 11:40:06 +02:00
Sebastien Pouliot 0ca9cb1cef Do not include a win32-p/invoke call (RegCloseKey) for the mobile profile 2016-05-03 11:40:06 +02:00
Sebastien Pouliot 3c5294a89f Use DISABLE_CAS_USE to remove the use of several *Permission calls (forcibly removed by the linker on XI) [#36255] 2016-05-03 11:40:05 +02:00
Tarek Mahmoud Sayed 6c637dbe2b Port the DateTime parser fix from the Desktop
This change is fixing the DateTime parser in cases of date/time strings for cultures which has the date and time separators are same. This happen with Norway, Serbia and Finland cultures

[tfs-changeset: 1513801]
2016-05-03 11:40:05 +02:00
Miguel de Icaza d5344d8f1f Bring from CoreFX the f813aa2e9a5d927d121d6bdca467e10e9a6e0c9b fix for Asin and Acos 2016-05-03 11:40:05 +02:00
Rolf Bjarne Kvinge e4e9fa3599 Thread.Interrupt is not dependent on MONO_FEATURE_THREAD_SUSPEND_RESUME. 2016-05-03 11:40:05 +02:00
Rolf Bjarne Kvinge 1dd9bcf3d5 Make Thread.Abort and Thread.Suspend/Resume configurable features. 2016-05-03 11:40:04 +02:00
Marek Safar 90630a8260 Add legacy mobile api to synchronizationcontext 2016-05-03 11:40:04 +02:00
Marek Safar 380ad5efeb Mono friendly StringUtil 2016-05-03 11:40:04 +02:00
Marek Safar defaa3fe98 Tweaks for mobile profile 2016-05-03 11:40:04 +02:00
Martin Baulig e77a6b7a7c Attempt to fix the build. 2016-05-03 11:40:04 +02:00
Immo Landwerth 9832a80540 Make it more obvious that Reference Source is read-only 2016-05-03 11:38:06 +02:00
Marek Safar faa8692d17 Fixes com api 2016-05-03 11:38:06 +02:00
Marek Safar 20c42db9f9 Disable optimized comparer for byte, ushort enums 2016-05-03 11:38:06 +02:00
Marek Safar e04145a389 Disable encryption column certificate error message 2016-05-03 11:38:06 +02:00
Marek Safar 581e566d36 More tweaks to mscorlib updates 2016-05-03 11:38:05 +02:00
Marek Safar 559c591cf0 Make updated mscorlib mono friendly 2016-05-03 11:35:18 +02:00
Marek Safar ddc3b6bf85 Revert "[corlib] Fix dispose race condition in CancellationTokenSource"
This reverts commit 5f5ac0a87b65941f5377a1ba06614d22281b015f.
2016-05-03 11:32:33 +02:00
dotnet-bot 8f2487b3ce Update Reference Sources to .NET Framework 4.6 2016-05-03 11:32:33 +02:00
Miguel de Icaza 5f82524097 DateTime, DateTimeOffset, bring Unix time APIs from CoreCLR 2016-05-03 00:10:27 +02:00
Marek Safar 2c381b5a7f Change Page_Error resource key to workaround collision with Page_Error method name 2016-05-03 00:10:26 +02:00
Ludovic Henry c251136278 Fix dispose race condition in CancellationTokenSource
The race condition would manifest in the following code:

```
for (int i = 0, total = 100000; i < total; ++i) {
	if (i % 50 == 0)
		Console.WriteLine ("{0}/{1}", i, total);

	var c1 = new CancellationTokenSource ();
	var wh = c1.Token.WaitHandle;
	c1.CancelAfter (1);
	Thread.Sleep (1);
	c1.Dispose ();
}
```

And we would observe the following exception:
```
Unhandled Exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.ManualResetEvent'.
 at System.Threading.WaitHandle.CheckDisposed () [0x00016] in /Users/builder/data/lanes/1196/33e00ac6/source/mono/mcs/class/corlib/System.Threading/WaitHandle.cs:426
 at System.Threading.EventWaitHandle.Set () [0x0000c] in /Users/builder/data/lanes/1196/33e00ac6/source/mono/mcs/class/corlib/System.Threading/EventWaitHandle.cs:205
 at (wrapper remoting-invoke-with-check) System.Threading.EventWaitHandle:Set ()
 at System.Threading.CancellationTokenSource.NotifyCancellation (Boolean throwOnFirstException) [0x00051] in /Users/builder/data/lanes/1196/33e00ac6/source/mono/external/referencesource/mscorlib/system/threading/CancellationTokenSource.cs:723
 at System.Threading.CancellationTokenSource.Cancel (Boolean throwOnFirstException) [0x00006] in /Users/builder/data/lanes/1196/33e00ac6/source/mono/external/referencesource/mscorlib/system/threading/CancellationTokenSource.cs:409
 at System.Threading.CancellationTokenSource.Cancel () <0x7d75ada8 + 0x00017> in <filename unknown>:0
 at System.Threading.CancellationTokenSource.TimerCallbackLogic (System.Object obj) [0x00012] in /Users/builder/data/lanes/1196/33e00ac6/source/mono/external/referencesource/mscorlib/system/threading/CancellationTokenSource.cs:538
```

This would be a race condition between the TimerCallbackLogic call to Cancel and the call to Dispose on another thread. You could trigger it more reliably by putting a Thread.Sleep at CancellationTokenSource.cs:599.
2016-05-03 00:10:26 +02:00
Martin Baulig 9e9868aa2a SslState.AsyncResumeHandshake(): Fix resumption of pending handshake.
(cherry picked from commit 8f3cae56e1586ff9709ca78e1b3000da5860d132)

(cherry picked from commit a56d585fa65efcb7ef734dcd40248a4872e424a5)
2016-05-03 00:10:26 +02:00
Alex Rønne Petersen ef72855de9 Use optimized qword path in System.String::EqualsHelper () on 64-bit. 2016-05-03 00:10:26 +02:00
Lennart Sorensen b10b7ce8a5 Add BE support for Doubles, missed from 41a6d3d6a5432b964b6f8439b6375ffad6f2e6cb 2016-05-03 00:10:26 +02:00
Marek Safar b0a25a9af9 Mono friendly WebUtility 2016-05-03 00:10:25 +02:00
Marek Safar ebd091d820 Adjust to updated StackTrace 2016-05-03 00:10:25 +02:00
Marek Safar f65f365176 Remove unused using 2016-05-03 00:10:25 +02:00
Marek Safar 636c052ef0 Add mono tweaks 2016-05-03 00:10:25 +02:00
Martin Baulig 3cbc7cffca Fix and actually use the '_PendingReHandshake' logic in _SslState.cs 2016-05-03 00:10:25 +02:00
Marek Safar 50cfb468f0 Add more missing strings 2016-05-03 00:10:24 +02:00
Alexis Christoforides 222b1a2a4a Keep Mono's old default provider type value for RSA. The value isn't used for the managed crypto code and is still validfor CryptoAPI, but if it changes Mono can't find keypairs made with earlier versions. 2016-05-03 00:10:24 +02:00
Marcos Henrich e658c9f64a Ifdefed out some methods from methodbody.cs and methodbuilder.cs
Mono now uses ExceptionHandlingClauseOptions from methodbody.cs and ExceptionHandler from methobuilder.cs.
Remaining types from thoses files were ignored with ifdef.
2016-05-03 00:10:24 +02:00
Ludovic Henry 6428e43ed4 Move ThreadPool from System.Threading.Microsoft to System.Threading 2016-05-03 00:10:24 +02:00
Dylan Borg d6480e7c88 Add NET_4_6 defines for .NET 4.6 changes 2016-05-03 00:10:24 +02:00
Dylan Borg 6411ceadc7 Expose Task.CompletedTask
Signed-off-by: Dylan Borg <[email protected]>
2016-05-03 00:10:23 +02:00
Dylan Borg 35b33515b5 Expose Task.FromException/FromCanceled
Signed-off-by: Dylan Borg <[email protected]>
2016-05-03 00:10:23 +02:00
Martin Baulig 39fe6a219d Mono-specific implementation to get SecureChannel's connection info. 2016-05-03 00:10:23 +02:00
Ludovic Henry 2ab23abfa6 Add MS ThreadPool disabling flag 2016-05-03 00:10:23 +02:00
Marek Safar cb3748ae65 Add more legacy mobile apis 2016-05-03 00:10:23 +02:00
Sebastien Pouliot 2d03d8e102 RsaOaepDecrypt needs to throw, not return null
Mono's implementation of RSAOAEPKeyExchangeDeformatter did the throwing
but we're now using MS implementation of it - so it make sense to move
the throw (it's needed) in the utils.cs file
2016-05-03 00:10:22 +02:00
Sebastien Pouliot ea344fff66 Disable more CAS checks 2016-05-03 00:10:22 +02:00
Sebastien Pouliot 329deb3cd4 Fix RSA encryption/decryption with OAEP padding [#30572]
MS implementation is incorrect and the .NET framework never hits this code
path as it's RSA implementation calls CryptoAPI (bypassing those managed
classes).

mscorlib/system/security/cryptography/pkcs1maskgenerationmethod.cs
-> use Mono MGF1 implementation

mscorlib/system/security/cryptography/utils.cs
-> remove duplicated code from Mono's PKCS1
-> fix RsaOaepEncrypt and RsaOaepDecrypt to call Mono code
2016-05-03 00:10:22 +02:00
Marcos Henrich 0a65236d93 Debug build fixes. 2016-05-03 00:10:22 +02:00
Marek Safar c3305bdac4 Add conditional role based security 2016-05-03 00:10:22 +02:00
Marek Safar 2f169c2dd3 Disable more CAS 2016-05-03 00:10:21 +02:00
Marek Safar a87d7a5b98 Clone all levels of captures ExceptionDispatchInfos 2016-05-03 00:10:21 +02:00
Marek Safar 5acce6f89c Add more obsolete and not working types to MonoDroid 2016-05-03 00:10:21 +02:00
Marek Safar ab7d6301b6 Enable more thread api 2016-05-03 00:10:21 +02:00
Marek Safar 8db851afc5 Enable more thread code 2016-05-03 00:10:21 +02:00
Marek Safar 377c877584 SafeHandle mono friendly 2016-05-03 00:10:21 +02:00
Marek Safar 9cfa68491b Add more mobile api which fails of crashes but was available in previous versions 2016-05-03 00:10:20 +02:00
Marek Safar 48de084039 Disable more CAS 2016-05-03 00:10:20 +02:00
Marek Safar 3c7d14282b Update missing WaitHelper attributes 2016-05-03 00:10:20 +02:00
Marek Safar 02a83ffe8c Make various contexts mono friendly 2016-05-03 00:10:20 +02:00
Marek Safar 41110ea390 Disable more CAS 2016-05-03 00:10:20 +02:00
Marek Safar 130f2259a5 Finish CAS removal started in 1ef3d85190bc1beea5505710527c79ff658b94ce 2016-05-03 00:10:19 +02:00
Marek Safar b7eb32edba Correctly fix 1ef3d85190bc1beea5505710527c79ff658b94ce 2016-05-03 00:10:19 +02:00
Marek Safar 346a91db63 Fixes regression intoduced in 1ef3d85190bc1beea5505710527c79ff658b94ce 2016-05-03 00:10:19 +02:00
Sebastien Pouliot 8cdde6a24b Make NotSupportedException partial to allow XI to add an helper method 2016-05-03 00:10:19 +02:00
Marek Safar 03e215601a Remove mono specific handling 2016-05-03 00:10:19 +02:00
Ludovic Henry 1fcb23b1f1 Import System.Threading.ThreadLocal 2016-05-03 00:10:18 +02:00
Marek Safar 85f70e454a Some attributes are not translated in SL (this looks like a bug compatibility) 2016-05-03 00:10:18 +02:00
Sebastien Pouliot bbfd508059 Remove CAS usage from XslTransform 2016-05-03 00:10:18 +02:00
Sebastien Pouliot 562c95f4b5 Further reduce CAS usage in XmlSecureResolver to fix #30205 2016-05-03 00:10:18 +02:00
Sebastien Pouliot 4128114c6d Make NotImplementedException partial to allow XI to add an helper method 2016-05-03 00:10:18 +02:00
Sebastien Pouliot 8bfb3e2178 Sprinkle some DISABLE_CAS_USE for System.ServiceModel.* helpers 2016-05-03 00:10:18 +02:00
Marek Safar 994ee88ef4 Enable more thread apis 2016-05-03 00:10:17 +02:00
Marek Safar 282b3b475e Initial thread integration 2016-05-03 00:10:17 +02:00
Ludovic Henry d60eef7367 Import System.Threading.WaitHandle 2016-05-03 00:10:17 +02:00
Marek Safar 6d3fb6ee96 Disable more cas 2016-05-03 00:10:17 +02:00
Ludovic Henry 9822a42d0f Import System.Threading.Timer 2016-05-03 00:10:17 +02:00
Marek Safar ddb738322b Add more mobile api which fails or crashes but was available in previous versions 2016-05-03 00:10:16 +02:00
Ludovic Henry 1c3ad5e78c Implement System.Double runtime support 2016-05-03 00:10:15 +02:00
Marek Safar 9fc4ef4ac0 Disable RemoteDebugger 2016-05-03 00:10:15 +02:00
Marek Safar a9659d19f0 Add broken mono configuration hack 2016-05-03 00:10:15 +02:00
Marek Safar eb1383a1e3 Convert null attribute type to Attribute. Fixes #29916 2016-05-03 00:10:14 +02:00
Marek Safar 4eb39e62d0 Add more missing strings 2016-05-03 00:10:14 +02:00
Atsushi Eno d0dc3a604d we cannot check MDAC version via registry, so do not try it. 2016-05-03 00:10:14 +02:00
Martin Baulig 253b743dca Always call SSPIWrapper.CheckRemoteCertificate(). 2016-05-03 00:10:14 +02:00
Marek Safar 51da161316 Hold user token as IntPtr only 2016-05-03 00:10:13 +02:00
Marek Safar e9b36595bd More configuration dependencies 2016-05-03 00:10:13 +02:00
Marek Safar 00208a7bc6 Add mono dependencies 2016-05-03 00:10:13 +02:00
Marek Safar ac14ed1e94 Correctly throw on missing encoding 2016-05-03 00:10:13 +02:00
Marek Safar 54c0233bb9 SqlClient mono friendly bits 2016-05-03 00:10:13 +02:00
Marek Safar 7203c54514 Disable more cas 2016-05-03 00:10:12 +02:00
Marek Safar 7b23337a1c Mobile fixes 2016-05-03 00:10:12 +02:00
Marek Safar 03248cd9a6 PKCS bugfixes 2016-05-03 00:10:12 +02:00
Marek Safar 3cb9c4dcbb Add more mobile api which fails of crashes but was available in previous versions 2016-05-03 00:10:12 +02:00
Marek Safar 2d2e53a52c More profile apis tweaks 2016-05-03 00:10:12 +02:00
dotnet-bot d6fe4fa3a9 Adding reference source for System.Configuration 2016-05-03 00:10:11 +02:00
Marek Safar ad5431c494 Fix what looks like a buggy RsaOaepDecrypt 2016-05-03 00:10:11 +02:00
Marek Safar b7cdd0e6b9 More cryptography mono tweaks 2016-05-03 00:10:11 +02:00
Marek Safar 06de6ef501 Mono tweaks to cryptography 2016-05-03 00:10:11 +02:00
Marek Safar 8f1e2526c6 Make WindowsRuntime enum value alway available 2016-05-03 00:10:11 +02:00
Marek Safar e3bbb5bf5d Remove more com stuff from Attribute 2016-05-03 00:10:10 +02:00
Atsushi Eno 5d02cd7272 more uses of NO_DYNAMIC_CODEGEN condition were needed. 2016-05-03 00:10:10 +02:00
Sebastien Pouliot 0942d8e96e Restore Mono compatibility with UnmanagedType enum
Some values, like CustomMarshaler, are used by XI unit tests.
2016-05-03 00:10:10 +02:00
Marek Safar 0f3d462110 Mono friendly cryptography bits 2016-05-03 00:10:10 +02:00
Marek Safar b02565eba8 Mobile teaks to security attributes 2016-05-03 00:10:10 +02:00
Marek Safar 4ee14e99ab Update public api 2016-05-03 00:10:09 +02:00
Marek Safar 92499fe593 Mono friendly versioning 2016-05-03 00:10:09 +02:00
Marek Safar 5475c77bd2 Mono friendly safe handles 2016-05-03 00:10:09 +02:00
Marek Safar 7bb4332095 Fix wrong define 7612b6f65cec4620d83117511d38e47a5456b468 2016-05-03 00:10:09 +02:00
Marek Safar 4baab40f56 Tweaks for mobile profiles 2016-05-03 00:10:09 +02:00
Marek Safar aebdb6784e Mono friendlly com types 2016-05-03 00:10:08 +02:00
Atsushi Eno b6a6a85681 more SRE elimination was needed. 2016-05-03 00:10:08 +02:00
Atsushi Eno c8e34950fd Add NO_DYNAMIC_CODEGEN condition. We will be based on (non-emit) reflection. 2016-05-03 00:10:08 +02:00
Atsushi Eno 53b3c4f923 Add mobile build support in System.Runtime.Serialization. 2016-05-03 00:10:08 +02:00
Marek Safar 4f66383f7d Hide ComImportAttribute from MT 2016-05-03 00:10:08 +02:00
Marek Safar eb168f1434 Mono friendly runtime attributes 2016-05-03 00:10:07 +02:00
Marek Safar 0850952185 Add mono stacktraces to ExceptionDispatch 2016-05-03 00:10:07 +02:00
Marek Safar 9fd0cebb7d Mono friendly TextInfo 2016-05-03 00:08:11 +02:00
Marek Safar c832d66fd8 Fixes endianess issue in resourcereader 2016-05-03 00:08:11 +02:00
Marek Safar c6acf036cf Comparer fix 2016-05-03 00:08:11 +02:00
Marek Safar fb91b846d9 Equality comparers fixes 2016-05-03 00:08:10 +02:00
Marek Safar 439a5dedb3 More DISABLE_CAS_USE 2016-05-03 00:08:10 +02:00
Marek Safar 6564baacce Mono friendly Buffer 2016-05-03 00:08:10 +02:00
Marek Safar 0d62748e09 Mono friendly generic comparers 2016-05-03 00:08:10 +02:00
Marek Safar e7a8ed1cc6 Enable GetGenericArguments 2016-05-03 00:08:10 +02:00
Marek Safar 22a07806cd Update timezoneinfo TypeForwardedFrom 2016-05-03 00:08:09 +02:00
Marek Safar ff13385fb5 Update some TypeForwardedFrom 2016-05-03 00:08:09 +02:00
Marek Safar 4746b8ec18 Add FULL_AOT_RUNTIME to IAppDomain 2016-05-03 00:08:09 +02:00
Marek Safar a005b0d8df Mono friendly FileLoadException 2016-05-03 00:08:09 +02:00
Marek Safar 47cd4bbd44 Mono friendly TypeLoadException 2016-05-03 00:08:09 +02:00
Marek Safar 2922585d3f Fix wrong FEATURE_USE_LCID ifdef 2016-05-03 00:08:08 +02:00
Atsushi Eno d8a96b3455 Add mobile build conditions for SMDiagnostics.dll. 2016-05-03 00:08:08 +02:00
Ludovic Henry 459993273e Fix FullAOT build 2016-05-03 00:08:08 +02:00
Marek Safar 6a78fe3bd6 Remove unused icall 2016-05-03 00:08:08 +02:00
Marek Safar 3aa86a62f4 Mono friendly compareinfo 2016-05-03 00:08:08 +02:00
Atsushi Eno a807edd81b Fix mobile_static build. 2016-05-03 00:08:08 +02:00
Marek Safar 58710c252d Remove Mono specific paths from DateTimeFormatInfo 2016-05-03 00:08:07 +02:00
Marek Safar fdc3768649 Specialize encoding names translation 2016-05-03 00:08:07 +02:00
Zoltan Varga 9b53395dc1 Add a workaround for #24566 so 3.12 mcs can compile System.Xml. 2016-05-03 00:08:07 +02:00
Martin Baulig 7b7dd56579 Add conditionals to ServicePointManager.cs.
* `ServerCertValidationCallback': Enable this for Mono.
* `ServicePointManager': Use 'MONO_FEATURE_WEB_STACK' here, we'll
  eventually bring this together with the web stack.

We want the helper APIs at the top of the file, but not the actual
'ServicePointManager' class.
2016-05-03 00:08:07 +02:00
Zoltan Varga 19b3737709 Avoid initializing String.Empty, it is now done from native code. 2016-05-03 00:08:06 +02:00
Martin Baulig de0a074a69 Use actual parameter custom attribute type.
This fixes the situation where a parameter has more than one
custom attribute.
2016-05-03 00:08:06 +02:00
Atsushi Eno 1eb8ff5fa3 Add MONO_PARTIAL_DATA_IMPORT.
It is to make it possible to import everything but SqlClient and co.
2016-05-03 00:08:06 +02:00
Atsushi Eno a5b985c755 Add #if-s for mobile builds. 2016-05-03 00:08:06 +02:00
Atsushi Eno 6e52beedaa Avoid some windows-only calls in System.Data. 2016-05-03 00:08:06 +02:00
Marek Safar cdbda49db9 Mono friendly string 2016-05-03 00:08:05 +02:00
Alexander Köplinger 51003c985d Fix DateTime regression on ARM
This is the same issue as in https://github.com/mono/referencesource/pull/7,
i.e. there's an overflow when casting a too large value from double->long
and the referencesource implementation relies on this being a large negative
value in order for the ArgumentOutOfRangeException to be properly thrown.

As Mono's runtime on ARM in this case returns -1, the exception isn't thrown.

The fix is to introduce an explicit overflow check, catch an eventual
OverflowException and raise the proper exception instead. This can be JIT'd
to better code than checking if the value fits into long every time.

It fixes a couple of DateTime unit tests that currently fail on ARM.
2016-05-03 00:08:05 +02:00
Marek Safar b1b82b0e31 Mono friendly ExceptionDispatchInfo 2016-05-03 00:08:05 +02:00
Marek Safar 1fe2ef619e Don't replace CategoryAttribute value with key when not found. 2016-05-03 00:08:05 +02:00
Marek Safar 7f4798feed Mono friendly System.Resources 2016-05-03 00:08:05 +02:00
Marek Safar a3af9db16d Mono friendly MethodBase 2016-05-03 00:08:05 +02:00
Marek Safar 0d10918597 Mono friendly Type|MemberInfo 2016-05-03 00:08:04 +02:00
Marek Safar 33426e399f Disable unmanaged IsVisible type path, it does not work 2016-05-03 00:08:04 +02:00
Marek Safar e60baf545a Filter out more FrameworkEventSource 2016-05-03 00:08:04 +02:00
Marek Safar f011ecdf2d Enable more Type code 2016-05-03 00:08:04 +02:00
Marek Safar 94b29e3227 Return top-level parameter custom attributes when no base methods exists 2016-05-03 00:08:04 +02:00
Marek Safar 677426f76f Throw better exception on not yet implement runtime icall 2016-05-03 00:08:03 +02:00
Marek Safar 969a1d9f73 Mono friendly TypedReference 2016-05-03 00:08:03 +02:00
Marek Safar 0bf325955a Disable more CAS 2016-05-03 00:08:03 +02:00
Marek Safar 65bd5be8d5 Disable more CAS 2016-05-03 00:08:03 +02:00
Ludovic Henry 0e98066689 Restore RegisteredWaitHandle as we now use the Mono one
The Mono one is entirely implemented in managed code, so it does not need any runtime support.
2016-05-03 00:08:03 +02:00
Marek Safar a7a879fd73 Endian fixes to serialization 2016-05-03 00:08:02 +02:00
Marek Safar 1cd9233410 Mono friendly serialization 2016-05-03 00:08:02 +02:00
Marek Safar 634d8837f2 Update timer argument exception check 2016-05-03 00:08:02 +02:00
Alexander Kyte febf89f87c Added serialization annotations to StringBuilder 2016-05-03 00:08:02 +02:00
Marek Safar a044ac4be0 Add mono specific handling to attribute 2016-05-03 00:08:02 +02:00
Marek Safar fc3f42112d Mono friendly Attribute 2016-05-03 00:08:01 +02:00
Marek Safar c6a9c88494 Few FULL_AOT_RUNTIME tweaks 2016-05-03 00:08:01 +02:00
Marek Safar 153f8e39be Mono uses WebAsyncResult instead of reference sources LazyAsyncResult (at least for now) 2016-05-03 00:08:01 +02:00
Alexander Köplinger 9dc369e094 Fix System.Timers.Timer regression on ARM
When setting Interval = double.MaxValue like in the TimerTest.Interval_TooHigh_ThrowOnEnabled and
TimerTest.Interval_TooHigh_Enabled_Throw Mono unit tests there was a regression on ARM in that
the ArgumentOutOfRangeException wasn't thrown as expected.

Turns out, on ARM the call to (int)Math.Ceiling(double.MaxValue) as used in UpdateTimer() and Enabled setter
doesn't produce -2147483648 (i.e. Int32.MinValue) like on x86/amd64 but rather 2147483647 (i.e. Int32.MaxValue),
which is perfectly valid as the cast overflows and the result is an undefined value.
This means that the value passed to the underlying System.Threading.Timer is not negative
and no ArgumentOutOfRangeException is thrown there.

The fix is to properly check for interval>Int32.MaxValue like is done already in the constructor.
I pulled that logic out and introduced a separate method CalculateRoundedInterval().

Note: The thrown exception changes from an ArgumentOutOfRangeException inside of System.Threading.Timer
to an ArgumentException inside of CalculateRoundedInterval().
I think this has minimal impact as no-one should rely on this exception anyway and it actually matches
what MSDN (https://msdn.microsoft.com/en-us/library/system.timers.timer.interval(v=vs.110).aspx)
says should happen in this case (even though the MS.NET 4.5 implementation doesn't comply).
Mono's implementation also did the same before: https://github.com/mono/mono/blob/4cb3f77b4bbf703b1cda59db2f5aee206e35d31a/mcs/class/System/System.Timers/Timer.cs#L95-L96
2016-05-03 00:08:01 +02:00
Marek Safar c1414877eb Mono friendly Type 2016-05-03 00:08:01 +02:00
dotnet-bot daa3c08494 Adding reference source for SMDiagnostics 2016-05-03 00:08:00 +02:00
Martin Baulig 1075fffc65 Need another DISABLE_CAS_USE in _SecureChannel.cs. 2016-05-03 00:08:00 +02:00
Martin Baulig 7119ec0bba Add another DISABLE_CAS_USE conditional to _SecureChannel.cs 2016-05-03 00:08:00 +02:00
Marek Safar 2c5d0d3a82 Mono friendly enum 2016-05-03 00:08:00 +02:00
Atsushi Eno ec92efb378 Fix native pointer and endianness issue. Fixes bug #27258.
Patch by Neale Ferguson.
2016-05-03 00:08:00 +02:00
Atsushi Eno 32ed523a58 add XmlSerializer for mono support.
Even after we imported System.Xml referencesource, XmlSerializer is still
based on existing code. And we have some special trick for XElement
serialization support in System.Xml, by allowing access from
System.Xml.Linq.dll to use special type converter attribute.

It does not exist in referencesource and thus we lost serializability on
XElement, so we need to add the missing code to bring it back.
2016-05-03 00:07:59 +02:00
Marek Safar acbc67edd2 Mono friendly Activator 2016-05-03 00:07:59 +02:00
Marek Safar ee429115ca Fixes c0a529a421cb47145a32078770205e42545e7021 2016-05-03 00:07:59 +02:00
Marek Safar a7787ce55a Change Encoding key to workaround collision with Encoding parameter names used by string resources 2016-05-03 00:07:59 +02:00
Marek Safar b4332a47b7 Mono friendly Binder 2016-05-03 00:07:59 +02:00
Atsushi Eno 22d2edc5a8 some people claim they have old SYSMONO that cannot compile this source and demand to "fix" this code. 2016-05-03 00:07:59 +02:00
Atsushi Eno 93be8109e3 Add #if CONFIGURATION_DEP and #if XML_DEP in Trace class and co. 2016-05-03 00:07:58 +02:00
Atsushi Eno 1f9b218441 more BIGENDIAN fixes in UnicodeEncoding. 2016-05-03 00:07:58 +02:00
Marek Safar 279395c58c Inline string category resource keys 2016-05-03 00:07:58 +02:00
Marek Safar 68f7cec14d Include Stream::ObjectInvariant in mono build 2016-05-03 00:07:58 +02:00
Marek Safar bcdb1963e1 Revert no longer needed changes 2016-05-03 00:07:58 +02:00
Atsushi Eno 92cec4692a Alter #if BIGENDIAN code with run-time condition.
Should fix bug #27258.
2016-05-03 00:07:57 +02:00
Atsushi Eno ebb7ea27cd add DISABLE_XSLT_SCRIPT and DISABLE_XSLT_COMPILER.
The former condition is to disable <msxsl:script> element.
The latter is to disable XslCompiledTransform and co (though they are
mostly removed at *.dll.sources level).
2016-05-03 00:07:55 +02:00
Atsushi Eno 74692062be Reduce !MOBILE scope in XmlReaderSettings. They are in use. 2016-05-03 00:07:55 +02:00
Atsushi Eno d8af5d16df disable Win32 registry dependencies in XmlReaderSettings on MOBILE builds. 2016-05-03 00:07:55 +02:00
Atsushi Eno a1b52227d0 Add workaround for XmlSchema serialization.
Somewhere in System.Xml requires NameTable to be canonically reused when
deserializing XmlSchema, so that certain deserialization part can check
only reference equality.

Since we have hybrid System.Xml implementation for XmlSerializer, this
is not completely achieved and with reference comparison it causes some
schema deserialization failure. To avoid this problem, just disable
reference comparison. It should not affect outside XmlSchema serialization.
2016-05-03 00:07:55 +02:00
Atsushi Eno ae11025ba5 revert mono-specific XmlSchemas changes that is not necessary anymore. 2016-05-03 00:07:55 +02:00
Atsushi Eno b23200a668 Make changes for System.Xml merge into mono tree.
DISABLE_CAS_USE is required to avoid NotImplementedExceptions in CAS land.

MONO_HYBRID_XML is to preserve Mono's XmlSerializer which also allows
interpreter-based XML serialization (as opposed to run-time code generation
based XML serialization, which is not doable in iOS).

Though some Xml.Serialization classes are useful even with mono
implementation, so we partially import them (namely schema importer).
2016-05-03 00:07:55 +02:00
Marek Safar 665d462dc5 Disable eventsources in resources 2016-05-03 00:07:54 +02:00
Marek Safar 226e440d88 Revert "Add read-only interfaces to some System/System.Core collection classes."
This reverts commit b23609f81a95b384538dba01a1cbf49fe2a9b95a.

Confirmed by Brett Lopez as MSDN bug
2016-05-03 00:07:54 +02:00
dotnet-bot 332534dede Adding reference source for part of Workflow Foundation
Adding reference source for
System.Activities
System.Activities.DurableInstancing
System.Activities.Presentation
System.Runtime.DurableInstancing
System.Workflow.Activities
System.Workflow.ComponentModel
System.Workflow.Runtime
System.WorkflowServices
System.Xaml.Hosting
XamlBuildTask
2016-05-03 00:07:54 +02:00
dotnet-bot 287e106a1b Add resources for some referencesource projects
Add resources for:
mscorlib
System
System.ComponentModel.DataAnnotations
System.Core
System.Core
System.Data.DataSetExtensions
System.Data.Entity.Design
System.Data.Entity
System.Data.Linq
System.Data.SqlXml
System.Data
System.Net
System.Numerics
System.Runtime.Serialization
System.ServiceModel.Web
System.ServiceModel
System.Web.Mobile
System.Web
System.Xml.Linq
System.Xml
2016-05-03 00:07:52 +02:00
Marek Safar 6cf3e41695 Endianness handling in binary reader 2016-05-03 00:07:52 +02:00
Marek Safar 6acdf6a9ab Remove not useful !FEATURE_PAL from bufferedstream 2016-05-03 00:07:52 +02:00
Marek Safar 3cccc6b602 Add mono specific DataAvailable to streamreader 2016-05-03 00:07:51 +02:00
Marek Safar a71b2a2604 TextWriter without hardcoded line endings 2016-05-03 00:07:51 +02:00
Marek Safar 3ee70fc40a Bugfix WriteLineAsync(String value) to not crash on writing null string 2016-05-03 00:07:51 +02:00
Ludovic Henry 7cad99c9c9 Integrate the microsoft ThreadPool into it's own System.Threading.Microsoft namespace
This will let us have both the Mono and the Microsoft ThreadPool at the same time.
To switch to the Microsoft one, set the MONO_THREADPOOL environment variable to "microsoft". It will default to the Mono one.
2016-05-03 00:07:51 +02:00
Marek Safar 68a3fbc991 Mono friendly IO errors 2016-05-03 00:07:51 +02:00
Marek Safar 10c9b1bc1b Fix contradicting defines in Stream 2016-05-03 00:07:51 +02:00
Marek Safar c9739a3a23 Fix a bug when setting capacity to 0 on MemoryStream causes crash on ToArray call 2016-05-03 00:07:50 +02:00
Marek Safar f56b42d5b8 Inline contracts error messages for text replacement to work 2016-05-03 00:07:50 +02:00
Alex Rønne Petersen 94d2cda769 Add read-only interfaces to some System/System.Core collection classes. 2016-05-03 00:07:50 +02:00
Atsushi Eno a6edbc4328 avoid reflection here.
as per https://github.com/mono/mono/pull/1566#discussion_r24653304
2016-05-03 00:07:50 +02:00
Atsushi Eno 6f7cb1fc0a Add I18N assembly invocation support in Encoding. 2016-05-03 00:07:50 +02:00
Marek Safar 5c29480b4c Apply more DISABLE_CAS_USE 2016-05-03 00:07:49 +02:00
Marek Safar 6f032bb0e3 Disable more CAS on mobile 2016-05-03 00:07:49 +02:00
Marek Safar a2644f7be1 Mono friendly guid. Includes StringToLong fix for issue https://github.com/dotnet/coreclr/issues/182 2016-05-03 00:07:49 +02:00
Zoltan Varga f59490e89d Remove another unused decimal icall. 2016-05-03 00:07:49 +02:00
Zoltan Varga 11cc224de6 Remove unused decimal icalls. 2016-05-03 00:07:49 +02:00
Martin Baulig 1228b5b427 Need MONO_X509_ALIAS in _SslState.cs and _SecureChannel.cs. 2016-05-03 00:07:48 +02:00
Martin Baulig e994a2aed2 Introduce new MONO_X509_ALIAS conditional and use it in SslStream.cs. 2016-05-03 00:07:48 +02:00
Miguel de Icaza adee990fe1 Implement NumberBufferToDecimal in Mono, and make Decimal ctor build 2016-05-03 00:07:48 +02:00
Sebastien Pouliot e0e9f78aa8 Disable some CAS usage using DISABLE_CAS_USE 2016-05-03 00:07:48 +02:00
Martin Baulig 14c84a5e7c Merge the 'martin-ssl-integration' branch.
All changes are conditional to MONO_FEATURE_NEW_TLS.

In addition to that, all changes to their code are also conditional to 'MONO'; this
mostly applies to SecureChannel, which needed several changes to replace their native
SSPI implementation with Mono's new managed version.

* Net/SecureProtocols/SslStream.cs: Make partial and comment out 'SslStream.TransportContext'.

* Net/SecureProtocols/SslState.cs: Make partial and add new internal constructor; pass the
  'SSPIConfiguration' argument down to SecureChannel's .ctor.

* Net/SecureProtocols/_SslStream.cs: Make partial.

* Net/SecureProtocols/_SecureChannel.cs: Add Mono-specific SSPI APIs.

* Net/_SslSessionCache.cs: Make conditional.
2016-05-03 00:07:48 +02:00
Marek Safar 65dde8442d Add AmILittleEndian to bitconverter 2016-05-03 00:07:47 +02:00
Marek Safar 57957f4f32 Exclude legacy icalls from datetime 2016-05-03 00:07:47 +02:00
Alexander Kyte 2d6f01267e Fixed MethodAccessException in dynamically generated code 2016-05-03 00:07:47 +02:00
Marek Safar 1ea9ab5ad0 Disable legacy calls from timespan 2016-05-03 00:07:47 +02:00
Marek Safar 44325b1f5f Removes one culture #if 2016-05-03 00:07:47 +02:00
Marek Safar c0cb41e17b Mono friendly DateTimeFormatInfo 2016-05-03 00:07:47 +02:00
Sebastien Pouliot f115ec6d52 Disable CAS calls on System.Componentmodel.TypeDescriptor 2016-05-03 00:07:46 +02:00
Martin Baulig 7ad76389fb Add another small DISABLE_CAS_USE conditionals. 2016-05-03 00:07:46 +02:00
Martin Baulig 60c6562e41 Add 'MONO_FEATURE_LOGGING' conditional to disable Logging.cs.
Also put back the previous conditionals in this file.
2016-05-03 00:07:46 +02:00
Marek Safar a21891741f Correctly fix 857b021d78ea1e987b7e65493c6d926948926bb4 2016-05-03 00:07:46 +02:00
Marek Safar b1e058317a Reverts not needed changes 2016-05-03 00:07:46 +02:00
Martin Baulig 44ad73b31c FIXME: This completely breaks Xamarin Studio, making it impossible to compile anything.
See the detailed comment inside.
2016-05-03 00:07:45 +02:00
Martin Baulig c32be390e4 Add 'MONO_FEATURE_NEW_TLS' conditional to SslStreamContext.
This allows us to bring TransportContext.cs and conditionally enable it when needed.
2016-05-03 00:07:45 +02:00
Marek Safar 0e8ff9dca4 Disable com specific stringbuilder marshalling 2016-05-03 00:07:45 +02:00
Zoltan Varga 69f0e9b1ba Revert "[mscorlib] RuntimeWrappedException mono updates."
This reverts commit ea80438e7108d9d0a10b2b6b3dd0c6d123710232.

Revert this, it is now handled in the runtime.
2016-05-03 00:07:45 +02:00
Martin Baulig 034bc3419a Use "Thread.CurrentThread.ManagedThreadId" on Mono. 2016-05-03 00:07:45 +02:00
Martin Baulig b1325688c1 Add conditionals where needed.
This allows us to bring Internal.cs, Logging.cs and _LoggingObject.cs.
2016-05-03 00:07:44 +02:00
Martin Baulig 7e49341898 Add REAMDE.Mono with known conditional names.
Please update if you add any new conditionals.
2016-05-03 00:07:44 +02:00
Zoltan Varga 3e7c12ec79 RuntimeWrappedException mono updates. 2016-05-03 00:07:44 +02:00
Marek Safar 696286134b Mono Calendars compatibility 2016-05-03 00:07:44 +02:00
Marek Safar e19bfbc2e9 List<T> mono updates 2016-05-03 00:07:44 +02:00
Marek Safar 731d463fb5 Exclude never used method 2016-05-03 00:07:44 +02:00
Marek Safar ec643899c0 Add BigNumber runtime api 2016-05-03 00:07:43 +02:00
Marek Safar ac94587de2 Mono number formatting 2016-05-03 00:07:43 +02:00
Miguel de Icaza 5b782cf2da ComponentModel, make it build in the MOBILE profile 2016-05-03 00:07:43 +02:00
Ludovic Henry c8a99e52fc Add mono internal API support 2016-05-03 00:07:43 +02:00
Marek Safar 8abf084f5d Replace more Array.MaxArrayLength appearences 2016-05-03 00:07:43 +02:00
Marek Safar dcb1181a71 Remove windows api dependency from Timer 2016-05-03 00:07:42 +02:00
Marek Safar 63c969bd9d Conditionals for mobile profiles 2016-05-03 00:07:42 +02:00
Miguel de Icaza 189361bd71 Disable IL code generation until we figure out 25671 2016-05-03 00:07:42 +02:00
Miguel de Icaza 68d23c1567 Only initialize Etw on Windows 2016-05-03 00:07:42 +02:00
Miguel de Icaza d7a460f238 Remove code that depends on code that has not been open sourced.
Use the MONO define for this
2016-05-03 00:07:42 +02:00
Marek Habersack 781f927688 Use the DISABLE_CAS_USE macro instead of MOBILE to disable CAS
This augments commit 7dc4e513eafd3fb30d34111948ef14c981264463
2016-05-03 00:07:41 +02:00
dotnet-bot db1743eefb Adding reference source for System.Net 2016-05-03 00:07:41 +02:00
Marcos Henrich 8d443af0b7 Removed UnsafeNativeMethods calls on Mono. - MEMORYSTATUSEX usages were replaced with performance counters "Total Physical Memory and "Available Physical Memory"
- SafeRegistryHandle.ReleaseHandle is only called on code that is ignored on Mono.

 - Mono is using AppDomain.FriendlyName directly instead of UnsafeNativeMethods.GetModuleFileName.
2016-05-03 00:07:41 +02:00
Marcos Henrich 921c6a0bd8 Added Mono config variables. Variables __MonoEmulateOneCPU and __MonoTimerPeriod are used by some tests. 2016-05-03 00:07:40 +02:00
Marek Habersack 411739eb9b Exclude security code from the mobile targets.
Mobile doesn't support any of the security features of .NET, no point in
running the code and/or defining fake types.
2016-05-03 00:07:40 +02:00
Marek Safar 388317dba6 Disable UseCompatibleTypeConverterBehavior on mono 2016-05-03 00:07:40 +02:00
Marek Safar 61cbe91089 componentmodel tweaked to work with mono 2016-05-03 00:07:40 +02:00
Marcos Henrich 37a094d21d Disable use of CAS. The added ifdef is required to circumvent a compile error on older versions of mcs. 2016-05-03 00:07:40 +02:00
Marek Safar 00c9047fe5 Remove unused private using 2016-05-03 00:07:39 +02:00
Marcos Henrich 3112a50560 Removed unnecessary call to Thread.WriteVolatile. System.Threading.Volatile is internal on framework versions before 4.5. As corlib internals are visible from System.Core we can use Volatile. 2016-05-03 00:07:39 +02:00
Marcos Henrich c1189efcc6 ReaderWriterLockSlim.cs now builds with mono.
* Builds without [MethodImpl(MethodImplOptions.AggressiveInlining)]
  when target framework version is lower than 4.5.

* Use Thread.Volatile instead of Volatile.Read when target framework
  version is lower than 4.5.
2016-05-03 00:07:39 +02:00
Alexander Köplinger fc5ecbc2bd Add support to build with Mono 2016-05-03 00:07:39 +02:00
Sebastien Pouliot 0d4695cc7d Remove unused System.Web namespace from source (it does not exists in the mobile profile). 2016-05-03 00:07:39 +02:00
Miguel de Icaza 9843fa873d Disable use of CAS when compiling with DISABLE_CAS_USE 2016-05-03 00:07:39 +02:00
Miguel de Icaza 487d2d21f3 Fix the conditional, we disable Emit code on FULL_AOT 2016-05-03 00:07:38 +02:00
Marek Safar 46102d2417 Add support to build with Mono.
* Change location of internal Array constants. Mono runtime cannot handle
    array type with constants.

    * Removes some warnings from the build for unused fields.
2016-05-03 00:07:38 +02:00
Miguel de Icaza cbd37bcda1 Adjust to disable IL generation under FULL_AOT_RUNTIME 2016-05-03 00:07:38 +02:00
Miguel de Icaza 82baacad8f Add support to build build with Mono.
This patch does the following things:

* Adds support to build without Code Access Security, by using the new
  define DISABLE_CAS_USE.  The reason is that this is both slow, and
  Mono does not actually offer a Code Access Secured environment.  So
  avoid paying the price.

* Removes some warnings from the build for unused variables.

* Allows the code to be bootstrapped with a 2.0 compiler (which Mono
  does during the bootstrap phase currently).
2016-05-03 00:07:38 +02:00
dotnet-bot a026243bcc Adding System.Compo... System.Ident... System.Numer... System.Runti...
Adding reference source for
System.ComponentModel.DataAnnotations
System.IdentityModel
System.IdentityModel.Selectors
System.Numerics
System.Runtime.Caching
System.Runtime.Serialization
2016-05-03 00:07:38 +02:00
dotnet-bot 81cc9680d7 Update formatting of LICENSE.txt and PATENTS.TXT 2016-05-03 00:07:37 +02:00
dotnet-bot adf899c629 Adding System.Data..., System.ServiceModel..., and System.Web...
Adding reference source for
System.Data
System.Data.DataSetExtensions
System.Data.Entity
System.Data.Entity.Design
System.Data.Linq
System.Data.SqlXml
System.ServiceModel
System.ServiceModel.Activation
System.ServiceModel.Activities
System.ServiceModel.Channels
System.ServiceModel.Discovery
System.ServiceModel.Internals
System.ServiceModel.Routing
System.ServiceModel.WasHosting
System.ServiceModel.Web
System.Web
System.Web.ApplicationServices
System.Web.DynamicData
System.Web.Entity
System.Web.Entity.Design
System.Web.Extensions
System.Web.Mobile
System.Web.Routing
System.Web.Services
System.Xml
System.Xml.Linq
2016-05-03 00:07:37 +02:00
dotnet-bot 4c5e6261a7 Initial commit
_   _ _____ _____   ____            _        _
   | \ | | ____|_   _| |  _ \ ___   ___| | _____| |
   |  \| |  _|   | |   | |_) / _ \ / __| |/ / __| |
  _| |\  | |___  | |   |  _ < (_) | (__|   <\__ \_|
 (_)_| \_|_____| |_|   |_| \_\___/ \___|_|\_\___(_)
2016-05-03 00:07:31 +02:00
Marek Safar 871fcad377 [System.Runtime.Serialization] Remove redundant IVT to System.ServiceModel.Web 2016-05-02 16:07:12 +02:00
Marek Safar ed2ad96956 [System.Runtime.Serialization] Remove redundant IVT to System.ServiceModel 2016-05-02 15:36:30 +02:00
Zoltan Varga 096d2488cc [arm64] Dist arm64-codegen.h. Fixes #38223. 2016-04-29 23:23:49 -04:00
Neale Ferguson 52dbd3576e Create entire line of output before writing - prevents need for locking or interspersed messages 2016-04-28 13:40:23 -04:00
Alexander Köplinger f959605062 Merge pull request #1345 from mattleibow/websocket-continuation-frame-fix
[system] WebSocket continuation frame incorrectly handles the message type
2016-04-27 11:04:43 -04:00
monojenkins 8a0f18d53e Merge pull request #2947 from mfilippov/master
Socket.AcceptAsync should use SocketAsyncEventArgs.AcceptSocket

Socket.AcceptAsync shouldn't create new socket if SocketAsyncEventArgs.AcceptSocket isn't null.
2016-04-26 18:25:23 +01:00
Joao Matos 48b7036938 [runtime] Moved MONO_ZERO_LEN_ARRAY to mono-publib.h. 2016-04-26 13:03:21 -04:00
Alexander Köplinger f8390a4e36 Merge pull request #2960 from directhex/switchable-configure-in-jenkins
Switchable configure in jenkins
2016-04-26 11:37:06 -04:00
Jo Shields 04872540c0 [jenkins] introduce CI_TAGS env var, to alter flow of jenkins script 2016-04-26 16:32:46 +01:00
Mikhail Filippov 5128176e61 Refactoring SocketAcceptAsyncTest 2016-04-26 18:18:31 +03:00
Mikhail Filippov af14aaeb2c Fix SocketAcceptAsyncTest 2016-04-26 17:58:44 +03:00
Jo Shields a826d9cbb9 [jenkins] Don't overwrite EXTRA_CONF_FLAGS inside run-jenkins.sh
This means we can pass EXTRA_CONF_FLAGS to the script, to more easily change the script behaviour from Jenkins
2016-04-26 15:53:55 +01:00
Marek Safar 58245a39e4 Merge pull request #2949 from Unity-Technologies/xbuild-windows-mcs
Make xbuild on Windows use Mono instead of .NET
2016-04-26 07:19:44 -04:00
monojenkins ab9f5edfee Merge pull request #2957 from akoeplinger/fix-corlib-mobile-tests
Fix two corlib test issues on mobile

Fixes [#40642](https://bugzilla.xamarin.com/show_bug.cgi?id=40624).

@monojenkins merge
2016-04-26 03:25:24 +01:00
Neale Ferguson d808b7a064 Add description of MONO_LOG_HEADER environment variable 2016-04-25 20:54:05 -04:00
Neale Ferguson f32457bd0b Add environment variable to control log header 2016-04-25 19:26:40 -04:00
Alexander Köplinger a9554fdcbc Merge pull request #2953 from mono/fix-fileinfo-delete
[corlib] Bring the FileInfo.Delete fix
2016-04-25 17:27:27 -04:00
Alexander Köplinger c602e3b04c [corlib] Fix FileInfoTest.MoveTo_SameName test that failed on mobile
The MoveTo target is in the current working directory instead of in the temp dir, so it runs into permission issues.
Use the temp dir instead. Fixes part 2 of #40624
2016-04-25 17:20:50 -04:00
Alexander Köplinger f0f9b6ac90 [corlib] Ignore a TimeZoneInfo test on mobile that doesn't make sense there
It failed on maccore because it uses reflection on code that's excluded on mobile.
Exclude the test too, fixes part 1 of #40624
2016-04-25 17:20:50 -04:00
Zoltan Varga 9e3c032ab2 [runtime] Remove dead mono_thread_get_and_clear_pending_exception () function. 2016-04-25 17:16:14 -04:00
Ludovic Henry ab4737fce5 Merge pull request #2946 from ludovic-henry/fix-process-40643
[Process] Fix Process.Start handle leak
2016-04-25 14:48:41 -04:00
Ludovic Henry 4bbe4d5e49 Merge pull request #2924 from ludovic-henry/fix-missing-gsharedvt-wb
[mini] Add missing gsharedvt write barrier
2016-04-25 14:46:47 -04:00
Alexander Köplinger 2df509653e [corlib] Bring the FileInfo.Delete fix
See https://github.com/mono/referencesource/commit/fdebd8a4d709002bb499555c35e1dfd3834e2f4f for details.

Also add a test for checking if deleting a non-existent file works (we were missing coverage there before).
2016-04-25 12:34:45 -04:00
Ludovic Henry 10a841ae2b [io-layer] Remove dead code 2016-04-25 12:32:09 -04:00
Alexander Köplinger c4ae0fa832 Merge pull request #2952 from mono/revert-2721-fix-mono_ms_ticks
Revert "[runtime] Fix potential overflow when using mono_msec_ticks"
2016-04-25 12:26:13 -04:00
Alexander Köplinger df3f7b268f Revert "[runtime] Fix potential overflow when using mono_msec_ticks" 2016-04-25 12:24:51 -04:00
Ludovic Henry 6b139f4c98 Merge pull request #2721 from ludovic-henry/fix-mono_ms_ticks
[runtime] Fix potential overflow when using mono_msec_ticks
2016-04-25 11:22:15 -04:00
Josh Peterson 2061cb2b57 Make xbuild on Windows use Mono instead of .NET
We don't have .NEt 4.6 installed on all of our build machines, to
running mcs.exe on Windows fails, as it was built with .NET 4.6.
Instead, we will run mcs.exe via Mono on Windows (which is what happens
on OSX, although there the low-level Process class handles it).

To accomplish this, we run mcs.bat instead of mcs.exe.
2016-04-25 11:01:52 -04:00
Mikhail Filippov 06e12b837f Socket.AcceptAsync shouldn't create new socket if SocketAsyncEventArgs.AcceptSocket isn't null 2016-04-25 16:06:31 +03:00
Ludovic Henry a39f7fce21 [Process] Fix handle leak on child process Creation
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=40643
2016-04-24 16:30:11 -04:00
Ludovic Henry 4d0f6bb138 [Process] Improve debugging info and slight refactor of CreateProcess 2016-04-24 16:08:12 -04:00
Ludovic Henry e19a2e2c40 [Process] Fix System.Diagnostics.ProcessTest.StandardInputWrite
The child process would simpky execute ls, then exiting right away. Writing to its stdin would then crash with "EPIPE: An attempt is made to write to a pipe that is not open for reading by any process." as the child process exited.
2016-04-24 16:04:46 -04:00
Alexander Köplinger 04162ffbbd Merge pull request #2941 from jogibear9988/patch-1
Bugfix DateTime in Sqlite: https://bugzilla.xamarin.com/show_bug.cgi?id=40603
2016-04-24 13:49:48 -04:00
Marek Safar 3aafc25cc4 Revert "[verifier] Do method visibility checks for virtual final methods. Enable type visibility for all methods. Fixes #5644."
This reverts commit 24ee5b8db0.
2016-04-24 16:08:52 +02:00
Marek Safar 20b564dd08 Revert "WIP - don't merge"
This reverts commit 359bb511d3.
2016-04-24 16:08:38 +02:00
Marek Safar 0a49f951f7 Revert "WIP fix the previous issue."
This reverts commit a26a533698.
2016-04-24 16:08:21 +02:00
Marek Safar def4458cdc [corlib] Reenable IsReadOnly test 2016-04-24 09:58:51 +02:00
Marek Safar 7f207ba946 [xbuild] Fix ApplicationIcon incremental build dependency 2016-04-24 09:58:51 +02:00
Marek Safar b3e2ebf9dd Merge pull request #2942 from jogibear9988/patch-2
bugfix numInfo of Cultureinfo NonSerialized on Windows
2016-04-24 09:49:59 +02:00
Marek Safar 15b054f53e Merge pull request #2945 from mono/xi-40574
[linker] Method decorated with System.Runtime.Serialization.*Attribut…
2016-04-24 09:04:31 +02:00
Sebastien Pouliot 309e7277de [linker] Method decorated with System.Runtime.Serialization.*Attribute must be marked, Fixes #40574
Some serialization attributes are unlikely to have direct reference,
from IL, but will be needed at runtime to correctly serialize (or
deserialize) objects.

* OnDeserializedAttribute
* OnDeserializingAttribute
* OnSerializedAttribute
* OnSerializingAttribute

This, along with aad627c5e8, fixed bug
40574. The later part will have new unit tests in XI.

references:
https://bugzilla.xamarin.com/show_bug.cgi?id=40574
2016-04-23 05:05:38 -04:00
Marek Safar aad627c5e8 [corlib] Disable core security icalls on mobile 2016-04-23 08:57:01 +02:00
Miguel de Icaza 55b3ef64ac Microsoft relicensed this fork of the Ajax library under the MIT license 2016-04-22 20:19:02 -04:00
Miguel de Icaza ed8bfd0b4a Microsoft relicensed this fork of the DLR under the MIT license 2016-04-22 20:18:34 -04:00
Aleksey Kliger (λgeek) 69b03a509b Merge pull request #2944 from lambdageek/dev/monoerror-thread_create
[runtime] MonoError-ize mono_thread_create{,_internal}
2016-04-22 15:18:33 -04:00
Aleksey Kliger 8d785f019f [runtime] MonoError-ize mono_thread_create{,_internal}
Mark mono_thread_create external only.  Runtime should use
mono_thread_create_checked.
2016-04-22 11:33:03 -04:00
Marek Safar bdd0de7ee5 [corlib] FileInfo from referencesource 2016-04-22 17:11:56 +02:00
Marek Safar 853884299e [corlib] Remove System.Core security types 2016-04-22 13:37:39 +02:00
Marek Safar eaf991dac2 [corlib] Remove duplicated sources 2016-04-22 10:35:44 +02:00
Marek Safar 4f8c66cd7c [System.Core] Add CommonCrypto dependencies 2016-04-22 10:30:09 +02:00
Marek Safar f996138183 [corlib] FileSystemInfo from reference source 2016-04-22 10:08:45 +02:00
Alexander Köplinger 12b29a1a8a [acceptance-tests] Move roslyn build dependencies to download server
storage.bos.internalx.com is only available via VPN now.

Also bump coreclr to get a recent minor fix.
2016-04-22 09:50:18 +02:00
Marek Safar b9425affd3 Merge pull request #2943 from mono/xi-40570
[System.Core] Add back AesManaged to tvOS and watchOS profiles. Fixes #40570
2016-04-22 07:55:16 +02:00
Kirill 7773099298 [WindowsBase] Serialization fix of Int32Rect, Point, Rect, Size, Vector, Matrix (#2873)
The problem is that private fields in described types doesn't start from _ prefix, but it should be so according to reference source.
That's way MONO can't deserialize that types correctly if source stream was created by MS .NET binary serializer.

This change is released under the MIT license.
2016-04-22 00:44:52 -04:00
Sebastien Pouliot eecca1fa0e [System.Core] Add back AesManaged to tvOS and watchOS profiles
Switching maccore to use mono-4.5.0-branch introduced this bug where
AesManaged is not available in System.Core for both tvOS and watchOS
profiles (iOS is fine).

This results in unit tests failures on bots building maccore/master.

This fix the problem by importing the "main" monotouch_System.Core.
dll.sources into the other profiles - since they all share the same
feature set (in this case) and make it less likely to forget something
else in the future.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=40570
2016-04-21 21:25:38 -04:00
Zoltan Varga 92bcc1db28 [runtime] Allow enums with base type of char in Enum.ToObject (), this is valid in f#. Fixes #40568. 2016-04-21 17:23:09 -04:00
monojenkins bd62c1e12b Merge pull request #2940 from xmcclure/disable-jit-gsharedvt
Fix gsharedvt compile on DISABLE_JIT platforms
2016-04-21 21:40:20 +01:00
Jochen Kühner 9a663d6be4 bugfix numInfo of Cultureinfo NonSerialized on Windows, https://bugzilla.xamarin.com/show_bug.cgi?id=35872
Cultureinfo numInfo is not NonSerialized on DotNet for windows, so it also should not on mono.

http://referencesource.microsoft.com/#mscorlib/system/globalization/cultureinfo.cs,76
2016-04-21 21:59:57 +02:00
Jochen Kühner a90d5d8e15 Bugfix https://bugzilla.xamarin.com/show_bug.cgi?id=40603 2016-04-21 21:41:05 +02:00
Atsushi Eno c641b32930 [I18N/CJK] iso-2022-jp GetChars() had some bogus conversion ranges. 2016-04-22 03:08:23 +09:00
Andi McClure bbbb941ee2 Fix gsharedvt compile on DISABLE_JIT platforms 2016-04-21 13:18:47 -04:00
Alexander Köplinger d5c88ebee2 Merge pull request #2939 from discofire/patch-1
Update OracleConnection.cs
2016-04-21 18:24:58 +02:00
discofire 705d0d319b Update OracleConnection.cs
Fix SQL syntax for GetSchemaProcedures function. (Should have been 'SELECT' instead of 'SSELECT')
2016-04-21 11:48:49 -04:00
Andi McClure 7a3356be22 Merge pull request #2918 from lateralusX/jlorenss/aot-x86-symbol-fix
Windows 32-bit x86 AOT assembler didn't compile due to incorrect symbol mangling.
2016-04-21 10:04:40 -04:00
Vlad Brezae a4a3aea41e Merge pull request #2869 from BrzVlad/feature-mod-union-opt
[sgen] Optimize mod union usage
2016-04-21 16:53:02 +03:00
monojenkins ed9211bae9 Merge pull request #2935 from kumpera/new-gc-test
[sgen] Add regression test for the interaction between the bridge and handles.

The bridge code was triggering handles to be considered deallocated thus leading
them to be overwritten.
2016-04-21 08:45:27 +01:00
monojenkins 7f5d060b9f Merge pull request #2932 from ludovic-henry/fix-waithandle-remoting
[corlib] Ifdef out calls to SynchronizationAttribute on monotouch

When WaitHandle was imported from referencesource in f6fa8f0, the code was refactored and basically all WaitHandle.Wait* calls end up in WaitOneNative or WaitMultiple now.

On monotouch those methods threw a NotSupportedException when exitContext == true even before the import, so this behavior got inherited to some other methods that didn't throw after the exception was removed from them in 93e31cb. This broke tests in maccore and other code that passed exitContext=true.

To fix this, we just ifdef out the calls to SynchronizationAttribute on monotouch since they don't make sense there anyway since remoting isn't available. The commit that initially added the exception in 2ce9fc1 only did that to make the behavior consistent when the linker is enabled. By removing the calls we get the same result.

Do the same for Monitor so we're consistent.

commit message from @akoeplinger
2016-04-21 07:30:26 +01:00
monojenkins 4e9160841d Merge pull request #2880 from kumpera/fix_5644
[verifier] Do method visibility checks for virtual final methods. Enable type visibility for all methods. Fixes #5644.

I cannot repro the issue mentioned in the comments of mono_method_can_access_method.

* FIXME:
* with generics calls to explicit interface implementations can be expressed
* directly: the method is private, but we must allow it. This may be opening
* a hole or the generics code should handle this differently.
* Maybe just ensure the interface type is public.

@monojenkins merge
2016-04-20 23:50:38 +01:00
Rodrigo Kumpera 9b7f5a0097 [sgen] Add regression test for the interaction between the bridge and handles.
The bridge code was triggering handles to be considered deallocated thus leading
them to be overwritten.
2016-04-20 15:15:18 -07:00
Joel Martinez 8ff2f4518e [docs] Added index.xml entry for CFNetworkHandler. (#2930)
This particular piece of documentation is added manually, because it's not in the regular BCL library, but is provided by Xamarin on the iOS platform. Because it was missing an entry in the index file, it was excluded from the published documentation when doing mdoc assemble.
2016-04-20 16:51:37 -04:00
Zoltan Varga cde767b6ba Merge pull request #2934 from vargaz/fix-36852
[sgen] Avoid returning NULL from null_link_if (), that means an empty…
2016-04-20 16:14:44 -04:00
Ludovic Henry 06dff0b90e [corlib] Ifdef out calls to SynchronizationAttribute on monotouch
When WaitHandle was imported from referencesource in f6fa8f0, the code was refactored and basically all WaitHandle.Wait* calls end up in WaitOneNative or WaitMultiple now.

On monotouch those methods threw a NotSupportedException when exitContext == true even before the import, so this behavior got inherited to some other methods that didn't throw after the exception was removed from them in 93e31cb. This broke tests in maccore and other code that passed exitContext=true.

To fix this, we just ifdef out the calls to SynchronizationAttribute on monotouch since they don't make sense there anyway since remoting isn't available. The commit that initially added the exception in 2ce9fc1 only did that to make the behavior consistent when the linker is enabled. By removing the calls we get the same result.

Do the same for Monitor so we're consistent.
2016-04-20 21:17:11 +02:00
Zoltan Varga e156dd586f [sgen] Avoid returning NULL from null_link_if (), that means an empty slot, not a handle pointing to null. Fixes #36852. 2016-04-20 14:53:45 -04:00
Alex Rønne Petersen 6a25ee98dd [profiler] Remove unnecessary compiler flags related to exceptions. 2016-04-20 19:58:38 +02:00
Alex Rønne Petersen cfd9870f83 [profiler] Don't build shared libraries under bitcode.
We load these at runtime so they will naturally have undefined symbols. This is
not allowed under bitcode, though, and we use the static libraries in that case
anyway.
2016-04-20 19:57:53 +02:00
Rodrigo Kumpera a26a533698 WIP fix the previous issue. 2016-04-20 10:14:46 -07:00
Rodrigo Kumpera 359bb511d3 WIP - don't merge 2016-04-20 08:37:58 -07:00
Rodrigo Kumpera 24ee5b8db0 [verifier] Do method visibility checks for virtual final methods. Enable type visibility for all methods. Fixes #5644.
I cannot repro the issue mentioned in the comments of mono_method_can_access_method.

* FIXME:
* with generics calls to explicit interface implementations can be expressed
* directly: the method is private, but we must allow it. This may be opening
* a hole or the generics code should handle this differently.
* Maybe just ensure the interface type is public.
2016-04-20 08:37:58 -07:00
Marek Safar 11640a9e73 [build] Add missing empty assemblies needed by default csc config 2016-04-20 17:29:06 +02:00
Rodrigo Kumpera 6f7c5bdf4e [profile] Fix a regression from last commit. 2016-04-20 08:21:37 -07:00
Aleksey Kliger (λgeek) 8aaa40bc73 Merge pull request #2859 from lambdageek/dev/monoerror-object-c
[runtime] Grab bag of MonoError fixes in object.c
2016-04-20 10:46:47 -04:00
Marek Safar c8e8895c0d [mcs] Fixes crash during conversion error reporting. Fixes #40536 2016-04-20 15:56:46 +02:00
Marek Safar 7980adc6c5 [mcs] null operator receiver type needs to be convertible to null. Fixes #40493 2016-04-20 14:26:04 +02:00
Marek Safar 5718f12bd1 [tools] Fixes compiler tester error messages verification 2016-04-20 14:26:04 +02:00
Alex Rønne Petersen 785c22693d [profiler] Build all profiler modules in the same way.
Specifically, we need to set the same linker flags for all of them. This should
fix linker errors on iOS ARM64.
2016-04-20 12:34:15 +02:00
Alex Rønne Petersen 10044cf0cd [profiler] Remove unused OProfile stuff from the build system. 2016-04-20 09:54:41 +02:00
Marek Safar 26b4a3d856 Merge pull request #2891 from xmcclure/bug-39669
Allow xml configuration sections to reference System.dll (bug#39669)
2016-04-20 08:09:32 +02:00
Rodrigo Kumpera cbf9ddad25 [profiler] Remove unneeded call to mono_lock_free_queue_node_init.
Remove calls to mono_lock_free_queue_node_init for nodes that just came out of mono_lock_free_queue_dequeue.

That call is superfluous as dequeue will set the returned node 'next' field to INVALID_NEXT, which is the
same thing the mono_lock_free_queue_node_init call did.
2016-04-19 15:59:07 -07:00
monojenkins 37e0ed9066 Merge pull request #2922 from akoeplinger/fix-tvos
[utils] Fix MONO_SIGNAL_USE_UCONTEXT_T not being defined on tvOS simulator

In the maccore tvossimulator tests we were seeing the following assertion with the Mono 4.5 preview:

```
error: * Assertion: should not be reached at /Users/builder/data/lanes/1381/0d6923b4/source/maccore/external/mono/mono/utils/mono-context.c:194

0   dont link                           0x000000010175702d mono_handle_native_sigsegv + 253
1   libsystem_platform.dylib            0x000000010a0cfeaa _sigtramp + 26
2   ???                                 0x0000000001bfc4db 0x0 + 29344987
3   libsystem_c.dylib                   0x0000000109e56cbc abort + 129
4   dont link                           0x00000001018d1503 _ZL12log_callbackPKcS0_S0_iPv + 67
5   dont link                           0x00000001018c26d0 monoeg_assertion_message + 192
6   dont link                           0x00000001018af6de mono_sigctx_to_monoctx + 30
7   dont link                           0x000000010183f473 sgen_suspend_thread + 323
8   dont link                           0x000000010183f58e sgen_thread_handshake + 126
9   dont link                           0x000000010183fb20 sgen_client_stop_world + 1296
10  dont link                           0x0000000101871283 sgen_stop_world + 67
11  dont link                           0x0000000101870d43 sgen_perform_collection + 99
12  dont link                           0x0000000101872576 sgen_gc_collect + 102
13  dont link                           0x00000001018d1886 _ZL7pump_gcPv + 54
14  libsystem_pthread.dylib             0x000000010a0b7c13 _pthread_body + 131
15  libsystem_pthread.dylib             0x000000010a0b7b90 _pthread_body + 0
16  libsystem_pthread.dylib             0x000000010a0b5375 thread_start + 13
```

This was caused by a4e257a07f, the issue is that the check was changed from UCONTEXT_REG_RAX to MONO_SIGNAL_USE_UCONTEXT_T, but that is only available when HAVE_SIGACTION is defined which it is not in this case.

Talked with Zoltan, fixing this by enabling MONO_SIGNAL_USE_UCONTEXT_T on all apple platforms for now.

/cc @vargaz @xmcclure 

@monojenkins merge
2016-04-19 23:40:34 +01:00
Rodrigo Kumpera 17c9e92ec0 Another round of profiler fixes/improvements. PR #2882 (Manually Merged)
https://github.com/mono/mono/pull/2882
2016-04-19 15:13:09 -07:00
Aleksey Kliger aa77ff4a78 [runtime] MonoError-ize mono_ldstr_metadata_sig 2016-04-19 18:07:21 -04:00
Aleksey Kliger 17a832fe80 [runtime] MonoError-ize mono_string_new_len
Mark it external only.  Runtime should use mono_string_new_len_checked.
2016-04-19 18:07:21 -04:00
Aleksey Kliger 81d93a12a9 [runtime] MonoError-ize mono_wait_handle_new 2016-04-19 18:07:21 -04:00
Aleksey Kliger 727db9b87b [runtime] MonoError-ize mono_array_new_cached 2016-04-19 18:07:21 -04:00
Aleksey Kliger 0b710d0c2e [runtime] MonoError-ize mono_array_new
Mark it external only.

Runtime should use mono_array_new_checked.
The icall is ves_icall_array_new.
2016-04-19 18:07:21 -04:00
Aleksey Kliger 955d40a60d [runtime] object.c don't raise in external only functions
- Variants of mono_object_new
- mono_object_clone
- mono_array_new_full

All these functions have _checked variants that are used by the runtime.
2016-04-19 18:07:21 -04:00
Aleksey Kliger 90aef8e9b3 [runtime] MonoError-ize mono_array_clone
1. Mark mono_array_clone external only.  Runtime should use
  mono_array_clone_checked.
2. Add MonoError* arg to mono_array_clone_in_domain.
3. Separate ves_icall_System_Array_Clone
2016-04-19 18:07:21 -04:00
Aleksey Kliger 9d7590a44a [runtime] Mark mono_object_new_from_token external only.
Does not appear to be used in the runtime.
Changed it not to raise exceptions.
2016-04-19 18:07:21 -04:00
Aleksey Kliger e491b1bb9f [runtime] Set pending, don't raise, in object.c icalls 2016-04-19 18:07:21 -04:00
Aleksey Kliger 65dc3f67e6 [runtime] MonoError-ize mono_object_xdomain_representation 2016-04-19 18:07:21 -04:00
Aleksey Kliger 589f479cb9 [runtime] MonoError-ize mono_property_get_value
Mark it external only.  Runtime should use mono_property_get_value_checked.
2016-04-19 18:07:21 -04:00
Aleksey Kliger eac5495a37 [runtime] MonoError-ize mono_property_set_value
Mark it external only.  Runtime should use
mono_property_set_value_checked.

Note: mono_property_set_value_checked always catches exceptions from
managed code and threads them out via MonoError.
2016-04-19 18:07:21 -04:00
Aleksey Kliger 2467bb0169 [runtime] Don't raise exns, set pending exception 2016-04-19 18:07:21 -04:00
Aleksey Kliger d1d204e252 [runtime] MonoError-ize mono_runtime_create_jump_trampoline 2016-04-19 18:07:21 -04:00
Aleksey Kliger af36aeb2c1 [attach] Don't raise in mono_attach_load_agent 2016-04-19 18:07:21 -04:00
monojenkins a94d2a7271 Merge pull request #2806 from lambdageek/dev/monoerror-marshal_remote
[runtime] MonoError-ize marshal and remoting code

Get rid of calls to `mono_raise_exception` in marshaling and remoting code.
2016-04-19 22:50:30 +01:00
Rodrigo Kumpera 92341ad8a0 [profiler] Don't link against libmono.
This would result in duplicate runtimes being loaded (as evidenced by
/proc/$pid/maps), which could lead to all sorts of breakage.
2016-04-19 14:34:46 -07:00
Alex Rønne Petersen e91ee2b0fd [profiler] Load the profiler with MONO_DL_EAGER.
We need to make sure all external references have been resolved so that we
don't invoke the dynamic linker in the mono_sample_hit () callback which is
called in async-signal context.
2016-04-19 14:34:46 -07:00
Alex Rønne Petersen 49b60893e3 [utils/dl] Add a MONO_DL_EAGER enum value for clarity. 2016-04-19 14:34:46 -07:00
Alex Rønne Petersen 8a461af0dd [profiler] Don't use a real-time signal on Android. 2016-04-19 14:34:46 -07:00
Alex Rønne Petersen 72a86baf24 [profiler] Use 'start_unload' events instead of 'end_unload' events to avoid crashes.
'end_unload' events can receive mostly-freed structures.
2016-04-19 14:34:46 -07:00
Alex Rønne Petersen 2e5b0e88e3 [profiler] Use a signal to interrupt the sampler thread's sleep if needed.
There is a slight problem when we're using CLOCK_PROCESS_CPUTIME_ID: If we're
shutting down and there's largely no activity in the process other than waiting
for the sampler thread to shut down, it can take upwards of 20 seconds
(depending on a lot of factors) for us to shut down because the sleep
progresses very slowly as a result of the low CPU activity.

We fix this by repeatedly sending the profiler signal to the sampler thread in
order to interrupt the sleep.

We do not need to do this on platforms where we use a regular sleep based on a
monotonic clock. The sleep will return in a reasonable amount of time in those
cases.
2016-04-19 14:34:46 -07:00
Alex Rønne Petersen 3335358725 [profiler] Add some more counters. 2016-04-19 14:34:46 -07:00
Andi McClure 6637a6532c [profiler] Limit the number of allocated sample hit structures. 2016-04-19 14:34:46 -07:00
Andi McClure 962fcc1198 [profiler] Add counters for log buffers and sample hits. 2016-04-19 14:34:46 -07:00
Alex Rønne Petersen 92b5bb6ecb [profiler] Rewrite the log profiler's handling of sample hits.
The old code had quite a few problems:

1. It would result in stack corruption under heavy load, somehow. This typically
   resulted in an assertion when starting the unwinding process because the
   unwinding flags would be inconsistent.
2. It sometimes wrote complete garbage into the statistical buffers.
3. As a result of using the helper thread to assemble collected samples into log
   buffers, it did not work on platforms where the helper thread is disabled.
4. Performance was poor under heavy load because waking up the helper thread to
   assemble events would always trigger a counters sample + dump.
5. The code was very complicated and hard to understand/maintain.

(Points (1) and (2) can probably be attributed to point (5).)

In the new sampling world order, we use a lock-free allocator and a lock-free
reuse queue to acquire memory for sample hit events in the sample hit callback.
We then fill it with the info we collect during the async stack walk. Finally,
we ship it off to a separate dumper thread (via another lock-free queue) where
it gets turned into a log buffer and then shipped off to the writer thread.

This new approach appears very stable; I've yet to make it crash in any of the
stress tests I typically run. In a heavy workload, the helper thread's CPU
usage was previously around 25-30%. It is now down to basically 0% while the
dumper thread is only around 15%. CPU usage by threads that are collecting
samples is a bit higher than before, but only until the reuse queue converges
on a size that is big enough to satisfy all sample event requests. At that
point, no more allocations from the lock-free allocator happen, and performance
improves.
2016-04-19 14:34:46 -07:00
Alex Rønne Petersen 1f890d0095 [utils/lfa] Export the lock-free allocation code for use in the profiler. 2016-04-19 14:34:46 -07:00
Andi McClure 88758ef94d [profiler] Add counters for numbers of signals sent/received/accepted. 2016-04-19 14:34:46 -07:00
Alex Rønne Petersen 4c6c318b2b [counters] Add a profiler category. 2016-04-19 14:34:46 -07:00
Alex Rønne Petersen c26ff53fa4 [profiler] Make the default sample frequency 100 Hz.
Our previous default (1000 Hz) was quite extreme and resulted in very high
overhead from the profiler for moderate workloads.

Also, fix the profiler to actually treat the 'freq' argument as a frequency
when passing it to the runtime. It was being incorrectly treated as a sleep
interval.
2016-04-19 14:34:46 -07:00
Alex Rønne Petersen c8b2029080 [domain] Report domain unloads to the profiler when finalizing the domain.
We would miss the unload event for the root domain because we reported it just
before freeing the domain, by which time the profiler was detached.
2016-04-19 14:34:46 -07:00
Alex Rønne Petersen 7083567661 [profiler] Only initialize the sampler thread once. 2016-04-19 14:34:46 -07:00
Marek Safar 39d63219ee [System.Configuration] Fail tests on standalone error 2016-04-19 23:24:12 +02:00
Andi McClure fee605ccc5 Add xml configuration section test (bug#39669) 2016-04-19 17:13:31 -04:00
Marek Safar 11059591da [System.Configuration] re-enable standalone tests 2016-04-19 23:10:21 +02:00
Alexander Köplinger 04669f1ea9 [utils] Fix MONO_SIGNAL_USE_UCONTEXT_T not being defined on tvOS simulator
In the maccore tvossimulator tests we were seeing the following assertion with the Mono 4.5 preview:

```
error: * Assertion: should not be reached at /Users/builder/data/lanes/1381/0d6923b4/source/maccore/external/mono/mono/utils/mono-context.c:194

0   dont link                           0x000000010175702d mono_handle_native_sigsegv + 253
1   libsystem_platform.dylib            0x000000010a0cfeaa _sigtramp + 26
2   ???                                 0x0000000001bfc4db 0x0 + 29344987
3   libsystem_c.dylib                   0x0000000109e56cbc abort + 129
4   dont link                           0x00000001018d1503 _ZL12log_callbackPKcS0_S0_iPv + 67
5   dont link                           0x00000001018c26d0 monoeg_assertion_message + 192
6   dont link                           0x00000001018af6de mono_sigctx_to_monoctx + 30
7   dont link                           0x000000010183f473 sgen_suspend_thread + 323
8   dont link                           0x000000010183f58e sgen_thread_handshake + 126
9   dont link                           0x000000010183fb20 sgen_client_stop_world + 1296
10  dont link                           0x0000000101871283 sgen_stop_world + 67
11  dont link                           0x0000000101870d43 sgen_perform_collection + 99
12  dont link                           0x0000000101872576 sgen_gc_collect + 102
13  dont link                           0x00000001018d1886 _ZL7pump_gcPv + 54
14  libsystem_pthread.dylib             0x000000010a0b7c13 _pthread_body + 131
15  libsystem_pthread.dylib             0x000000010a0b7b90 _pthread_body + 0
16  libsystem_pthread.dylib             0x000000010a0b5375 thread_start + 13
```

This was caused by a4e257a07f, the issue is that the check was changed from UCONTEXT_REG_RAX to MONO_SIGNAL_USE_UCONTEXT_T, but that is only available when HAVE_SIGACTION is defined which it is not in this case.

Discussed with Zoltan, fixing this by enabling MONO_SIGNAL_USE_UCONTEXT_T on all apple platforms for now.
2016-04-19 21:59:29 +02:00
Aleksey Kliger 338e190a86 [runtime] Remove use of mono_raise_exception in mono_object_isinst_mbyref_checked 2016-04-19 15:57:23 -04:00
Aleksey Kliger 192c495757 [remoting] Remove calls to mono_raise_exception
1. MonoError-ize mono_remoting_wrapper icall.
   This is a bit this method is allowed to use
   mono_error_raise_exception: it is called from a
   MONO_WRAPPER_REMOTING_INVOKE method which is considered a "protected
   wrapper" in which the usual pending exception interruption check is a no-op.
2. Use mono_set_pending_exception in mono_marshal_set_domain_by_id icall

fixup f5dc934
2016-04-19 15:54:58 -04:00
Ludovic Henry a6582f4405 [mini] Add missing gsharedvt write barrier
The following test would trigger a SIGSEGV during a GC collection:

```
object _Lock;
C5.HashedLinkedList<byte[]> _Set;
List<byte[]> _Candidates;

void Run ()
{
    _Lock = new object ();
    _Set = new C5.HashedLinkedList<byte[]>(new Core.CommonUtils.ByteArrayComparer());

    BuildList ();

    for (var i = 0; i < 10; ++i) {
	     Task.Run (() => WorkOnSet ());
	}
}

void BuildList() {
    _Candidates = new List<byte[]>();

    Random r = new Random();
	for(var i = 0; i < 20; ++i) {
	    var key = new byte[16];
		r.NextBytes(key);
		_Candidates.Add(key);
	}
}

void WorkOnSet() {
    Random r = new Random();
	for (;;) {
	    byte[] src = _Candidates [r.Next (_Candidates.Count)];
		byte[] key = new byte[src.Length];

        for (int i = 0; i < src.Length; ++i)
		    key [i] = src [i];

        lock(_Lock) {
		    if(r.Next (2) != 0)
			    _Set.Add(key);
			else
			    _Set.Remove(key);
		}
	}
}
```

The binary protocol just before the crash would be as follow:

```
collection_requested generation 0 requested_size 4096 force false
collection_begin index 14 generation 0
  copy from 0x3150658 to 0x47e0e40 vtable 0x189f1780 size 24
  gray_enqueue queue 0xa4a2d0 cursor 0x3b68178 value 0x47e0e40
  gray_dequeue queue 0xa4a2d0 cursor 0x3b68178 value 0x47e0e40
  scan_begin obj 0x47e0e40 vtable 0x189f1780 size 24
  scan_process_reference obj 0x47e0e40 ptr 0x47e0e48 value 0x3150618
  scan_process_reference obj 0x47e0e40 ptr 0x47e0e4c value 0x3150638
  scan_process_reference obj 0x47e0e40 ptr 0x47e0e50 value 0x0       <----- here the value is 0x0
  scan_process_reference obj 0x47e0db0 ptr 0x47e0dc0 value 0x47e0e40
collection_end 14 generation 0 scanned 0 unique 0 0.00%
 wbarrier ptr 0x3af8710 value 0x47e0e40 value_vtable 0x189f1780
collection_requested generation 0 requested_size 4096 force false
collection_begin index 15 generation 0
collection_end 15 generation 0 scanned 0 unique 0 0.00%
collection_requested generation 0 requested_size 4096 force false
collection_begin index 16 generation 0
  card_scan start 0x47e0df8 size 520
  scan_begin obj 0x47e0e40 vtable 0x189f1780 size 24
  scan_process_reference obj 0x47e0e40 ptr 0x47e0e48 value 0x47b4d40
  scan_process_reference obj 0x47e0e40 ptr 0x47e0e4c value 0x47b03c0
  scan_process_reference obj 0x47e0e40 ptr 0x47e0e50 value 0x3100800 <----- here the value is 0x3100800, but no WB in between
```

Object at 0x47e0e40 is a C5.HashSet<T>.Bucket with T a C5.KeyValuePair<byte[],C5.HashedLinkedList<byte[]>.Node>. The memory layout of C5.HashSet<T>.Bucket would be as follow:

class Bucket {
 item: offset 8 size 8
 overflow: offset 16 size 4
 hashval: offset 20 size 4
}

So the bug would manifest itself as a missing write barrier when writing to Bucket.overflow, leading to the premature sweeping of a Bucket object. The Bucket.overflow value would then point to the middle of an object, triggering a SIGSEGV when trying to access its vtable.
2016-04-19 21:47:33 +02:00
Marek Safar baf2db5cb7 [mcs] Don't do empty array interpolation on user code, weird code expects empty array not to be equal 2016-04-19 19:14:44 +02:00
lateralusX 09ba9118ce Windows 32-bit x86 AOT assembler didn't link correctly.
When running basic make check in mono/mini there are some hidden errors in the check-seq-points test. Current test compares output between JIT and AOT compile assemblies but doesn't pay attention to the result of the as and ld calls building the AOT:ed modules. It turns out that the linkage of the AOT compiled module on win32 x86 actually fails due to naming of symbols included in .def or .globl assembler expressions. The fix makes sure that local function symbols or global symbol definitions follows the cdecl win32 x86 convention and are prefixed with _. The fix tries to resolve this using two different strategies. Since there are many code paths in the AOT compiler emitting local/global symbols + referencing the emitted symbols, it doesn't look like there is one place to fix this (unless rename the symbol altogether and that could cause regressions elsewhere).

First, local function symbols are emitted using .def expression when used as debug symbols. By prefixing debug symbols with _ will resolve most of the local function symbols. By mangling the debug symbols we can fix both emitted symbols and references to these symbols in two location (get_debug_sym, get_plt_entry_debug_sym).

Second, in order to make sure all other symbols (local/global) ending up in .def or .globl expressions are correctly mangled, the functions to emit local/global symbols in aot-compiler.c have been extended to check mangling on passed in symbols before emitting. If passed in symbol doesn't follow the name mangling rule, the symbols will be mangled and the mangled symbol will be emitted together with a label to the mangled symbol. This is done to make sure we have a correct label for the emitted symbol that can be used by the linker. Since the rest of the code is unaware of the mangled name, it will continue reference the unmangled name and since there is already a label to the unmangled symbol, the mangling will be transparent for the rest of the code.

NOTE, the fix only applies to windows X86 build, other configurations are not affected by this issue.

This PR also includes a fix detected on windows when debugging and fixing above issue. The AOT compiler tries to rename linked module to the final target name, for example from basic.exe.dll.tmp to basic.exe.dll. If the file already exist, the rename will fail on windows causing a silent failure in the AOT compiler and this will "leak" the tmp file + ending up with the old basic.exe.dll. The fix is to check result of the rename function call and if it fails with "file already exist error", unlink target and redo rename operation. The rename can still fail due to other reasons ending up in the same problem, but to make a good fix, the error handling of the method needs to be revisited in order to properly clean up tmp files and allocations in error cases. This will be handled in a different PR.
2016-04-19 17:17:46 +02:00
Marek Safar 6fcf58023d [symbolicate] Switch to Cecil backend 2016-04-19 15:26:57 +02:00
Marek Safar 3bde0e1343 [monosymbolicate] Small cleanups 2016-04-19 15:26:57 +02:00
Marek Habersack 4dc84baeb6 Support custom Xamarin Android HttpClient handler
Make it possible to select a default System.Net.HttpClient handler
on Android. Selection of the handler is handled on the Xamarin Android
side.
2016-04-19 15:06:07 +02:00
Alex Rønne Petersen 0de3ceb482 Merge pull request #2863 from alexrp/windows-critsect-debug-info
[utils/mutex] Initialize Win32 critical sections without debug info.
2016-04-19 11:48:24 +02:00
Rolf Bjarne Kvinge f3ed954e3a [offsets-tool] Fix path to Options.cs 2016-04-19 10:41:31 +02:00
monojenkins f5f7357856 Merge pull request #2919 from lewurm/random-mini-stuff
Random mini stuff

@monojenkins merge
2016-04-19 08:15:21 +01:00
Rodrigo Kumpera 7b4a585094 [io-layer] Fail to modification time if it's beyond the limit allowed by the system. Fixes #40368
This is the case for 32bits OSX that uses 32bits time_t for everything.
2016-04-18 17:03:26 -07:00
Aleksey Kliger (λgeek) af8d667efa Merge pull request #2821 from lambdageek/dev/monoerror-assembly
[assembly loader] Don't raise in mono_assembly_open_full and mono_assembly_load_with_partial_name
2016-04-18 18:02:47 -04:00
monojenkins 976a327692 Merge pull request #2910 from cptjazz/compiler_warnings
Fix undefined behaviour in left-shift.

This PR fixes a left-shift that relied on undefined behaviour.

Clang emitted the following warning (prior to this patch):
```
sgen-descriptor.c:189:54: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
   return desc | VECTOR_SUBTYPE_REFS | ((gssize)(-1) << 16);
                                        ~~~~~~~~~~~~ ^
```
2016-04-18 23:00:48 +01:00
Bernhard Urban cbfbf3e083 [debug] print exception name for conditional exception OP 2016-04-18 13:47:06 -07:00
Aleksey Kliger 30ff102b13 [runtime] MonoError-ize mono_store_remote_field_new
Mark mono_store_remote_field_new external only.
Runtime should use mono_store_remote_field_new_checked.
Change mono_marshal_get_stfld_remote_wrapper to use
mono_store_remote_field_new_icall instead of a native call.
2016-04-18 16:36:56 -04:00
Aleksey Kliger d89bc33cbc [runtime] MonoError-ize mono_store_remote_field
Marked it external only.
Runtime should use mono_store_remote_field_checked.
2016-04-18 16:36:56 -04:00
Aleksey Kliger e761bf0bee [runtime] MonoError-ize mono_load_remote_field_new
Add mono_load_remote_field_new_checked.  Mark mono_load_remote_field_new
external only.  Add icall mono_load_remote_field_new_icall and use it in
remoting wrappers.
2016-04-18 16:36:56 -04:00
Aleksey Kliger 5d54ae64d8 [runtime] Add mono_load_remote_field_checked
Update it to use MonoError.

Mark mono_load_remote_field external only.
2016-04-18 16:36:56 -04:00
Aleksey Kliger 149106822f [runtime] MonoError-ize mono_method_return_message_restore 2016-04-18 16:36:56 -04:00
monojenkins 4ba928c1af Merge pull request #2814 from lambdageek/dev/monoerror-appdomain
[appdomain] Cleanup MonoError code

1. Assert in mono_get_corlib_version instead of raising an exn.
2. Don't raise in mono_domain_create_appdomain external API function.
3. Assert in mono_domain_assembly_postload_search instead of raising.
4. Don't raise in mono_domain_fire_assembly_load.
5. Use mono_error_set_pending_exception in
   ves_icall_System_AppDomain_InternalGetProcessGuid
6. Dont' raise in unload_thread_main, populate unload_data instead.
2016-04-18 20:15:22 +01:00
Alexander Köplinger 8fb1aa95b4 Bump version in configure.ac 2016-04-18 20:22:56 +02:00
Bernhard Urban 1a423521eb [marshal] use meaningful constant instead of hard coded value 2016-04-18 11:18:18 -07:00
Zoltan Varga cf36181a85 [jit] Fix the linking of bblocks in mono_replace_ins () by avoiding iterating over an array which is modified in place by mono_unlink_bblock (). 2016-04-18 13:27:00 -04:00
Rolf Bjarne Kvinge 28faf0a6d1 [tools] Add aot offsets generation tool.
List of original contributors:

Marek Habersack <[email protected]>
João Matos <[email protected]>
Zoltan Varga <[email protected]>
Rolf Bjarne Kvinge <[email protected]>
2016-04-18 19:26:17 +02:00
Ludovic Henry 9e11bda561 Merge pull request #2916 from ludovic-henry/fix-40306
[threadpool-io] Fix crash on shutdownin System.Net.Sockets.Socket:Close_internal
2016-04-18 18:58:42 +02:00
monojenkins d71d663db6 Merge pull request #2915 from poedgirl/master
Added support for SHA256, 384 and 512 in AuthenticodeDeformatter.

Due to the changes introduced by Microsoft to require signing with stronger algorithms, SHA-256, SHA-384 and SHA-512 support was needed.

This change is released under the MIT license.
2016-04-18 15:05:26 +01:00
Ludovic Henry fb6dbac941 [threadpool-io] Fix crash on shutdownin System.Net.Sockets.Socket:Close_internal
There could be a race between System.Net.Sockets.Socket:Close_internal and the io threadpool cleanup, which would lead to a native crash. That's because the io threadpool cleanup would clean the mutex, condition variables as well as close the sockets.

The easiest way to fix that is by cleaning only what's going to stop the runtime from shutting down, and in this case the background selector thread. The same is done for the threadpool where we just shutdown the monitor thread and the worker threads.
2016-04-18 15:40:44 +02:00
Michelle Allen 09463dc30d Added support for SHA256, 384 and 512 in AuthenticodeDeformatter.
Due to the changes introduced by Microsoft to require signing with stronger algorithms, SHA-256, SHA-384 and SHA-512 support was needed.

This change is released under the MIT license.
2016-04-18 19:30:57 +08:00
monojenkins 8b938bfb15 Merge pull request #2897 from kumpera/marshal_fixes
[marshal] Ensure marshal code emit the right indirect store when dealing with ref types.

The marshal code was using CEE_STIND_I for a lot of ref stores. This would not
generate a WB and is a heap corruption vector.
2016-04-18 06:00:21 +01:00
Kamil Rytarowski f4272716f4 Implement mono_threads_core_set_name() on NetBSD (#2914)
Part of man-page showing this interface:

PTHREAD_GETNAME_NP(3)      Library Functions Manual      PTHREAD_GETNAME_NP(3)

NAME
     pthread_getname_np - get and set descriptive name of a thread

LIBRARY
     POSIX Threads Library (libpthread, -lpthread)

SYNOPSIS
     #include <pthread.h>

     int
     pthread_getname_np(pthread_t thread, char *name, size_t len);

     int
     pthread_setname_np(pthread_t thread, const char *name, void *arg);

   -- pthread_setname_np(3)
2016-04-17 21:55:53 -04:00
Alexander Köplinger c15efc6bd0 Merge pull request #2913 from krytarowski/netbsd-support-11
Remove stale file in the repository
2016-04-18 00:52:40 +02:00
Kamil Rytarowski 82e996cb45 Remove stale file in the repository
The .orig files are traditionally files of patch(1) and diff(1) tools.
Remove stale file Makefile.orig as it is generating false positives for
grabbing patches from a directory tree.
2016-04-18 00:50:15 +02:00
Alexander Köplinger a5d23edf3b Merge pull request #2912 from krytarowski/netbsd-support-10
Remove unportable shell construct detected on NetBSD
2016-04-18 00:12:49 +02:00
monojenkins 95bce9b69c Merge pull request #2911 from akoeplinger/handleref
[metadata] Don't require HandleRef in domain.c

In 1da6b76297 loading of System.Runtime.InteropServices.HandleRef
was changed from optional to required. This caused errors in the maccore tests:

```
MONO_PATH=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/64/Build /Users/builder/data/lanes/1411/5ca65b46/source/maccore/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt  --aot=mtriple=arm64-ios,data-outfile=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/System.arm64.aotdata,static,asmonly,direct-icalls,full,dwarfdebug,no-direct-calls,outfile=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/System.dll.arm64.s "/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/64/Build/System.dll"
Runtime critical type System.Runtime.InteropServices.HandleRef not found
AOT Compilation exited with code 134, command:
```

@monojenkins merge
2016-04-17 22:55:19 +01:00
Kamil Rytarowski 17b6dd5de0 Remove unportable shell construct detected on NetBSD 2016-04-17 22:45:26 +02:00
Alexander Köplinger b71914b011 [metadata] Don't require HandleRef in domain.c
In 1da6b76297 loading of System.Runtime.InteropServices.HandleRef
was changed from optional to required. This caused errors in the maccore tests:

```
	MONO_PATH=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/64/Build /Users/builder/data/lanes/1411/5ca65b46/source/maccore/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt  --aot=mtriple=arm64-ios,data-outfile=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/System.arm64.aotdata,static,asmonly,direct-icalls,full,dwarfdebug,no-direct-calls,outfile=/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/System.dll.arm64.s "/Users/builder/data/lanes/1411/5ca65b46/source/maccore/msbuild/tests/MyKeyboardExtension/obj/iPhone/Debug/mtouch-cache/64/Build/System.dll"
	Runtime critical type System.Runtime.InteropServices.HandleRef not found
	AOT Compilation exited with code 134, command:
```
2016-04-17 20:22:04 +02:00
Alexander Köplinger 1a207e45d3 Merge pull request #2908 from krytarowski/netbsd-support-8
Add new ./configure target & xtarget: arm*-netbsd*-eabi*
2016-04-17 20:08:00 +02:00
Alexander Köplinger a7142a010e Merge pull request #2907 from krytarowski/netbsd-support-7
Improve NetBSD target handling in ./configure
2016-04-17 20:07:38 +02:00
Alexander Köplinger 438c8f378c Merge pull request #2906 from krytarowski/netbsd-support-6
Welcome to ARM ucontext registers on NetBSD
2016-04-17 20:06:56 +02:00
Alexander Köplinger d5aa88456b [tests/verifier] Fix a few issues in the Makefile
gmcs and ilasm2 are no longer distributed with Mono.

The run-test step had several issues that prevented it from running,
e.g. the comments caused "unexpected end of line" issues on OSX.
2016-04-17 19:53:04 +02:00
Alexander Köplinger 4288ef6e24 Merge pull request 2899 from krytarowski/netbsd-support-1
Improve shell portability on NetBSD

The "test" command, as well as the "[" command, are not required to know
the "==" operator.

Comparing with empty strings ("") might lead to unspecified results.

Replace unportable shell loops:
    for I in {2..6}; do ..; done
with POSIX ones:
    I=2; while [ $I -le 6 ]; do ..; I=$((I + 1)); done
2016-04-17 19:24:59 +02:00
Alexander Jesner 697bbb6eb4 Fix undefined behaviour in left-shift. 2016-04-17 18:31:32 +02:00
Kamil Rytarowski 3e49908edb Add new ./configure target & xtarget: arm*-netbsd*-eabi*
Example GNU triplets:

evbarm	7.0	NetBSD	ignored	arm	arm-unknown-netbsdelf7.0
evbarm	7.0	NetBSD	ignored	armeb	armeb-unknown-netbsdelf7.0
evbarm	7.0	NetBSD	ignored	earmv6	armv6-unknown-netbsdelf7.0-eabi
evbarm	7.0	NetBSD	ignored	earmv6eb	armv6eb-unknown-netbsdelf7.0-eabi
evbarm	7.0	NetBSD	ignored	earmv6hf	armv6-unknown-netbsdelf7.0-eabihf
evbarm	7.0	NetBSD	ignored	earmv6hfeb	armv6eb-unknown-netbsdelf7.0-eabihf
evbarm	7.0	NetBSD	ignored	earmv7	armv7-unknown-netbsdelf7.0-eabi
evbarm	7.0	NetBSD	ignored	earmv7eb	armv7eb-unknown-netbsdelf7.0-eabi
evbarm	7.0	NetBSD	ignored	earmv7hf	armv7-unknown-netbsdelf7.0-eabihf
evbarm	7.0	NetBSD	ignored	earmv7hfeb	armv7eb-unknown-netbsdelf7.0-eabihf

-- http://git.savannah.gnu.org/cgit/config.git/tree/testsuite/config-guess.data

For now support just EABI targets (available since ARMv4).
2016-04-17 16:06:40 +02:00
Kamil Rytarowski 70189554b3 Improve NetBSD target handling in ./configure
Stop hardcoding libc and linbintl versions.
Add support for libsqlite and libsqlite3.
2016-04-17 15:47:20 +02:00
Kamil Rytarowski 90424b08f6 Welcome to ARM ucontext registers on NetBSD 2016-04-17 15:39:27 +02:00
Kamil Rytarowski d0f0b15bd0 Improve shell portability on NetBSD
The "test" command, as well as the "[" command, are not required to know
the "==" operator.

Comparing with empty strings ("") might lead to unspecified results.

Replace unportable shell loops:
    for I in {2..6}; do ..; done
with POSIX ones:
    I=2; while [ $I -le 6 ]; do ..; I=$((I + 1)); done
2016-04-17 15:27:24 +02:00
Alexander Köplinger 453c2d5489 Merge pull request #2900 from krytarowski/netbsd-support-2
Fix shell portability in configure.ac for NetBSD
2016-04-17 13:37:21 +02:00
Alexander Köplinger cff70522a6 Merge pull request #2904 from krytarowski/netbsd-support-5
Include <errno.h> for errno on NetBSD
2016-04-17 13:36:33 +02:00
Alexander Köplinger c0b300d4fc Merge pull request #2898 from ludovic-henry/fix-process-hasexited
[corlib] Fix WaitHandle.Wait{One,Any,All} when runtime returns WAIT_FAILED
2016-04-17 13:35:31 +02:00
Alexander Köplinger 908acf313c Merge pull request #2905 from directhex/force-dpkg-architecture
[jenkins] Force build arch = dpkg arch, on Debian systems
2016-04-17 13:10:15 +02:00
Jo Shields 144e64c911 [jenkins] Force build arch = dpkg arch, on Debian systems
Autotools misdetects architecture when using chroots, e.g. tries to do an x86_64 build on an x86_64 system in an i386 chroot
2016-04-17 09:28:54 +01:00
Alexander Köplinger a6f5b39f76 Merge pull request #2901 from krytarowski/netbsd-support-3
Define access to R8-R11 regs in ucontext on NetBSD/AMD64
2016-04-17 03:56:38 +02:00
Alexander Köplinger 0ba6902034 [System] Replace websocket echo test server with corefx one (#2902)
echo.websocket.org is down since yesterday. Let's use the one that corefx uses for now.
2016-04-16 21:33:24 -04:00
Kamil Rytarowski 5804ac2250 Include <errno.h> for errno on NetBSD
The <sys/errno.h> header on NetBSD declares only a list of ERROR values.

This fixes the following build issue:

In file included from ../../mono/utils/mono-proclib.h:7:0,
                 from mono-proclib.c:8:
mono-proclib.c: In function 'mono_cpu_usage':
mono-proclib.c:893:54: error: 'errno' undeclared (first use in this function)
   g_error ("getrusage() failed, errno is %d (%s)\n", errno, strerror (errno));
                                                      ^
../../eglib/src/glib.h:600:70: note: in definition of macro 'g_error'
 #define g_error(...)    do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, __VA_ARGS__); for (;;); } while (0)
                                                                      ^
mono-proclib.c:893:54: note: each undeclared identifier is reported only once for each function it appears in
   g_error ("getrusage() failed, errno is %d (%s)\n", errno, strerror (errno));
                                                      ^
../../eglib/src/glib.h:600:70: note: in definition of macro 'g_error'
 #define g_error(...)    do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, __VA_ARGS__); for (;;); } while (0)
2016-04-17 03:31:52 +02:00
Kamil Rytarowski b522eab5ff Implement mremap(2) usage on NetBSD
The NetBSD version of mremap takes additional argument "newp" to hint
new position of a mapped range.

     void *
     mremap(void *oldp, size_t oldsize, void *newp, size_t newsize,
         int flags);

  -- NetBSD's mremap(2)

While Linux by default sets old_address and fails if the resize
operation cannot be finished for the original address.

       void *mremap(void *old_address, size_t old_size,
                    size_t new_size, int flags, ... /* void *new_address */);

  -- Linux's mremap(2)

NetBSD offers inversed logic with the MAP_FIXED flag to Linux's MREMAP_MAYMOVE:

     MAP_FIXED          newp is tried and mremap() fails if that address can't
                        be used as new base address for the range.  Otherwise,
                        oldp and newp are used as hints for the position,
                        factoring in the given alignment.

  -- NetBSD's mremap(2)

       MREMAP_MAYMOVE
              By default, if there is not sufficient space to expand a mapping
              at its current location, then mremap() fails.  If this flag is
              specified, then  the  kernel  is permitted to relocate the
              mapping to a new virtual address, if necessary.  If the mapping
              is relocated, then absolute pointers into the old mapping
              location become invalid (offsets relative to the starting address
              of the mapping should be employed).

  -- Linux's mremap(2)

The thing that bothers is calling mremap(2) syntax from Linux "posix", but we
cannot do anything with it, for now just simulate the Linux behavior on NetBSD.
2016-04-17 02:46:57 +02:00
Kamil Rytarowski 41e243af73 Define access to R8-R11 regs in ucontext on NetBSD/AMD64 2016-04-17 01:01:19 +02:00
Kamil Rytarowski 30604f6821 Fix shell portability in configure.ac for NetBSD 2016-04-16 23:40:01 +02:00
Ludovic Henry 95b8eb4942 [corlib] Fix WaitHandle.Wait{One,Any,All} when runtime returns WAIT_FAILED
In case the runtime would fail to wait on the wait handle(s), we would still return true, as if the WaitHandle was successfully signaled
2016-04-16 14:05:39 +02:00
Alexis Christoforides 2d68253ca7 Merge pull request #2890 from mono/alexischr/remove-managed-alloc-string-zeroing
[sgen] Remove unnecessary and wrong IL code on string managed allocators
2016-04-16 06:24:17 -04:00
Marek Safar 40a4dd7c94 [System] Remove MONO_X509_ALIAS 2016-04-16 08:56:38 +02:00
Marek Safar aa77a6ddcc [System] Remove PrebuiltSystem alias (it's not needed with any modern mcs) 2016-04-16 08:37:07 +02:00
Alexis Christoforides ba3384aa88 Merge pull request #2417 from razzfazz/guard_substr
handle path stripping correctly for root of watched tree
2016-04-15 22:57:33 -04:00
Alexis Christoforides d2d50dd0c8 Merge pull request #2889 from mono/alexischr/canary-sizecalc-change-impact
[sgen] "align-up" requested allocation sizes within the managed alloc…
2016-04-15 22:35:47 -04:00
Zoltan Varga 7355e71d8f [runtime] Fix warnings. 2016-04-15 20:11:25 -04:00
Marek Safar 32f2f7c898 Merge pull request #2894 from marek-safar/mono.security
[build] Fixes Mono.Security dependency
2016-04-16 00:41:02 +02:00
Rodrigo Kumpera 0a8f9cea84 [marshal] Ensure marshal code emit the right indirect store when dealing with ref types.
The marshal code was using CEE_STIND_I for a lot of ref stores. This would not
generate a WB and is a heap corruption vector.
2016-04-15 15:19:37 -07:00
monojenkins efcef476e3 Merge pull request #2893 from kumpera/fix_29585
Fix #29585.

@monojenkins merge.
2016-04-15 18:05:39 +01:00
Rolf Bjarne Kvinge 771d935b50 [mono-api-html] Fix path in csproj. 2016-04-15 17:38:22 +02:00
Marek Safar 3aacd09c28 [mcs] Better error message for conflict of types with the same name 2016-04-15 17:29:14 +02:00
Marek Safar c2ae64c264 [build] Fixes Mono.Security dependency 2016-04-15 15:41:14 +02:00
monojenkins 24418b8821 Merge pull request #2887 from lewurm/fix-jit-pass-name
[jit] fix stats name for method_to_ir pass

we settled for underscores


@monojenkins merge.
2016-04-15 13:41:00 +01:00
Alexander Köplinger 2b9d8d1d0b Merge pull request #2885 from ntherning/fix_test_op_il_seq_point_sh_on_cygwin_2_4_1
Fixes for  'make check-seq-points' on Cygwin
2016-04-15 13:49:53 +02:00
Rodrigo Kumpera 1ca65b172d Merge pull request #2878 from kumpera/mach_fixes
Add retry logic to mach function calls.
2016-04-15 02:11:46 -07:00
Marek Safar 5ca65b4624 [mcs] No optional parameters tie breaking rules for delegates overload resolution 2016-04-15 10:41:38 +02:00
Rodrigo Kumpera 6b68ce1ed7 Add regression test. 2016-04-14 17:53:55 -07:00
Alexander Köplinger 5ddcd3b972 [corlib] Fix CspParametersTest.Ctor test
This essentially reapplies ae2f50e57f which was inadvertently changed back in 27f07c8095.

It started failing again after 255ce320b0 reapplied a fix that was also inadvertently removed (https://github.com/mono/referencesource/commit/8c7937a9e7cc3f61f9ceb6a9d6f19fefdf1672b0).
2016-04-15 02:53:49 +02:00
Rodrigo Kumpera 2796abb60d [runtime] Fix mono_class_inflate_generic_method_full_checked handle of partially inflated generic methods. Fixes #29585.
The problem here was that the function was not correctly setting is_generic when handling partially inflated methods.

The working scenario was method 'Foo<A>::Bar<B>' inflated with (Something<Else>;)[1] resulting in Foo<Something<Else>>::Bar<B>.

This would work because the is_generic check would verify that the supplied context has no method_inst, thus had to remain a GMD.

The problematic one would be inflating Foo<Something<A>>::Bar<B> with (Else;) resulting too in Foo<Something<Else>>::Bar<B>.

To handle this, we would first extract the root method definition [2] and then inflate the original method context with the supplied
context. So we end up with Foo<A>::Bar<B> and inflate (Something<A>;B) with (Else;) resulting in (Something<Else>;B) *1*.

Finally, we would inflate Foo<A>::Bar<B>  with that new context, resulting in Foo<Something<Else>>::Bar<B>.

The resulting method is the same in both scenarios, but context used for inflation is different in that in the second case
it includes the GMD method instantiation (The B in *1*).

This would trip up the computation of whether we ended up with a GMD or not.

The right check, though, is not whether the inflation context has a method instantiation or not, but whether the resulting method
has the same method context as the root GMD[2].

This affected #29585 since disabling some optimizations triggered things to be inflated in different ways.

[1] (Something<Else>;) means a context with a class instantiation and no method instantiation
[2] The GMD defined on the GTD.
2016-04-14 17:39:44 -07:00
Andi McClure a2e91efda8 Allow xml configuration sections to reference System.dll (bug#39669)
<configuration><configSections><section> in a .config file takes a
type name as argument. Some of the allowed types are in System.dll.
The type lookup is done in System.Configuration.dll and does not find
these types. Check System.dll as a fallback to fix this.
2016-04-14 18:14:10 -04:00
Bernhard Urban d63352a16f [jit] fix stats name for method_to_ir pass
we settled for underscores
2016-04-14 14:14:45 -07:00
Alexis Christoforides 30f0795c82 [sgen] Remove unnecessary and wrong IL code on string managed allocators
This appears to have been copied from Boehm, but here we are not responsible for zeroing.
Also, 's->chars [len]' is not the same as 'align_up (s + size) - 2', so this was corrupting canaries.
2016-04-14 16:55:48 -04:00
Alexis Christoforides 2160413fd6 [sgen] "align-up" requested allocation sizes within the managed allocator, instead of sometimes before.
All code paths will still align-up the size to be allocated, but now it's easier to gather the real size of an object.
2016-04-14 16:43:20 -04:00
Zoltan Varga 5e80f625b9 [aot] Enable gsharedvt by default only when using --aot=full or --aot==llvmonly. 2016-04-14 16:39:30 -04:00
Alexander Köplinger 07c22a0e68 Merge pull request #2888 from xmcclure/serialize-exception-bump
Bump corlib version number following PR#2875
2016-04-14 22:28:20 +02:00
Andi McClure a3f8e50329 Bump corlib version number following PR#2875 2016-04-14 16:26:39 -04:00
Andi McClure 1cdde1253c Merge pull request #2875 from xmcclure/serialize-exception
Support SerializeObjectState for System.Exception (bug #39824)
2016-04-14 16:18:00 -04:00
Alexis Christoforides 255ce320b0 Bump to include referencesource/8c7937a9e7cc3f61f9ceb6a9d6f19fefdf1672b0. Fixes #38712 2016-04-14 15:41:32 -04:00
Vlad Brezae 4776afb4e2 [sgen] Don't reallocate mod_union at each major 2016-04-14 22:23:58 +03:00
Vlad Brezae adb2608e5e [sgen] Avoid allocating the mod_union card tables if not needed
The first nursery collection after the start of a concurrent collection allocated mod union card tables for all blocks. Allocate it only for blocks that have dirty cards. Blocks without a mod_union are not scanned in the major collector. This can reduce the pause time of those nursery collections by half.
2016-04-14 22:23:56 +03:00
monojenkins 3e81958f1d Merge pull request #2803 from BrzVlad/feature-conc-pinned-scan
[sgen] Scan pinned objects in nursery as part of concurrent mark

Objects pinned in the nursery can hide behind them a large graph of objects in the heap which is never scanned because we don't follow references in the nursery. After precleaning, we scan the latest set of pinned objects (while locking in order to make sure that the set doesn't change, so none are moved).
2016-04-14 20:15:35 +01:00
Rodrigo Kumpera a6c292335d [MACH] Add retry logic to all mach api calls in the case of interruption.
One overlooked aspect of mach is that its calls are interruptible and
we never really accounted for that.

This problem turned up when sampling at high frequency as they would
start to randomly fail.
2016-04-14 10:25:41 -07:00
Rodrigo Kumpera fe3996638c [OSX] Drop more support for OSX 10.5 and earlier.
10.5 is ancient enough at this point. Remove code dealing with the exception server
that is not needed after it.
2016-04-14 10:25:41 -07:00
Niklas Therning d89a5b27c6 Renamed SEP variable to PLATFORM_PATH_SEPARATOR. 2016-04-14 17:36:30 +02:00
Niklas Therning b2a7035386 * Fixes 'diff: /dev/fd/63: Not a directory' errors when running
'make check-seq-points' on Cygwin 2.4.1 64-bit.
* Added removal of *.exe.dll to the clean_aot() function to delete AOT output
  from previous 'make check-seq-points' runs.
* Use ';'' as separator in MONO_PATH if running under Cygwin rather than ':'.
2016-04-14 16:48:56 +02:00
Vlad Brezae a4f1baa3db [sgen] Scan pinned objects in nursery as part of concurrent mark
Objects pinned in the nursery can hide behind them a large graph of objects in the heap which is never scanned because we don't follow references in the nursery. After precleaning, we scan the latest set of pinned objects (while locking in order to make sure that the set doesn't change, so none are moved).
2016-04-14 17:26:17 +03:00
Alexander Köplinger 8ed1ada014 Fix the referencesource submodule commit 2016-04-14 16:00:31 +02:00
Alexander Köplinger ee05b73875 Merge pull request #2884 from ludovic-henry/fix-process-hasexited
[Process] Fix HasExited for non-child process
2016-04-14 15:58:31 +02:00
Ludovic Henry 122cc01e85 [Process] Fix HasExited for non-child process
NativeMethods.GetExitCodeProcess would inherently be broken on Unix platforms for non-child processes as it can't succesfully get the exit code. This would in turn break Process.HasExited, which should not break, as it is possible to check if a non-child process is alive or dead.
2016-04-14 13:15:21 +02:00
Ludovic Henry 08a631d96d [Process] Set haveProcessHandle to true when setting m_processHandle 2016-04-14 13:15:20 +02:00
Jo Shields 3b8d505c7c Revert "Fix missing CommonCrypto/Makefile.include in "make dist" tarballs"
Needed due to Marek's CommonCrypto changes

This reverts commit c0ea809052.
2016-04-14 09:40:29 +01:00
Marek Safar c0ed815cdc Revert "Revert "[Mono.Security] Fixes wrong path in makefile""
This reverts commit b0c6a92785.
2016-04-14 08:30:22 +02:00
Marek Safar 635cf9c103 Revert "Revert "[build] Clean up common crypto build""
This reverts commit ba9d141ed8.
2016-04-14 08:13:47 +02:00
Marek Safar 7612d3eaa5 [Mono.Security] Fixes build 2016-04-14 08:07:31 +02:00
Daniel Becker a06225626c use native realpath() function (#2877)
Instead of opening a file for the sole purpose of calling
F_GETPATH on the resulting descriptor, we can just use the
native realpath() function; as a side benefit, this also works
on *BSD where F_GETPATH isn't supported.
2016-04-13 22:53:34 -04:00
monojenkins c0a05a881c Merge pull request #2879 from lewurm/undo-breaking-changes
Undo breaking changes

@monojenkins merge
2016-04-14 03:15:22 +01:00
Bernhard Urban ba9d141ed8 Revert "[build] Clean up common crypto build"
This reverts commit ecd2f512ce.
2016-04-13 17:21:57 -07:00
Bernhard Urban b0c6a92785 Revert "[Mono.Security] Fixes wrong path in makefile"
This reverts commit 90611f9185.
2016-04-13 17:20:29 -07:00
Andi McClure b04a3a355f Support SerializeObjectState for System.Exception (bug #39824)
Per current .NET, exception serialization may be implemented using the
SerializeObjectState event. Use of this approach is mandatory for
certain classes, such as HttpRequestException subclasses. Mono does
not support it. The solution is to switch out our System.Exception
implementation for the referencesource one.

To accommodate this, classes that access System.Exception internal
fields directly must switch to the new field names; a new support
method is added to System.Environment; the "security level" methods
and icall are added to MonoCMethods; and the field order in
_MonoException must be adjusted. A new test is also added in the
System.Runtime.Serialization assembly.
2016-04-13 18:36:08 -04:00
Zoltan Varga 05f449eda9 [arm] Use a direct branch in the krait workaround to avoid clang generating extra code and moving it before the inline assembly block. Fixes #40239. 2016-04-13 16:28:21 -04:00
Alexander Köplinger e142636435 Move remaining System.Net.Http pieces from mono-extensions to mono
Discussed with @rolfbjarne, these were missed in the initial import of the mono-extension sources.
2016-04-13 18:58:43 +02:00
monojenkins 46f9cc2f97 Merge pull request #2874 from lateralusX/jlorenss/win-x64-support
jlorenss/win x64 support

Initial fixes needed in order to get pass on mono regression tests for windows x64 visual studio build,

--regression basic.exe basic-float.exe basic-long.exe basic-calls.exe objects.exe arrays.exe basic-math.exe exceptions.exe iltests.exe devirtualization.exe generics.exe basic-simd.exe

Before fixes there were failures in basic.exe, exceptions.exe and objects.exe for windows x64  Visual studio build.

Failures in basic.exe and exceptions.exe was due to a mix up of signal defines on windows platform in Visual Studio build  where SIGILL and SIGFPE was defined differently in different source files causing incorrect signal handler to be invoked at runtime, causing incorrect thrown .NET exception. Fix is to make sure signal.h is always included giving the same value for SIGILl and SIGFPE over all source files. 

Failures in objects.exe test_0_mul_ovf_regress_36052 caused a stack overflow crash when running togehter with branch optimization mode. This was due to incorrect lowering of x64 test instruction when optimization moved over to use R8 instead of RAX and current lowering didn't handle that correctly meaning that the actual test was performed against wrong register causing a loop that caused a stack overflow error. The specific amd64 codegen , amd64_test_reg_imm, is currently only used on x64 windows platform for the stackalloc call.
2016-04-13 17:35:31 +01:00
Marek Safar 90611f9185 [Mono.Security] Fixes wrong path in makefile 2016-04-13 18:18:37 +02:00
Marek Safar ecd2f512ce [build] Clean up common crypto build 2016-04-13 17:48:04 +02:00
Martin Baulig 0c6c338f8a Update X509CertificateImplApple. 2016-04-13 16:21:29 +02:00
Martin Baulig 522d4bedf0 [corlib]: Add X509CertificateImpl.GetNativeAppleCertificate().
In SSCX.OSX509Certificates.GetCertificate(), we cannot simply use
'X509Certificate.Handle' because it may point to something that's
not a SecCertificate.

(cherry picked from commit 3fc068f7e2)
2016-04-13 16:07:19 +02:00
Vlad Brezae 0db5f5ad0e Merge pull request #2800 from BrzVlad/feature-lazy-sweep
[sgen] Enable lazy sweep by default
2016-04-13 16:51:25 +08:00
Vlad Brezae 5bfdf6257d [sgen] Enable lazy sweep by default 2016-04-13 00:38:25 +03:00
Vlad Brezae 6ab30afc4b [sgen] Concurrently sweep blocks also in the lazy sweep case
In the lazy sweep case, the sweep job doesn't sweep the blocks. Instead, the blocks are swept when they are actually needed (when we want to allocate in the block, scan the block etc.). This delays the mutator or increases the nursery pauses. Try to sweep as many blocks as possible concurrently, immediately after we finish the sweep job.
2016-04-13 00:38:23 +03:00
Vlad Brezae 3544fc5690 Merge pull request #2822 from BrzVlad/feature-lshift-decomposition
[jit] Decompose long immediate shifts
2016-04-13 05:32:39 +08:00
Marek Safar ccdb941738 [corlib] Handle CreateDirectory with relative paths. Fixes #40187 2016-04-12 16:44:58 +02:00
Marek Safar 6381a73724 Bump reference source 2016-04-12 16:11:02 +02:00
Alex Rønne Petersen 40292be2b9 Merge pull request #2872 from alexrp/timer-dispose2-test
[corlib] Fix TimerTest.TestDispose2 () test.
2016-04-12 15:31:31 +02:00
Marek Safar 17193833a5 [corlib] SymbolType from reference source. Fixes #39911 2016-04-12 15:17:53 +02:00
lateralusX 9de5079322 Fixed incorrect lowering on x64 for test instruction when register r8-r15 where used.
Currently only triggered by objects.exe regression test on windows x64 with branch opt, since stackalloc gets lowered to this test and branch will start using R8 instead of RAX for the test.
2016-04-12 11:35:56 +02:00
lateralusX eedb5fcb00 Fixed issue on x64 windows Visual Studio builds where signal define values got mixedup.
Caused incorrect exception behavior and failures in basic.exe, exceptions.exe regression test on x64 windows. This was due to the fact that some source files didn't include signal.h while others did. In case where signal.h was not included incompatible defines were used for SIGILL and SIGFPE in mini-amd64.h.
2016-04-12 11:30:58 +02:00
Marek Safar f7c9e5c00b Bump referencesource 2016-04-12 11:29:38 +02:00
Alex Rønne Petersen a2350de0d9 [corlib] Fix TimerTest.TestDispose2 () test. 2016-04-12 07:01:01 +02:00
monojenkins abbb94537e Merge pull request #2870 from madewokherd/arginfo
x86 cleanups for register arguments

Best I can tell, cinfo->args and cfg->args need to be independent before implementing calling conventions where some arguments are in registers, at least if we want to do it cleanly. Also, storing the argument offset in a cfg->args instruction that claims to be for a register seems hacky and confusing to me.
2016-04-12 04:45:27 +01:00
Vlad Brezae 9a087d64fd [sgen] Fix compare function 2016-04-12 02:26:52 +03:00
Zoltan Varga e37b4bd124 [runtime] Avoid printing out the corlib version when running -v --version, it requires a working runtime. Fixes #40175. 2016-04-11 18:44:51 -04:00
Zoltan Varga 1523e667f3 [runtime] Fix the build of cominterop.c with DISABLE_JIT. 2016-04-11 18:33:30 -04:00
Vlad Brezae dfac8517b9 Merge pull request #2802 from BrzVlad/feature-evacuation-opt2
[sgen] Reduce number of evacuated objects
2016-04-12 04:38:19 +08:00
Vincent Povirk 8bb4495177 [x86] Don't use the inst_offset field of OP_REGVAR arguments. 2016-04-11 14:17:28 -05:00
Vincent Povirk bc4a2b0ee0 [x86] Store CallInfo in MonoCompileArch structure. 2016-04-11 14:17:27 -05:00
Marek Safar c5335b0020 [build] Remove unused lib paths 2016-04-11 20:36:10 +02:00
Marek Safar 415047c9ef [mcs] Dynamic context in constructor initializers or field initializers is static. Fixes #40088 2016-04-11 20:36:10 +02:00
Vlad Brezae 08a728d237 Merge pull request #2819 from BrzVlad/fix-major-log
[sgen] Fix major size logging
2016-04-12 00:23:50 +08:00
Vlad Brezae 81a6080fd4 [jit] Decompose long immediate shifts
We decompose them as part of the cprop pass to handle more immediates and to further propagate copies.

The native backend of some architectures (for example x86) may support long shifts with specialized instructions. Even there, this still makes immediate shifts 2 times faster because long ops are poorly handled by the jit.

On arm, where we were emulating, this makes long immediate shifts 3-5 times faster.
2016-04-11 19:21:32 +03:00
monojenkins 6bf65f009a Merge pull request #2867 from alexrp/sgen-block-size-ppc
[sgen] Set ARCH_MIN_MS_BLOCK_SIZE to 64k on both ppc32 and ppc64.

This fixes a problem that was happening on Debian ppc32 build machines. Since
they are set up as a 32-bit userland on a 64-bit kernel, Mono would be compiled
with an ARCH_MIN_MS_BLOCK_SIZE value of 16k. However, at runtime, the system
page size would be 64k (due to the 64-bit kernel with PPC_64K_PAGES set).

Signed-off-by: `Alex Rønne Petersen <[email protected]>`
2016-04-11 17:15:24 +01:00
Alex Rønne Petersen ea8f09a1d5 Merge pull request #2866 from alexrp/solaris-10-tls
[configure] Use __thread instead of pthread TLS on Solaris/x86.
2016-04-11 18:12:09 +02:00
Marek Safar 3d28ea307f [mcs] Use Array.Empty for empty arrays when available 2016-04-11 18:00:06 +02:00
Marek Safar e2d4e96fb4 [mcs] Tie-breaking rules are applied also for non-equivalent parameter types. Fixess #40183 2016-04-11 18:00:06 +02:00
Marek Safar 888c401f32 [mcs] Add tie breaking rule when candidate is in expanded form only and best has default arguments 2016-04-11 18:00:06 +02:00
monojenkins f2e5ddd6b6 Merge pull request #2868 from akoeplinger/maccore-fixes
[metadata] Ifdef out an icall that is not available in the DISABLE_REFLECTION_EMIT case

It caused errors like the following on the maccore builds:

```
  CCLD     libmonosgen-2.0.la
Undefined symbols for architecture armv7k:
  "_mono_reflection_get_custom_attrs_blob_checked", referenced from:
      _ves_icall_System_Reflection_Emit_CustomAttributeBuilder_GetBlob in libmonoruntimesgen.a(libmonoruntimesgen_la-icall.o)
ld: symbol(s) not found for architecture armv7k
```

---

This is the last patch required for getting maccore master to build again with mono master.

@monojenkins merge
2016-04-11 16:50:26 +01:00
Miguel de Icaza 66a493cefe Compiler-less mkbundle support in Mono.
This is the support that makes it so that mkbundle can create self-contained executables without requiring a native toolchain to be present. Also is the foundation to allow cross-compilation of self-contained executables.

This works by concatenating the runtime with the various dependencies and configuration files, attaching a directory at the end of the file and a signature to flag this as a runtime that has embedded resources in the executable file itself.

This works by modifying the runtime startup to check for a special signature at the end of the main executable, if it is not present, execution resumes as usual. Otherwise a directory is read from the end of the file which contains both the kind of file (assembly, configuration file, and so on), as well as pointer to the contents in the file. Then the regular Mono APIs to load resources are used to load these.This is the support that makes it so that mkbundle can create self-contained executables without requiring a native toolchain to be present. Also is the foundation to allow cross-compilation of self-contained executables.

This works by concatenating the runtime with the various dependencies and configuration files, attaching a directory at the end of the file and a signature to flag this as a runtime that has embedded resources in the executable file itself.

This works by modifying the runtime startup to check for a special signature at the end of the main executable, if it is not present, execution resumes as usual. Otherwise a directory is read from the end of the file which contains both the kind of file (assembly, configuration file, and so on), as well as pointer to the contents in the file. Then the regular Mono APIs to load resources are used to load these.
2016-04-11 10:42:51 -04:00
Alexander Köplinger 93281806aa [metadata] Ifdef out an icall that is not available in the DISABLE_REFLECTION_EMIT case
It caused errors like the following on the maccore builds:

```
  CCLD     libmonosgen-2.0.la
Undefined symbols for architecture armv7k:
  "_mono_reflection_get_custom_attrs_blob_checked", referenced from:
      _ves_icall_System_Reflection_Emit_CustomAttributeBuilder_GetBlob in libmonoruntimesgen.a(libmonoruntimesgen_la-icall.o)
ld: symbol(s) not found for architecture armv7k
```
2016-04-11 15:50:42 +02:00
Alexander Köplinger ae1e1bdc4a Merge pull request #2865 from akoeplinger/maccore-fixes
A few small fixes for maccore
2016-04-11 14:05:06 +02:00
Mathieu Malaterre be10407867 [sgen] Set ARCH_MIN_MS_BLOCK_SIZE to 64k on both ppc32 and ppc64.
This fixes a problem that was happening on Debian ppc32 build machines. Since
they are set up as a 32-bit userland on a 64-bit kernel, Mono would be compiled
with an ARCH_MIN_MS_BLOCK_SIZE value of 16k. However, at runtime, the system
page size would be 64k (due to the 64-bit kernel with PPC_64K_PAGES set).

Signed-off-by: Alex Rønne Petersen <[email protected]>
2016-04-11 11:09:08 +02:00
Alex Rønne Petersen 14461850b1 [configure] Use __thread instead of pthread TLS on Solaris/x86.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=32020

Tested on Solaris/x86 by Rainer Orth <[email protected]>.
2016-04-11 09:51:24 +02:00
Alex Rønne Petersen 2fedf0423e [utils/mutex] Initialize Win32 critical sections without debug info.
Apparently Windows doesn't free this debug info in Vista+ when calling
DeleteCriticalSection [1], so just avoid allocating it in the first place by
calling InitializeCriticalSectionEx with the CRITICAL_SECTION_NO_DEBUG_INFO
flag. This function is only available in Vista+, but we've dropped support for
XP anyway.

[1] http://stackoverflow.com/a/889853
2016-04-11 09:19:04 +02:00
Alexander Köplinger 5b76fe2dcc [mini] Add a stub for mono_arch_create_handler_block_trampoline to tramp-arm64.c
Otherwise it's not defined in the DISABLE_JIT case.
2016-04-11 02:38:22 +02:00
Alexander Köplinger 9df489cfba [metadata] reflection.c: add missing MonoError parameter for mono_reflection_lookup_dynamic_token
It was missed in the recent refactoring in 96373eb62e
2016-04-11 01:34:11 +02:00
Alexander Köplinger 9c9e9bf70f [metadata] Guard access to mb->locals_list with DISABLE_JIT ifdef
The field is only available when DISABLE_JIT is not defined.
2016-04-11 01:29:10 +02:00
Alexander Köplinger 460e55434d [build] Remove EXTENSION_include and _exclude from library.make
We do not have any .sources or .exclude.sources in mono-extensions anymore so this is no longer needed.
2016-04-10 18:46:37 +02:00
Alexander Köplinger 7e14426ec4 Merge pull request #2864 from cptjazz/python3_compatibility
Make versions script compatible to python3: Add () when using `print'.
2016-04-10 18:02:35 +02:00
Miguel de Icaza 3d1752383d Merge pull request #2854 from alexrp/lock-free-queue-docs
[utils/lfq] Clarify and document the lock-free queue API.
2016-04-10 10:44:18 -04:00
Alexander Jesner 7846db7cd4 Make versions script compatible to python3: Add () when using `print'. 2016-04-10 16:19:56 +02:00
Vlad Brezae 5860214681 [sgen] Evacuate from emptier blocks to fuller ones
We don't evacuate from full blocks. When it comes to blocks that have free slots, instead of evacuating all of them to a new set of blocks, aim to keep the fuller blocks around and evacuate the emptier ones into them.
2016-04-10 14:08:47 +03:00
Vlad Brezae 2db8321b7b [sgen] Don't evacuate full blocks 2016-04-10 14:08:44 +03:00
Alexis Christoforides 7e2eed75b4 Merge pull request #2851 from mono/mono-symbolicate-ikvm-master
[mono-symbolicate] Use IKVM.Reflection instead of System.Reflection
2016-04-09 20:07:58 -04:00
Marek Safar 2635e010d2 [mcs] Codegen of try-catch-finally with await inside both try and catch. Fixes #39866 2016-04-09 09:47:25 +02:00
monojenkins 908eee2763 Merge pull request #2860 from lewurm/fix-cfgdump-related-stuff
Fix `cfgdump` related stuff
2016-04-08 23:45:18 +01:00
Bernhard Urban a688c0c11e [jit] include cfgdump.h in common_sources 2016-04-08 12:03:30 -07:00
Bernhard Urban 6e740ebb2e [cfg-dump] fix warning 2016-04-08 11:59:51 -07:00
monojenkins bde98eb9fe Merge pull request #2856 from alexrp/profiler-fix-sem
[profiler] Fix incorrect initial writer semaphore value.

This was used during debugging. I forgot to revert it back to 0 before posting
the pull request (#2838). This led to ~3-5% more CPU usage by the writer thread
than actually necessary; it now sits around 0-1% for typical workloads.
2016-04-08 18:55:19 +01:00
Alex Rønne Petersen 558553457b [utils/lfq] Clarify and document the lock-free queue API. 2016-04-08 19:55:10 +02:00
Martin Baulig 00baea510b [corlib]: Add internal callback to 'X509Helper' to use System's X509Helper2.
(cherry picked from commit 5eaf4db091)
2016-04-08 19:12:02 +02:00
Martin Baulig 56e1874c7b [Mono.Security]: Cleanup 'CertificateValidationHelper'.
The overloaded GetValidator() which takes both 'MonoTlsSettings'
and 'MonoTlsProvider' is actually used by the test suite, so let's
keep it public.

(cherry picked from commit 0977d531d2)
2016-04-08 19:12:02 +02:00
monojenkins c88703ca74 Merge pull request #2857 from malaterre/master
Remove an undefined behavior

Found using gcc -fsanitize=bounds
2016-04-08 17:40:17 +01:00
Alexander Köplinger 9df2a4dc53 [ci] Don't use babysitter on Windows/cygwin
babysitter generates some temp paths in python when running under cygwin, which breaks down
when those paths are passed to the native Windows mono.exe during testing:

    Exception in TestRunnerThread ---> System.IO.DirectoryNotFoundException: Could not find a part of the path "C:\cygdrive\c\WINDOWS\TEMP\tmpC4K5yK\babysitter_report_current_test_file.txt".
2016-04-08 17:23:16 +02:00
Martin Baulig 694d8c6a56 [System]: Use MonoTlsProviderFactory.GetDefaultProviderInternal() to cache the result.
(cherry picked from commit 6d41d1562f)
2016-04-08 14:59:21 +02:00
Mathieu Malaterre a16fa2271a Remove an undefined behavior
Found using gcc -fsanitize=bounds
2016-04-08 12:49:17 +02:00
Alex Rønne Petersen 35c5a968d7 Merge pull request #2855 from malaterre/master
Remove a simple memory leak
2016-04-08 12:44:17 +02:00
Alex Rønne Petersen a3b5a6ee02 [profiler] Fix incorrect initial writer semaphore value.
This was used during debugging. I forgot to revert it back to 0 before posting
the pull request (#2838). This led to ~3-5% more CPU usage by the writer thread
than actually necessary; it now sits around 0-1% for typical workloads.
2016-04-08 12:43:00 +02:00
Mathieu Malaterre 0560c08ffa Remove a simple memory leak 2016-04-08 08:50:19 +02:00
monojenkins 4c2f145149 Merge pull request #2852 from alexrp/master
[profiler] Fix usage of the lock-free queue API.

* Free nodes hazardously.
* No need to unpoison nodes since we're not reusing them.
* Fix memory leak when emptying coverage queues.
2016-04-08 05:20:40 +01:00
Alex Rønne Petersen 1cddcd7442 [profiler] Fix a warning. 2016-04-08 02:53:30 +02:00
Alex Rønne Petersen c89edfe3fc [profiler] Fix usage of the lock-free queue API.
* Free nodes hazardously.
* No need to unpoison nodes since we're not reusing them.
* Fix memory leak when emptying coverage queues.
2016-04-08 02:53:27 +02:00
Alexander Köplinger 2e90180856 Merge pull request #2850 from madewokherd/inetpton
[configure] Also check that inet_pton is defined when building for Windows.
2016-04-08 02:18:00 +02:00
Alex Rønne Petersen de28858b4d [utils/hp] Export mono_thread_hazardous_try_free () for use in the profiler. 2016-04-08 01:17:46 +02:00
Alexander Köplinger fd90d421b5 [ci] Remove quotes from windows msbuild command
Turns out it wasn't the right fix.
2016-04-08 01:17:41 +02:00
Alexander Köplinger 614178836c [ci] Don't enable the mobile profiles on the community archs
It only takes time and e.g. causes issues if e.g. AOT doesn't work.
2016-04-08 00:52:33 +02:00
Alexis Christoforides 766253566c Remove unused Mono.Cecil references 2016-04-07 18:01:42 -04:00
Alexis Christoforides 1585d1dad3 [mono-symbolicate] Use IKVM.Reflection instead of System.Reflection
This is so that the tool can work independently of runtime assembly resolution (ie. to load alternate corlibs)
2016-04-07 17:53:14 -04:00
monojenkins 8f1d9944a8 Merge pull request #2788 from lambdageek/dev/monoerror-reflection-no-more-raise
[reflection] No more mono_*_raise_*

No more `mono_error_raise_exception` and `mono_raise_exception` in `reflection.c`
2016-04-07 22:15:36 +01:00
monojenkins 6ac96752dd Merge pull request #2769 from lewurm/jit-cfg-dump
[jit] mini IR dumping feature for IGV

related doc PR: https://github.com/mono/website/pull/189
2016-04-07 21:26:04 +01:00
Martin Baulig e307a0e939 [Mono.Security]: Add new internal 'MonoTlsProvider' APIs.
(cherry picked from commit c02a885bd6)
2016-04-07 21:14:46 +02:00
Martin Baulig 0d51914b4e [BoringTls]: Register via 'MonoTlsProviderFactory'.
(cherry picked from commit e43a5f7332)
2016-04-07 21:07:08 +02:00
monojenkins 1af57bfcb6 Merge pull request #2824 from lambdageek/dev/monoerror-icalls-noraise
[runtime] Set pending exception in icalls instead of raising.
2016-04-07 20:06:02 +01:00
Vincent Povirk 66a328019e [configure] Also check that inet_pton is defined when building for Windows.
The version of mingw-w64 on Debian wheezy has this symbol in its libraries
but not its headers.
2016-04-07 13:18:47 -05:00
monojenkins b852848dab Merge pull request #2848 from alexrp/master
[libgc] Fix broken AC_TRY_COMPILE() invocation in configure.ac.

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

Tested on PowerPC by `Mathieu Malaterre <[email protected]>`.
2016-04-07 18:35:18 +01:00
Aleksey Kliger 728b251fd2 [SRE] Remove uses of mono_error_raise_exception
1. icall `mono_image_module_basic_init`
2. icall `mono_reflection_sighelper_get_signature_local`
3. icall `mono_reflection_sighelper_get_signature_field`
4. API function mono_module_get_object
5. API function mono_type_get_object
6. API function mono_method_get_object
7. API function mono_field_get_object
8. API function mono_property_get_object
9. API function mono_event_get_object
2016-04-07 13:31:53 -04:00
Aleksey Kliger 61fefd64cc [reflection] Remove last uses of mono_raise_exception
1. static function `create_custom_attr` (set MonoError exception instance)
2. icall `mono_reflection_resolve_custom_attribute_data` (set pending
exception from MonoError). Also rename it to
ves_icall_System_Reflection_CustomAttributeData_ResolveArgumentsInternal
3. icall `mono_reflection_bind_generic_method_parameters` (set pending
exception from MonoError)  Not renaming this one because it's actually
used for two icalls:
System.Reflection.Emit.MethodBuilder.MakeGenericMethod and System.Reflection.MonoMethod.MakeGenericMethod_impl
2016-04-07 13:30:23 -04:00
Aleksey Kliger 05e70d71f3 [SRE] MonoError-ize reflection_methodbuilder_to_mono_method 2016-04-07 13:23:03 -04:00
Aleksey Kliger cd1760bff9 [SRE] MonoError-ize mono_reflection_create_generic_class
Change icall name to
ves_icall_System_Reflection_Emit_TypeBuilder_create_generic_class

Give mono_reflection_create_generic_class a MonoError argument,
and get rid of the redundant mono_reflection_create_generic_class_checked
2016-04-07 13:23:03 -04:00
Aleksey Kliger 26450098fc [assembly loader] Don't raise in mono_assembly_open_full and mono_assembly_load_with_partial_name
Set the return status instead.
2016-04-07 11:26:16 -04:00
Alexander Köplinger 89c209c78b [ci] Fall back to timeout command if babysitter doesn't work
Some Jenkins workers (e.g. the s390x one) have an earlier python version installed where the babysitter doesn't work.
Fall back to timeout in those cases.
2016-04-07 16:57:54 +02:00
Martin Baulig 8527bb09ec [BoringTls]: Merge the work branch.
* Mono.Security.Interface.ICertificateValidator2:
  new internal interface, deriving from ICertificateValidator.

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

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

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

* corlib, System, Mono.Security:
  add [assembly: InternalsVisibleTo].
2016-04-07 16:42:10 +02:00
Jo Shields 7ac71b1dbf [ci] Escape run-step.sh invocations, for paths with spaces in 2016-04-07 15:28:59 +01:00
monojenkins 4ef9c5f92d Merge pull request #2847 from vargaz/get-type-reflection
[runtime] Fix type_from_parsed_name () to work in the presence of inl…

…ining done by LLVM.
2016-04-07 08:20:22 +01:00
monojenkins 3e1d49388d Merge pull request #2809 from lambdageek/dev/monoerror-threads
[runtime] Don't call mono_raise_exception in thread utilities
2016-04-07 07:45:21 +01:00
Alex Rønne Petersen 13f33daabf [libgc] Fix broken AC_TRY_COMPILE() invocation in configure.ac.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=40144

Tested on PowerPC by Mathieu Malaterre <[email protected]>.
2016-04-07 08:37:30 +02:00
monojenkins 346cd3d86c Merge pull request #2838 from alexrp/profiler-writer-thread-cpu2
[profiler] Use a semaphore to signal the writer thread.

We would previously constantly try to dequeue from the writer queue which would
result in extremely high CPU usage, making many apps (e.g. Xamarin Studio)
nearly unusable.
2016-04-07 05:00:33 +01:00
Zoltan Varga 07cda57eb1 [arm64] Enable Unwind_Backtrace () support on arm64. 2016-04-06 22:41:10 -04:00
Zoltan Varga 7eec08cbb3 [runtime] Fix type_from_parsed_name () to work in the presence of inlining done by LLVM. 2016-04-06 21:24:19 -04:00
monojenkins 895071150a Merge pull request #2841 from lambdageek/dev/bug-40060
[corlib] Type.GetType parser and resolver improvements

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

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

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

1. Fix the resolver on the native side for types like `"System.Generic.Collections.Dictionary[System.Int32,MyType]"` where the generic type is from corlib and a type argument is from the current assembly.
2. Fix `get_caller_no_reflection` to work correctly when the call stack has a System.Reflection method as the immediate caller of the icall.
3. Fix the resolver on the native side to work when it's called from corlib's System namespace, not just System.Reflection.
4. Fix the managed parser to work with types like `"MyGeneric[MyType]"` where the generic argument is not an assembly qualified name or there's a mixture of aqn and non-aqn type arguments.  Also rationalize how the code handles assembly qualification in general.
5. Test cases
2016-04-07 01:34:46 +01:00
Ankit Jain 9444d475a4 Merge pull request #2844 from radical/assign-proj-config
[xbuild] Fix bug #40094 - AssignProjectConfiguration should fallback to project path if ..
2016-04-06 20:29:06 -04:00
Alex Rønne Petersen d13d7b5bb3 [profiler] Use a semaphore to signal the writer thread.
We would previously constantly try to dequeue from the writer queue which would
result in extremely high CPU usage, making many apps (e.g. Xamarin Studio)
nearly unusable.
2016-04-07 01:15:01 +02:00
Alex Rønne Petersen fc55e27d0c Merge pull request #2839 from alexrp/profiler-thread-detach
[profiler] Detach helper/writer threads before shutting them down.
2016-04-07 01:12:10 +02:00
Aleksey Kliger df8a68c20a [appdomain] Cleanup MonoError code
1. Assert in mono_get_corlib_version instead of raising an exn.
2. Don't raise in mono_domain_create_appdomain external API function.
3. Assert in mono_domain_assembly_postload_search instead of raising.
4. Don't raise in mono_domain_fire_assembly_load.
5. Use mono_error_set_pending_exception in
   ves_icall_System_AppDomain_InternalGetProcessGuid
6. Dont' raise in unload_thread_main, populate unload_data instead.
2016-04-06 18:45:12 -04:00
Aleksey Kliger e4db288c0a [threads] Add MonoError arg to init_root_domain_thread 2016-04-06 18:04:30 -04:00
Aleksey Kliger 1da67ec31a [threads] MonoError-ize mono_thread_set_name_internal 2016-04-06 18:04:29 -04:00
Alexander Köplinger 165f604f83 Replace android-libunwind submodule with a local copy
We can't keep it as a real git submodule since the repo contains an "aux" folder that breaks on Windows.
2016-04-06 23:39:21 +02:00
Aleksey Kliger 79dd5739c4 [MonoError] Add mono_error_set_invalid_operation utility function
to construct System.InvalidOperationException
2016-04-06 17:14:20 -04:00
Aleksey Kliger 051e63398f [threads] Add MonoError arg to create_thread
instead of throw_on_failure flag, pass a MonoError outarg and let the
caller decide what to do with it.
2016-04-06 17:14:20 -04:00
Aleksey Kliger 0e830baba6 [runtime] Don't call mono_raise_exception in ves_icall_Mono_Runtime_GetNativeStackTrace 2016-04-06 17:14:20 -04:00
Alex Rønne Petersen a102f6a81e [profiler] Detach helper/writer threads before shutting them down. 2016-04-06 22:36:45 +02:00
Alex Rønne Petersen 147f30cf93 [threads] Export mono_thread_info_detach () for use in the profiler. 2016-04-06 22:36:45 +02:00
Alexander Köplinger 4a71f9eee7 [ci] Put windows msbuild command in quotes 2016-04-06 22:34:52 +02:00
Rodrigo Kumpera 50869dfe28 Merge pull request #2837 from alexrp/master
Bunch of improvements surrounding thread names and reporting of such to the profiler
2016-04-06 16:28:34 -04:00
Ankit Jain 890f40d7ad [xbuild] Fix #40094, part 2/2: AssignProjectConfiguration - Fallback to
.. project path for lookup, if lookup by guid fails.

Fixes bxc #40094 .
2016-04-06 14:40:31 -04:00
Ankit Jain f225bc3110 [xbuild] Fix #40094, part 1/2: SolutionParser: Emit AbsolutePath="..."
.. attribute for CurrentSolutionConfigurationContents .

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

Related to fix for bxc #40094
2016-04-06 14:39:52 -04:00
Aleksey Kliger e915178746 [corlib] TypeSpec.Parse for non-assembly qualified names.
Previously for types like "Foo[P,Q]" the recursive call of the parser
would incorrectly consume the delimiter after a type argument (ie the
',' or ']') which would leave the caller potentially past the end of the
string which would signal a failed parse.  New behavior is to peek at
the delimiter but leave it up to the caller to consume.

Also `Type.GetType(name, null, null)` should behave like
`Type.GetType(name)` (previously it dropped generic type arguments).
2016-04-06 13:56:09 -04:00
Aleksey Kliger c521640567 [runtime] type_from_parsed_name can be called from System or System.Reflection
type_from_parsed_name is a helper for
ves_icall_System_Type_internal_from_name which is called directly from
System.Type as well as indirectly by System.TypeNameParse.  We should
skip over all those classes to find the managed caller.

This fixes the remainder of [40060](https://bugzilla.xamarin.com/show_bug.cgi?id=40060)
2016-04-06 13:56:08 -04:00
Aleksey Kliger 9be882ab60 [runtime] Fix bug in get_caller_no_reflection
In order to find the user code that called some corlib API
that calls an icall, we write:
	dest = m = mono_method_get_last_managed ();
	mono_stack_walk_no_il (get_caller_no_reflection, &dest);
	if (!dest) dest = m;

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

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

The fix is to move the check for the target method before the check for
the Reflection API methods.
2016-04-06 13:56:08 -04:00
Aleksey Kliger 45d03ae47d [runtime] Add a rootimage arg to mono_reflection_get_type_checked
And in type_from_parsed_name pass the calling image as the metadata
context even if the initial class we're looking for is in corlib.

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

This fixes part of [40060](https://bugzilla.xamarin.com/show_bug.cgi?id=40060)
2016-04-06 13:56:07 -04:00
Joao Matos 78ac65dd4a [runtime] Deduplicate MONO_ZERO_LEN_ARRAY into mono-compiler.h. 2016-04-06 18:06:29 +01:00
Joao Matos 22ebf4269c [runtime] Factor out (MonoMarshalConv)-1 into its own define.
Thanks to @marek-safar for suggestion.
2016-04-06 17:56:04 +01:00
João Matos 2f16750d83 Merge pull request #2842 from akoeplinger/fix-monodroid-build
Fix monodroid build
2016-04-06 17:46:56 +01:00
Alexander Köplinger 0cb0b1a48d Add android-libunwind submodule and fix path in mini-exceptions-native-unwinder.c
This was hosted in mono-extensions before. It is licensed under the MIT license:
https://android.googlesource.com/platform/external/libunwind/+/android-6.0.1_r24/LICENSE
2016-04-06 17:43:04 +02:00
Aleksey Kliger af181c5d02 [corlib] Test Type.GetType(string,null,null) and anonymous type parsing 2016-04-06 11:34:34 -04:00
Rodrigo Kumpera 36390e00be Merge pull request #2836 from kumpera/cwt_toggleref
Fixed a toggleref and CWT iteraction bug.
2016-04-06 11:24:52 -04:00
Alexander Köplinger 844bda3ad9 [mini] Remove duplicated methods from tramp-arm64-gsharedvt.c
They are already defined in arch-stubs.c
2016-04-06 17:20:11 +02:00
Alexander Köplinger 39655e73f9 [mini] Fix incorrect ifdef in the arm64 gsharedvt files
It used MONO_ARCH_GSHARED_SUPPORTED instead of MONO_ARCH_GSHAREDVT_SUPPORTED.
2016-04-06 17:19:36 +02:00
Alexander Köplinger 18e2ad29a0 [mini] Add missing include to mini-exceptions-native-unwinder.c
It complained about mono_runtime_printf_err() not being defined.
2016-04-06 17:16:49 +02:00
Alexander Köplinger a169dff4e8 [mini] Fix ARM assembler syntax for MRC
According to http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0068b/CIHEEIDJ.html the MRC instruction is documented as:

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

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

GCC seemed to accept the operand without the 'p' prefix but clang raised an "invalid operand for instruction" error.
2016-04-06 17:14:02 +02:00
Joao Matos 7f4a2f9e10 [runtime] Fixed invalid comparisons to MonoMarshalConv in marshal.c.
In some platforms, C enums might be considered unsigned, and in that case we'd get the following warning:

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

The explicit cast should do the right thing.
2016-04-06 16:09:06 +01:00
Alexander Köplinger 5a01872ddf Merge pull request #2833 from directhex/ci-script-in-repo
Keep Jenkins job script in Mono repo
2016-04-06 15:12:29 +02:00
Marek Safar 84845717a4 Merge pull request #2804 from radical/al-cecil
AL: Use IKVM.Reflection to get custom attributes from the template assembly,
2016-04-06 13:50:07 +02:00
Alexander Köplinger 3bd4ecade4 Merge pull request #2840 from directhex/fix_make_dist_commoncrypto
Fix missing CommonCrypto/Makefile.include in "make dist" tarballs
2016-04-06 11:24:56 +02:00
Jo Shields c0ea809052 Fix missing CommonCrypto/Makefile.include in "make dist" tarballs 2016-04-06 10:04:50 +01:00
Jo Shields 57efb1111f Keep Jenkins job script in Mono repo
This means we can change the script in different branches (right now, all pull requests against any branch share the same job script)
2016-04-06 09:24:23 +01:00
Marek Safar 693f414010 [Microsoft.Build.Tasks] Fix CodeTaskFactory to resolve user references 2016-04-06 08:55:45 +02:00
monojenkins 496309d60b Merge pull request #2835 from lewurm/fix-make-dist
[sqlmetal] fixup for a73fb31f2 in order to fix `make dist'
2016-04-06 02:40:27 +01:00
Alex Rønne Petersen f92d9d0674 [mprof-report] Don't print a thread with a zero thread ID in the summary.
Log buffers can end up with a zero thread ID when we synthesize events on the
writer thread, leading to mprof-report thinking a thread exists with that ID.
We simply ignore the "zero thread" in the thread summary.
2016-04-06 02:28:56 +02:00
Alex Rønne Petersen a408a2fa93 [profiler] Ensure that we zero out thread IDs for buffers written from helper/writer threads.
If we don't do this, mprof-report will pick up on the fact that the helper and
writer threads exist and print them in the thread summary with no names. It's
OK to zero out the thread ID as the kinds of events we write from these threads
cannot be meaningfully associated with the log buffer's thread ID (or in the
case of counters, any thread ID).
2016-04-06 02:28:56 +02:00
Alex Rønne Petersen 3ddcaed636 [mprof-report] Don't assume the first thread seen is the main thread.
The runtime now explicitly sets the native name for the main thread, so this
(faulty) assumption is no longer necessary.
2016-04-06 02:28:55 +02:00
Alex Rønne Petersen a899fef659 [mini] Set a native thread name for the main thread in the driver.
We only set the native name as MS.NET leaves the managed name for the main
thread as null. At least by setting the native name, we get a nice name in GDB.
2016-04-06 02:28:55 +02:00
Alex Rønne Petersen 92ec05a837 [threadpool] Explicitly use the root domain to allocate the thread name.
This is mainly for consistency with the rest of the runtime which explicitly
specifies the root domain when allocating thread name strings.
2016-04-06 02:28:54 +02:00
Alex Rønne Petersen 0145f5b44b [runtime] Add thread names to all internal runtime threads. 2016-04-06 02:28:54 +02:00
Alex Rønne Petersen 7543207947 [gc] Allow changing the finalizer thread's name.
This insanity is apparently allowed by MS.NET.
2016-04-06 02:28:53 +02:00
Alex Rønne Petersen ad78997a25 [gc] Set name of the finalizer thread from within the thread.
This ensures that its name is set with pthread_setname_np () on Mac.
2016-04-06 02:28:53 +02:00
Alex Rønne Petersen 1334501fa2 [threads] Export some functions so the entire runtime can set thread names. 2016-04-06 02:28:53 +02:00
Alex Rønne Petersen 323198ab52 [threads] Make mono_thread_info_set_name () work on Mac in some cases.
We can use pthread_setname_np () on OS X 10.6+ when we're setting the name for
the current thread. For other cases, we just do nothing.
2016-04-06 02:28:49 +02:00
Alex Rønne Petersen 6b75d57c7d [threads] Don't report tools threads that do a full attach to the profiler.
The profiler helper thread does a full attach for on-demand heapshots. Since we
collect no actual data for the helper thread, there's no reason to report it.
2016-04-06 02:14:39 +02:00
Alex Rønne Petersen 0778cacbc6 [threads] Make sure we change the native thread name if it was set before starting. 2016-04-06 02:14:39 +02:00
Alex Rønne Petersen 10db82a563 [sgen] Make mono_gc_base_init () double-init resistant like the other GCs.
A double init could happen when profiling as we'd call mono_gc_base_init ()
from mono_profiler_load () early on, and then later call it again during the
normal startup sequence.
2016-04-06 02:14:39 +02:00
Alex Rønne Petersen 8e6b87f97a [mini] Shut down the profiler after shutting down the major runtime components.
Previously, we would shut down the profiler so early that it would never see
unload events for threads, domains, etc. This sounds harmless at first, but
since the profiler dumps the remaining data in the thread-local log buffer to
disk from within the thread end callback, we would often miss events near the
end of a thread's lifetime.

Shutting down the profiler after the major runtime components doesn't appear to
have any negative effects, which makes sense as all managed threads should be
stopped by this point.
2016-04-06 02:14:39 +02:00
Rodrigo Kumpera f3a68ce223 [sgen] Mark togglerefs before processing ephemerons. Fixes #40108.
Strong Togglerefs must be considered as roots for the purpose of Ephemeron processing.

Otherwise you make it not possible to use a toggleref object as key.
2016-04-05 18:50:10 -04:00
Ankit Jain e4f1b8c13d AL: Use IKVM.Reflection to get custom attributes from the template assembly,
.. instead of System.Reflection. This allows AL to work even if the
dependent assemblies of the template are not available.
2016-04-05 18:30:27 -04:00
monojenkins 0ebac113fc Merge pull request #2834 from xmcclure/inflated_method_header_leak_followup
Fix uninitialized MonoError in mono_basic_block_split

Follow-up on PR #2781 which removed a mono_error_init leading to memory unsafety. This was causing crashes when verifying assemblies in the 4.4 branch although it does not seem to have caused any known problems in master for some reason.
2016-04-05 23:00:37 +01:00
Bernhard Urban 4f4b674e17 [sqlmetal] fixup for a73fb31f2 in order to fix `make dist' 2016-04-05 14:08:31 -07:00
Bernhard Urban 371efbec90 [msvc] add new module
but only compile stubs on windows
2016-04-05 13:02:03 -07:00
Alexander Köplinger b8893efbcc Merge pull request #2832 from razzfazz/handle_eintr
handle EINTR for kevent calls
2016-04-05 21:39:14 +02:00
Andi McClure d442618a0c Document mono_error_init convention in source 2016-04-05 14:51:25 -04:00
Andi McClure 4fb8e38567 [runtime] restore mono_error_init in mono_basic_block_split
Follow-up on PR #2781 which removed a mono_error_init. Ensure use in
helper functions for consistency. Fixes a potential crasher.
2016-04-05 14:32:18 -04:00
Marek Safar d166de315f [Microsoft.Build.Utilities] Fixes tests resources build 2016-04-05 20:08:41 +02:00
Marek Safar a73fb31f21 [sqlmetal] Remove wrong tests config 2016-04-05 19:52:07 +02:00
Bernhard Urban bac3da1b44 [jit] introduce CFG dumping feature, that enables dumping over to network to IGV 2016-04-05 10:19:11 -07:00
Bernhard Urban 69416cdc79 [jit] add function to print instruction description into string buffer 2016-04-05 10:18:23 -07:00
Marek Safar e86fb81c3f [mcs] Remove duplicate references 2016-04-05 19:17:57 +02:00
Marek Safar 598e40b9ab Bump referencesource 2016-04-05 15:56:24 +02:00
Alexander Köplinger 1639e26a6b Merge pull request #2831 from razzfazz/fix_dllimport
clean up DllImport attributes
2016-04-05 15:04:31 +02:00
Marek Safar 0c306a975f [System] Always pass -noconfig to codedom c# compiler 2016-04-05 13:39:19 +02:00
Alexander Köplinger 5d100970dd [build] Exclude generated .g.cs files from "make dist"
The recent changes to the mobile profiles introduced generated files in their .sources like CommonCrypto/MD5CryptoServiceProvider.g.cs
However, those are not generated when the mobile profiles aren't enabled at configure time.

This caused a problem during "make dist" since it tries to grab the entries in .sources from *all* profiles, causing errors like:

    cp: cannot stat ‘CommonCrypto/MD5CryptoServiceProvider.g.cs’: No such file or directory
    make[5]: *** [dist-local] Error 1

The easiest fix is to filter out those generated files.
2016-04-05 13:19:25 +02:00
Daniel Becker ac49990f3d clean up DllImport attributes
Any native function that can modify errno should have the
SetLastError attribute set to true. Also, no need to specify
EntryPoint if it's the same as the function name.
2016-04-05 00:35:21 -07:00
Zoltan Varga d9c32b372c [runtime] Allow the options in MONO_DEBUG to be passed as a command line option too. 2016-04-04 19:13:33 -04:00
Zoltan Varga 375bca4809 [llvm] Enable pinvoke call using the C calling conv in llvm-only mode. 2016-04-04 19:02:56 -04:00
Zoltan Varga c767607237 [corlib] Make some ExceptionDispatchInfo tests with BitcodeNotWorking because we don't truncate stack traces of exceptions at the catch site when running with bitcode. 2016-04-04 18:20:53 -04:00
Rodrigo Kumpera 8f745e3426 Merge pull request #2827 from xmcclure/profile-clean-0.1
Continued profiler loading cleanup (PR#2816 follow up)
2016-04-04 17:24:52 -04:00
monojenkins 69f207ee9e Merge pull request #2545 from ermshiperete/Xamarin-24974
[corlib] Fix exception in __ComObject finalizer during shutdown

* keep a reference to a __ComObject's proxy so it doesn't get garbage
  collected
* don't create __ComObjects unnecessarily
* Fix for bug [24974](https://bugzilla.xamarin.com/show_bug.cgi?id=24974)
2016-04-04 21:11:31 +01:00
Marek Safar 5e57fa3aa1 [build] Update nunit-console path for xbuild profiles 2016-04-04 17:30:08 +02:00
Marek Safar afaa29f3a9 [Microsoft.Build.Engine] Update test files 2016-04-04 17:25:22 +02:00
Marek Safar dfdd3cc4ab [mcs] Make more errors build explicit 2016-04-04 17:03:47 +02:00
Marek Safar 680321339d [System.Runtime.Serialization.dll] Update referencesource strings 2016-04-04 16:41:35 +02:00
Marek Safar b2dbfc7aac [tools] Update missing reference 2016-04-04 16:41:35 +02:00
Alexander Köplinger ef44704cef Fix make dist 2016-04-04 16:34:20 +02:00
Alexander Köplinger 0909ee8c3d [test-runner] Ignore exceptions during process kill
We hit this on Jenkins over the weekend:
https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/3845/parsed_console/log_content.html#WARNING1

```
Unhandled Exception:
System.InvalidOperationException: Cannot process request because the process (51792) has exited.
  at System.Diagnostics.Process.GetProcessHandle (Int32 access, Boolean throwIfExited) <0x10d7ea000 + 0x001b6> in <filename unknown>:0
  at System.Diagnostics.Process.GetProcessHandle (Int32 access) <0x10d7f2fd0 + 0x0001e> in <filename unknown>:0
  at System.Diagnostics.Process.Kill () <0x10d7f2ee0 + 0x00031> in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Kill ()
  at TestRunner+<Main>c__AnonStorey0.<>m__0 () <0x10a9b50b0 + 0x00e30> in <filename unknown>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) <0x10c55bc90 + 0x0009a> in <filename unknown>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x10c55a210 + 0x001c6> in <filename unknown>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x10c55a1e0 + 0x00020> in <filename unknown>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) <0x10c55a130 + 0x00059> in <filename unknown>:0
  at System.Threading.ThreadHelper.ThreadStart () <0x10c55be50 + 0x0002e> in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Cannot process request because the process (51792) has exited.
  at System.Diagnostics.Process.GetProcessHandle (Int32 access, Boolean throwIfExited) <0x10d7ea000 + 0x001b6> in <filename unknown>:0
  at System.Diagnostics.Process.GetProcessHandle (Int32 access) <0x10d7f2fd0 + 0x0001e> in <filename unknown>:0
  at System.Diagnostics.Process.Kill () <0x10d7f2ee0 + 0x00031> in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Kill ()
  at TestRunner+<Main>c__AnonStorey0.<>m__0 () <0x10a9b50b0 + 0x00e30> in <filename unknown>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) <0x10c55bc90 + 0x0009a> in <filename unknown>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x10c55a210 + 0x001c6> in <filename unknown>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x10c55a1e0 + 0x00020> in <filename unknown>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) <0x10c55a130 + 0x00059> in <filename unknown>:0
  at System.Threading.ThreadHelper.ThreadStart () <0x10c55be50 + 0x0002e> in <filename unknown>:0
make[1]: *** [test-generic-sharing-managed] Error 1
```

We can't do anything about those errors, so just catch and ignore it.
2016-04-04 15:36:50 +02:00
Marek Safar 21bf330584 [build] Update mcs path in mini tests 2016-04-04 15:23:06 +02:00
Marek Safar 74bae27874 [Facades] Update list of full assemblies 2016-04-04 14:40:56 +02:00
Marek Safar 926cb696e6 [mcs] Basic boostrap references are always default ones 2016-04-04 14:12:51 +02:00
Marek Safar 5933e0a137 [Microsoft.Build.Engine] Simplify bd70a55ec7 2016-04-04 14:02:10 +02:00
Marek Safar bd70a55ec7 [Microsoft.Build.Engine] clean/copy mdb files as well 2016-04-04 14:01:02 +02:00
Marek Safar aeccd22792 [build] Change the way how mcs references are passed to compiler to always use full path.
One of csc prerequisites because csc uses -lib as path which is considered after
RuntimeEnvironment.GetRuntimeDirectory which makes -lib useless
2016-04-04 13:48:44 +02:00
Marek Safar 3d180029fb [System.Runtime.Serialization.Formatters.Soap] Make test output deterministic 2016-04-04 13:48:43 +02:00
Marek Safar c10e61a62e [Mono.C5] Make test output deterministic 2016-04-04 13:48:43 +02:00
Ludovic Henry 196497780f Merge pull request #2713 from gregoryyoung/master
handles AwaitAsync finishing synchronously
2016-04-04 11:15:08 +01:00
Zoltan Varga a26dad1a89 [amd64] Add a separate ArgStorage entry for gsharedvt return types instead of using a separate flag in CallInfo. 2016-04-02 21:02:57 -04:00
Alexander Köplinger 57d9d3595c [acceptance-tests] Fix test-runner.exe compilation after 136dd0 2016-04-03 02:56:50 +02:00
monojenkins 0fa33056a6 Merge pull request #2720 from mono/fix-39325
[Profiler] Keep a reference to assemblies while coverage is running

In certain circumstances, for example when running under nunit-console, assemblies could be unloaded while the profiler still had a reference to them in order to generate the coverage data. In these cases, the memory referred to by the profiler would be invalid and would crash.

Fix this by incrementing the reference count of the assemblies preventing them from being unloaded while coverage is being collected.

Fixes BXC #39325
2016-04-02 16:50:31 +01:00
Zoltan Varga 8e35235769 [runtime] Move the test for shutting down the stat profiler to mini_cleanup (). 2016-04-02 02:32:04 -04:00
Zoltan Varga 455d2b81e2 [arm64] Fix the generation of static rgctx trampolines when using aot on linux. 2016-04-02 01:38:43 -04:00
Zoltan Varga d93dab8278 [arm64] Implement handler block guard trampolines. 2016-04-02 01:27:27 -04:00
Zoltan Varga 184c0aaf58 [runtime] Fix a crash when shutting down the sampling thread. 2016-04-02 01:23:35 -04:00
Zoltan Varga 1ee0c21019 [tests] Increase the timeout in the test runner so running tests with llvm doesn't time out. 2016-04-01 22:36:21 -04:00
Alexander Köplinger c4962db608 [metadata] Remove invalid Win32 entry in object-offsets.h
The lmf_addr field in MonoLMF only exists for TARGET_X86.
2016-04-01 18:56:01 -07:00
Alexander Köplinger 780a0d58f6 [mini] Remove duplicate stubs from tramp-amd64/x86-gsharedvt.c
They already exist in arch-stubs.c and caused conflicts on the MSVC build.
2016-04-01 18:53:22 -07:00
Alexander Köplinger e612c5901f [msvc] Add missing files to MSVC project files 2016-04-01 18:49:15 -07:00
Alex Rønne Petersen 524a800e02 [mini] Fix build on systems without clock_nanosleep (). 2016-04-01 22:25:10 +02:00
Rodrigo Kumpera ef94cb1bc3 [jit] Handle verification failing with InvalidProgramException. Fixes #40040. 2016-04-01 13:15:56 -07:00
Zoltan Varga db5af7fe7e [runtime] Make a copy of the types passed to mono_mb_add_local () earlier since they could be transient. 2016-04-01 16:12:23 -04:00
Zoltan Varga af6179e584 [arm64] Fix clearing of stack traces when an exception is rethrown. Fix the calculation of struct sizes in pinvoke calls. Remove some dead code. 2016-04-01 16:03:28 -04:00
Andi McClure a59a008bf7 Continued profiler loading cleanup (PR#2816 follow up)
- Back out MONO_PROFILER_LIB_DIR change
- Profiler loading traces should use log mask “dll” not “asm”
- mono_dl_open_runtime_lib should preempt standard paths when loading
  profiler
- mono_dl_open_runtime_lib should check in profiler library directory
- mono_dl_open_runtime_lib contained a memory leak
- With above changes, ptestrunner.pl can remove some environment
  massaging
2016-04-01 15:39:38 -04:00
Rodrigo Kumpera 68cdee8103 Merge pull request #2825 from kumpera/loader_error_removal
GOOD RIDDANCE LOADER ERROR
2016-04-01 11:19:24 -07:00
Alexander Köplinger 372145ed24 Merge pull request #2826 from mattleibow/mono.options-update
[Mono.Options] Added support for Enums in the PCL version
2016-04-01 15:08:50 +02:00
Alexander Köplinger 670c746e7e [System.Web.Extensions] Add test for last fix 2016-04-01 14:11:03 +02:00
Jussi Sainio 5c8d6e96c1 [System.Web.Extensions] Use CultureInfo.InvariantCulture for number parsing
Fixes #4242, see bug comments. JsonSerializer seems to have been already
fixed in abe9dc62. The JsonDeserializer number conversion is now much
stricter, allowing only integer number style for integers and float number
style for floats.
2016-04-01 14:10:33 +02:00
monojenkins a7fb596803 Merge pull request #2805 from alexrp/profiler-sampling-thread2
[profiler] Use a background thread to send out sampling signals.

Previously, when using an interval timer, the initial profiling signal could be
delivered to *any* thread in the process. This is not normally a problem, but
if the signaled thread has not even finished its initialization inside libc, it
can happen that it hasn't even set up thread-local storage yet. We then blow up
spectacularly when trying to back up errno in the SIGPROF signal handler, as
it's a TLS variable. Even the SIGSEGV handler blows up immediately after as it
can't access JIT TLS data.

Since there appears to be no reliable and portable way for a library like Mono
to control which exact thread gets the initial timer signal, instead switch to
using a background thread that uses a high-resolution sleep and attempts to
switch itself to real time scheduling if possible. This way, we have full
control over which threads we send SIGPROF to, letting us avoid any threads
which aren't in a 'good' state for profiling.

This commit also gets rid of the multiplexing that was going on in the SIGPROF
signal handler, since we now send out the signals from a background thread. As
this was the only use of the async job API, that API has been removed. This
indirectly fixes the signal storming issue that sometimes popped up, where for
some reason multiple threads would think that they're the initiating thread,
resulting in way too many signals going out.

A nice side-effect of doing the signaling ourselves is that we can now use
real-time signals on systems that have them (e.g. Linux), resulting in a nearly
100% signal delivery rate in all cases. Previously, we would lose a tremendous
amount of signals when an application was under heavy load.
2016-04-01 08:00:18 +01:00
Zoltan Varga 01aa70d651 [arm64] Implement interruption checking in the trampoline code. 2016-04-01 00:27:53 -04:00
Matthew Leibowitz 3abbe5b7e6 [Mono.Options] Added support for Enums in the PCL version
- Support for String to Enum
 - Support for Number to Enum
 - Support for Flags to Enum
 - Added a UnitTest
2016-04-01 05:13:46 +02:00
Alex Rønne Petersen 2538a352f4 [profiler] Use a background thread to send out sampling signals.
Previously, when using an interval timer, the initial profiling signal could be
delivered to *any* thread in the process. This is not normally a problem, but
if the signaled thread has not even finished its initialization inside libc, it
can happen that it hasn't even set up thread-local storage yet. We then blow up
spectacularly when trying to back up errno in the SIGPROF signal handler, as
it's a TLS variable. Even the SIGSEGV handler blows up immediately after as it
can't access JIT TLS data.

Since there appears to be no reliable and portable way for a library like Mono
to control which exact thread gets the initial timer signal, instead switch to
using a background thread that uses a high-resolution sleep and attempts to
switch itself to real time scheduling if possible. This way, we have full
control over which threads we send SIGPROF to, letting us avoid any threads
which aren't in a 'good' state for profiling.

This commit also gets rid of the multiplexing that was going on in the SIGPROF
signal handler, since we now send out the signals from a background thread. As
this was the only use of the async job API, that API has been removed. This
indirectly fixes the signal storming issue that sometimes popped up, where for
some reason multiple threads would think that they're the initiating thread,
resulting in way too many signals going out.

A nice side-effect of doing the signaling ourselves is that we can now use
real-time signals on systems that have them (e.g. Linux), resulting in a nearly
100% signal delivery rate in all cases. Previously, we would lose a tremendous
amount of signals when an application was under heavy load.
2016-04-01 03:53:10 +02:00
Alexander Köplinger c642d898a4 [Mono.Security] Remove leftover .sources files 2016-04-01 02:34:44 +02:00
Rodrigo Kumpera b30ad2dbf0 [runtime] Remove mono_loader_clear_error, mono_loader_assert_no_error and set_failure_from_loader_error. The loader error is no more. 2016-03-31 17:23:26 -07:00
Rodrigo Kumpera c12dc0b86e [runtime] Remove mono_loader_get_last_error, nothing produces loader errors anymore. 2016-03-31 17:09:56 -07:00
Aleksey Kliger cd9b8eb791 [runtime] Set pending exception in icalls instead of raising. 2016-03-31 20:00:39 -04:00
Rodrigo Kumpera fd4f3021f2 [runtime] Remove mono_loader_error_prepare_exception, nothing can produce loader errors anymore. 2016-03-31 16:39:00 -07:00
Rodrigo Kumpera 38cf816b97 [runtime] Remove all functions that set the loader error. It's dead code now. 2016-03-31 16:10:57 -07:00
Rodrigo Kumpera b6a094f8c5 [mono-error] Remove mono_loader_set_error_from_mono_error, nothing uses it. 2016-03-31 15:53:33 -07:00
Rodrigo Kumpera c85824fde3 [mono-error] Since nothing sets the loader error anymore, mono_error_set_from_loader_error can be removed. 2016-03-31 15:44:37 -07:00
Zoltan Varga 4123f3b502 Fix warnings/remove dead code. 2016-03-31 18:28:47 -04:00
Zoltan Varga 470678dc5d Fix a warning. 2016-03-31 18:21:59 -04:00
Zoltan Varga 5fec6a7dec [runtime] Fix the arm linux build by using the fallback InterlockedCompareExchange64 () implementation for now. 2016-03-31 18:18:48 -04:00
Zoltan Varga fa825a2d91 [runtime] Fix some warnings/remove dead code. 2016-03-31 18:12:25 -04:00
Alexander Köplinger 9b8f1d125b [corlib] Ensure newline in .sources file
It causes build issues on .sources with #include on Linux otherwise.
2016-04-01 00:08:31 +02:00
Alexander Köplinger 3862b14cf9 [corlib] Fix monotouch_tv_runtime and monotouch_watch_runtime build 2016-04-01 00:02:04 +02:00
Martin Baulig ae77e5c4c4 Update X509CertificateImplApple to reflect latest X509CertificateImpl changes.
(cherry picked from commit 2fdfbe3479b0d3d24a5471ed7032eede80e58a2d)
2016-03-31 23:31:22 +02:00
Aleksey Kliger 35848e0338 [reflection] Fix leak in mono_reflection_get_custom_attrs_{by_type,data_checked}
If there's an error, first call mono_custom_attrs_free, then deal with
the error.
2016-03-31 17:26:19 -04:00
Aleksey Kliger b965e0e7a1 [security-core-clr] Fixup function signature to match header
mono_security_core_clr_ensure_reflection_access_method should return a
boolean now.
2016-03-31 17:25:28 -04:00
monojenkins 1c385f99e1 Merge pull request #2816 from xmcclure/profile-clean-0
Various cleanups on profiler

3 commits:

Assist on profiler module loading

- Add a MONO_PROFILER_LIB_DIR from which profiler modules are
  dynamically loading, in case it is not the normal library path
- Add information about profiler loading to mono_trace

Comments and clarity in proflog.c

- Add comments on structures
- Rename 'data' and 'data_end' to 'cursor' and 'buf_end' in LogBuffer/StatsBuffer as the old names were confusing
- Add new assert when processing samples

Improve a safety check when writing data into StatBuffer

- The safety check should occur such that if the new value for
StatBuffer::cursor is beyond the bounds of the StatBuffer, the cursor
is not updated.
2016-03-31 20:05:17 +01:00
monojenkins 58e8a9f851 Merge pull request #2810 from kumpera/fix_hazard_free
Fix hazard free

Replace usage of mono_thread_hazardous_free_or_queue and remove it.
    
    mono_thread_hazardous_free_or_queue has a fundamentally broken design.
    
    It allows arbitrary free code to run in the context of its caller.
    
    The sync/async split on where it's called is not enough to know whether
    we can run free'ing code or not.
    
    Since in sync context we called free functions that could take locks,
    it happened that those locks conflicted with the ones already taken.
    
    In particular, mono_jit_info_table_free did take a domain lock and
    quite a few of the sync context calls would hold locks that must
    not be held when taking a domain lock.
    
    This, is practice, means that we'd need to partition the free calls
    into 3 groups: async context, reentrant context (no runtime locks held)
    and sync context (maybe some locks held).
    
    There was no case where reentrant context would be usable meaning,
    in practice, that all calls happens in what effectively is async context
    where free functions can't be called.
    
    The new design is a lot more straightforward:
    
    - No implicit free queue pumping
    - A pair of free functions with well defined behavior.
    	mono_thread_hazardous_try_free - to be used where the caller expects the free function to be called
    	mono_thread_hazardous_queue_free - to be used where the caller don't expect the free function to be called [1]
    - Explicit pumping on places that known to be ok
    	Thread detach
    	Finalizer thread
    
    [1] This might sound like a weird condition, but a lot of lock-free code
    have compensation logic that trigger free'ing during lookups.
2016-03-31 20:00:19 +01:00
Zoltan Varga 5275f3f3c6 Fix warnings. 2016-03-31 14:12:05 -04:00
Zoltan Varga 39624a78c1 [gsharedvt] Change the --enable-gsharedvt configure option to a no-op, its always enabled by default. 2016-03-31 13:42:49 -04:00
Zoltan Varga 07c02c1568 [gsharedvt] Integrate mini-generic-sharing-gsharedvt.c into mini-generic-sharing.c. 2016-03-31 13:37:02 -04:00
Aleksey Kliger 7cce6e2585 [runtime] Use mono_object_isinst_checked
rather than mono_object_isinst.
2016-03-31 13:32:19 -04:00
Zoltan Varga d767b55064 [arm64] Fix passing of small gsharedvt argument on the stack on ios. Fixes #39528. 2016-03-31 13:24:48 -04:00
Zoltan Varga 56ad8f4e5d Merge pull request #2820 from kumpera/license-change-rebased
Change license and publish xamarin mono extensions
2016-03-31 13:18:26 -04:00
Rodrigo Kumpera 6ce453f2cf Update COPYING.LIB 2016-03-31 09:47:35 -07:00
Rodrigo Kumpera 5f05c5f3a2 [utils] Fix the build. 2016-03-31 09:12:22 -07:00
monojenkins df9c98dda1 Merge pull request #2394 from Mailaender/patch-1
Fixed runtime dependency on libgdiplus with developer soname

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=34314.
2016-03-31 17:05:56 +01:00
hannakim123 b46e9c68a3 Update trademark 2016-03-30 18:40:40 -07:00
Miguel de Icaza e3a31c6854 Merge pull request #1 from xamarin/hannakim123-patch-1
Update for CLA
2016-03-30 18:24:09 -07:00
Rodrigo Kumpera 2ad72ecc3a [runtime] Cycle the finalizer thread if there are too many outstanding hazard pointers to free.
We add a callback to the HP so the GC can monitor the queue size and act on it.

The queue size was picked to keep the overhead limited even under high load.
2016-03-30 17:38:43 -07:00
iain holmes d1587ba5e6 [Profiler] Use the correct function to increment the refcount 2016-03-31 00:34:14 +01:00
Alexander Köplinger a41d501c72 Merge pull request #2807 from akoeplinger/gchandle
[corlib] Two small fixes for GCHandle
2016-03-31 00:36:57 +02:00
monojenkins e7319b9f58 Merge pull request #2786 from alexanderkyte/leaked_type_in_parse_header
[runtime] Free leaked short-lived MonoType
2016-03-30 22:11:01 +01:00
Andi McClure a80b7cc0a3 Improve a safety check when writing data into StatBuffer
The safety check should occur such that if the new value for
StatBuffer::cursor is beyond the bounds of the StatBuffer, the cursor
is not updated.
2016-03-30 17:09:08 -04:00
Andi McClure 1f47c6ed5c Comments and clarity in proflog.c
- Add comments on structures
- Rename 'data' and 'data_end' to 'cursor' and 'buf_end' in
  LogBuffer/StatsBuffer as the old names were confusing
- Add new assert when processing samples
2016-03-31 12:34:08 -04:00
Andi McClure a29d7015b9 Assist on profiler module loading
- Add a MONO_PROFILER_LIB_DIR from which custom profilers are
  dynamically loaded, in case it is not the normal library path
- Modify mono/profiler make check to use MONO_PROFILER_LIB_DIR
  (this fixes a bug where it would sometimes load the wrong profiler)
- Add information about profiler loading to mono_trace
2016-03-31 11:02:21 -04:00
Vlad Brezae 3e69ff3ae7 Merge pull request #2799 from BrzVlad/fix-conc-card-clean
[sgen] Fix concurrent card clean
2016-03-31 02:54:57 +07:00
monojenkins d9ccfc181c Merge pull request #2808 from lambdageek/dev/monoerror-security-core-clr
[security-core-clr] Use MonoError outarg instead of mono_raise_exception
2016-03-30 20:25:17 +01:00
Zoltan Varga 3df894d8e8 Merge pull request #2812 from madewokherd/threadpool-ms-rand
[threadpool-ms] Fix incorrect use of mono_rand.
2016-03-30 15:13:02 -04:00
Vincent Povirk b4a74942ad [threadpool-ms] Fix incorrect use of mono_rand.
This takes a pointer to an RNG handle, not the handle itself.
2016-03-30 11:16:12 -05:00
Marcos Henrich ff49850dfc Merge pull request #2698 from esdrubal/iosxmlarray
[System.Runtime.Serialization] Static writer fix.
2016-03-30 11:57:56 +01:00
Marcos Henrich f41e857d3f Merge pull request #2763 from esdrubal/mono-symbolicate-standalone2
Mono-symbolicate standalone
2016-03-30 08:55:15 +01:00
Marcos Henrich 028a573cd2 Merge pull request #2787 from esdrubal/endpointaddress10
[System.ServiceModel] Fixes reflection call to undefined method
2016-03-30 08:37:40 +01:00
Rodrigo Kumpera a01fb8227b Merge pull request #2781 from alexanderkyte/inflated_method_header_leak
[runtime] Fix leaking of inflated method headers
2016-03-29 17:15:24 -07:00
hannakim123 e28866dc55 Update CONTRIBUTING.md 2016-03-29 16:07:39 -07:00
Vlad Brezae 36a31a578e [sgen] Fix logging of major heap size with concurrent sweep
We used to log the major heap size before the sweep job finished. Remove the major heap logging at collection end time and add a separate log entry at sweep finish time.
2016-03-30 02:07:14 +03:00
Vlad Brezae 612fe5e1c6 [sgen] Fix log for last collection los memory usage 2016-03-30 01:49:54 +03:00
Rodrigo Kumpera 4778bd3064 [sgen] Don't pump the hazard free queue from sgen, the finalizer thread does it now. 2016-03-29 15:25:07 -07:00
Rodrigo Kumpera 45a08e331f [utils] Replace usage of mono_thread_hazardous_free_or_queue and remove it.
mono_thread_hazardous_free_or_queue has a fundamentally broken design.

It allows arbitrary free code to run in the context of its caller.

The sync/async split on where it's called is not enough to know whether
we can run free'ing code or not.

Since in sync context we called free functions that could take locks,
it happened that those locks conflicted with the ones already taken.

In particular, mono_jit_info_table_free did take a domain lock and
quite a few of the sync context calls would hold locks that must
not be held when taking a domain lock.

This, is practice, means that we'd need to partition the free calls
into 3 groups: async context, reentrant context (no runtime locks held)
and sync context (maybe some locks held).

There was no case where reentrant context would be usable meaning,
in practice, that all calls happens in what effectively is async context
where free functions can't be called.

The new design is a lot more straightforward:

- No implicit free queue pumping
- A pair of free functions with well defined behavior.
	mono_thread_hazardous_try_free - to be used where the caller expects the free function to be called
	mono_thread_hazardous_queue_free - to be used where the caller don't expect the free function to be called [1]
- Explicit pumping on places that known to be ok
	Thread detach
	Finalizer thread

[1] This might sound like a weird condition, but a lot of lock-free code
have compensation logic that trigger free'ing during lookups.
2016-03-29 15:09:49 -07:00
Aleksey Kliger bed8d586bd [security-core-clr] Add MonoError arg to
mono_security_core_clr_ensure_delegate_creation
2016-03-29 17:13:31 -04:00
Aleksey Kliger a55ec50a2e [security-core-clr] Add MonoError arg to mono_security_core_clr_ensure_reflection_access_method 2016-03-29 17:13:31 -04:00
Aleksey Kliger 4054000d9b [security-core-clr] Add MonoError to mono_security_core_clr_ensure_reflection_access_field 2016-03-29 17:13:31 -04:00
monojenkins ac22997313 Merge pull request #1718 from madewokherd/sgenthreadcleanup
[sgen] Clean up thread pool on shutdown.

Keeping threads around can cause processes to keep running when they shouldn't, particularly on Windows when the entry point returns.

(The reason this is important for me is that Wine provides _CorExeMain, which is an entry point that does return, unlike normal compiled C programs which appear to call exit() after main() returns. A Windows process doesn't exit until ALL threads have exited, so a thread that never exits means a hung process.)

It doesn't seem like we have other GC-specific cleanup code, so I don't know if this is a good approach. Feedback on that question would be appreciated.
2016-03-29 21:01:05 +01:00
Rodrigo Kumpera 0111cdec77 [util] Add mono_thread_hazardous_try_free and mono_thread_hazardous_queue_free.
Those two functions are intended to replace mono_thread_hazardous_free_or_queue.

The problem with that function is that it doesn't compose well given it forces
the whole call chain leader to a free call to follow its semantics.

Additionally, it's not enough safety to be in sync context to call the free functions
as they introduce reentrancy - they can be called from any other arbitrary free
call that doesn't claim to be in async context.

Given most data structures, in general, can't guarantee how they are used, they
must make the conservative assumption of being in async context, thus not allowing
any form of locking happening.
2016-03-29 11:41:37 -07:00
Zoltan Varga 136dd01035 [tests] Force tests to print thread dumps when they time out. 2016-03-29 14:32:09 -04:00
Vlad Brezae e097ce5111 Merge pull request #2801 from BrzVlad/feature-conc-cementing
[sgen] Cementing for the finishing pause
2016-03-30 00:45:10 +07:00
Rolf Bjarne Kvinge 854a162cf9 [corlib] Remove local variables inadvertently overriding class variables. 2016-03-29 19:05:59 +02:00
Rolf Bjarne Kvinge ae933c1979 [corlib] Add Console.[Input|Output]Encoding to the mobile profiles. 2016-03-29 18:38:00 +02:00
monojenkins 9bfe20cb4e Merge pull request #2794 from xmcclure/win-aot-basic
Make AOT compilation on 64 bit windows produce executables

This PR contains three commits (see commit descriptions) which:

- Fix 64-bit debug windows builds in MSVC 2015
- Make it possible to use the tool-prefix aot option with mono/mini make fullaotcheck (necessary if you are in cygwin and wish to invoke `x86_64-w64-mingw32-gcc`)
- Change mini so that `--aot=full` successfully emits 64-bit windows executables.

Building 32 bit executables will generally fail because we do not follow cdecl. The 64 bit executables do not run properly when executed.
2016-03-29 17:31:13 +01:00
monojenkins 4da080e2e8 Merge pull request #2767 from lambdageek/dev/monoerror-mono_lookup_dynamic_token
[runtime] MonoError-ize mono_loookup_dynamic_token{,_class}

Push `MonoError` through `mono_lookup_dynamic_token_class` and `mono_lookup_dynamic_token`

Also simplify the implementations of those functions so that they call `mono_reflection_lookup_dynamic_token` directly, rather than via a function pointer.  The old implementation was a holdover from when the runtime was implemented as separate libraries.
2016-03-29 16:15:20 +01:00
Alexander Köplinger a3e3f1d9cc [runtime] Use mono_object_isinst_checked for ppc and ia64
The usages were only partially changed in the move from mono_object_isinst in fbe1210790 and caused build errors.
2016-03-29 15:02:59 +02:00
Marek Safar 3391892e5c Bump referencesource 2016-03-29 13:24:32 +02:00
Marcos Henrich 8a1e9242f6 [System.Runtime.Serialization] Static writer fix.
While serializing any type into a contract member of type object an
exception would be thrown.

To avoid this XmlObjectSerializerWriteContext.InternalSerialize should
in this case be called using the object type instead of the member type,
similar how reference sources does in  type instead of the member type,
 referencesources seems to be doing omething similar [1].

Fixes #37116.

[1]
http://referencesource.microsoft.com/#System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerWriteContext.cs,619
2016-03-29 10:09:38 +01:00
Marek Safar 12b712c891 Merge pull request #896 from echampet/webresource
[Fix] ReusableHashAlgorithm doesn't set the Key of the ValidationAlgorit...
2016-03-29 09:33:39 +02:00
Vlad Brezae f93136b18b [sgen] Binary protocol entry for sweep finish 2016-03-29 09:10:30 +03:00
Vlad Brezae 7efe0456a3 [sgen] Clear the card table in the finishing pause
It is not used during a major collection. The collector will add the necessary global remsets afterwards, for the nursery collections.
2016-03-29 08:47:57 +03:00
Zoltan Varga 10c1f67904 [bcl] Avoid printing debug messages to stdout in the default trace listener when a debugger is connected. Fixes #13538. 2016-03-28 21:46:23 -04:00
Zoltan Varga 80ed8ebf3d [amd64] Avoid passing the pc/pc offset to the throw corlib exception trampoline in llvm mode, instead simply use the return address pushed by the call itself. In JIT mode, this is needed because the throw code is generated out of line so its not inside the try range, but in llvm mode, the try-range encompasses the call. 2016-03-28 20:44:40 -04:00
Miguel de Icaza 6beacc62c8 Update LICENSE including GPL 2016-03-28 17:36:53 -07:00
Miguel de Icaza 71f79f97bb Move all licenses to a single LICENSE file 2016-03-28 16:16:51 -07:00
Miguel de Icaza ad5eb0eca3 No more LGPL requirements 2016-03-28 16:16:47 -07:00
Miguel de Icaza bbcdd9e703 Added PATENTS.TXT file and link to it 2016-03-28 16:16:43 -07:00
Miguel de Icaza bf1a1fac5e Update LICENSE 2016-03-28 16:16:39 -07:00
Miguel de Icaza ef0ddf45c3 First set of licensing changes 2016-03-28 16:16:27 -07:00
Rolf Bjarne Kvinge 8831ab4f6b [System] Add new 'Mono.Security.Interface.MonoTlsProviderFactory' callback to let the framework libraries select the provider at runtime.
List of original contributors:

Martin Baulig <[email protected]>
2016-03-28 15:51:37 -07:00
Rolf Bjarne Kvinge 188ec88f30 Extend HttpClient to use infrastructure in Xamarin.Mac (via reflection) to pick right type.
List of original contributors:

Chris Hamons <[email protected]>
2016-03-28 15:51:36 -07:00
Rolf Bjarne Kvinge 4c368c394e [corlib] Add partial EncodingHelper type to let XI define its own default encoding [#29928]
List of original contributors:

Sebastien Pouliot <[email protected]>
2016-03-28 15:51:36 -07:00
Rolf Bjarne Kvinge dc79f64c7e [corlib] New lazily initialized X509Certificate.
List of original contributors:

Martin Baulig <[email protected]>
2016-03-28 15:51:35 -07:00
Rolf Bjarne Kvinge 0f0be91eae [corlib] Add a special method for XI so the linker does not always have to generate it.
List of original contributors:

Sebastien Pouliot <[email protected]>
2016-03-28 15:51:34 -07:00
Rolf Bjarne Kvinge e5a6537cc5 [corlib] Add back System/Guid.MonoTouch.cs implementation.
This is a partial reversal of 82a1747f (for this file only).
2016-03-28 15:51:34 -07:00
Rolf Bjarne Kvinge 77fb5c9ec4 [corlib] Add iOS specific code for System.Environment.
List of original contributors:

Sebastien Pouliot <[email protected]>
Rolf Bjarne Kvinge <[email protected]>
2016-03-28 15:51:33 -07:00
Rolf Bjarne Kvinge 437d77b5e7 [bcl] Add CommonCrypto to corlib, Mono.Security and System.Core.
List of original contributors:

Sebastien Pouliot <[email protected]>
Rolf Bjarne Kvinge <[email protected]>
Marek Safar <[email protected]>
Miguel de Icaza <[email protected]>
2016-03-28 15:51:33 -07:00
Rodrigo Kumpera cd5c13c980 [jit] Add native-types and enable them by default. Missing test suite.
List of original contributors:

Zoltan Varga <[email protected]>
Rodrigo Kumpera <[email protected]>
2016-03-28 15:51:30 -07:00
Zoltan Varga 5d10499fd6 [jit] Pass the type token index instead of the full type token to the throw corlib exceptions functions on most platforms to reduce the size of the generated code. 2016-03-28 18:33:58 -04:00
Rodrigo Kumpera 3cd04f9719 [jit] Add arm64 backend and gsharedvt code.
List of original contributors:

Zoltan Varga <[email protected]>
Rodrigo Kumpera <[email protected]>
Andi McClure <[email protected]>
Vlad Brezae <[email protected]>
Joao Matos <[email protected]>
Alex Rønne Petersen <[email protected]>
2016-03-28 15:31:39 -07:00
Rodrigo Kumpera 0050877abe [mini] Add x86 gsharedvt.
List of original contributors:

Zoltan Varga <[email protected]>
Joao Matos <[email protected]>
2016-03-28 15:31:38 -07:00
Rodrigo Kumpera 4622c081cd [jit] Implement gsharedvt on arm.
List of original contributors:

Zoltan Varga <[email protected]>
Joao Matos <[email protected]>
2016-03-28 15:31:38 -07:00
Rodrigo Kumpera 8cd0189fa3 [runtime] Move gsharedvt to public plus amd64 implementation.
List of original contributors:

Zoltan Varga <[email protected]>
Rodrigo Kumpera <[email protected]>
Andi McClure <[email protected]>
2016-03-28 15:31:32 -07:00
Rodrigo Kumpera a3d1c706e4 [mini] Try to use libcorkscrew or libunwind on Android when crashing.
List of original contributors:

Alex Rønne Petersen <[email protected]>
2016-03-28 13:36:41 -07:00
monojenkins 52cb2c951a Merge pull request #2798 from BrzVlad/fix-sgen-timestamp
[sgen] Fix sgen binary protocol timestamp

TV_ELAPSED was cast to long instead of gint64, overflowing on some platforms.
2016-03-28 21:12:07 +01:00
Zoltan Varga 98cd89232b [bcl] Avoid 'sed: net_4_x_System.ServiceModel_test.dll.excludes: No such file or directory' warnings during the build. 2016-03-28 16:02:05 -04:00
Zoltan Varga ed0fc118cb [arm] In the llvm throw corlib exception trampoline, use the normal caller ip instead of the argument passed in by the caller since that might not point directly to the call instruction. Fixes #39420. 2016-03-28 15:50:35 -04:00
Rodrigo Kumpera 43d2aed644 [runtime] Add runtime support for explicit offset files.
Explicit offset files are provided by configuring mono with --with-cross-offsets

List of original contributors:

Joao Matos <[email protected]>
Zoltan Varga <[email protected]>
Rolf Bjarne Kvinge <[email protected]>
Rodrigo Kumpera <[email protected]>
2016-03-28 12:48:20 -07:00
Rodrigo Kumpera 2d42e41af6 [runtime] Add cross helpers that both check offsets and produce headers.
List of original contributors:

Rodrigo Kumpera <[email protected]>
Zoltan Varga <[email protected]>
2016-03-28 12:48:19 -07:00
Rodrigo Kumpera 94f49405a1 [utils] Workarounds for 64bits atomics on mobile.
List of original contributors:

Rodrigo Kumpera <[email protected]>
Alex Rønne Petersen <[email protected]>
Zoltan Varga <[email protected]>
Rolf Bjarne Kvinge <[email protected]>
2016-03-28 12:48:19 -07:00
Rodrigo Kumpera 5de88ab307 [utils] Fix name clash on dlmalloc on x86 android devices. Fixes #13957
Android uses dlmalloc within bionic. For some reason, our x86 build
links against the libc implementation instead of our own.

This leads us allocating memory that is not executable which made
dynamic methods fail when executing.

List of original contributors:

Rodrigo Kumpera <[email protected]>
2016-03-28 12:48:19 -07:00
Zoltan Varga b4d7399768 [runtime] Make an argument name more descriptive. 2016-03-28 15:48:08 -04:00
Rodrigo Kumpera 2a7be75dfb [android] Add fallback for thread bounds calculation for Android.
On some junk Samsung x86 device, pthread_attr_getstack is completely broken.

If the returned value is not sane, we parse /proc/self/maps to find the right
memory regions for the current stack.

Fixes BXC #21550 and DESK #83333.

List of original contributors:

Rodrigo Kumpera <[email protected]>
2016-03-28 12:47:38 -07:00
Rodrigo Kumpera bebc7dd658 Merge pull request #2797 from kumpera/android_krait_bug
[android] Fix Krait CPU bug on Android.
2016-03-28 12:08:43 -07:00
monojenkins 1c6b82896f Merge pull request #2785 from alexanderkyte/cached_info_leak
[runtime] Free cached_info tables on cleanup
2016-03-28 19:56:03 +01:00
Alexander Köplinger d69f4d14e9 [corlib] Two small fixes for GCHandle
1) Free() throws on MS.NET when the handle was already freed, copied and adapted the referencesource implementation.

2) Explicit conversion from IntPtr to GCHandle throws InvalidOperationException when value is IntPtr.Zero on MS.NET, not ArgumentException.

This fixes two failing CoreCLR test cases.
2016-03-28 20:00:57 +02:00
Vlad Brezae bc17db4c90 [sgen] Cement objects for the finishing pause
With the concurrent collector, we used to reset cementing at the start of the finishing pause (we can uncement since we process all the remsets when the world is stopped, through the mod union entries). This processing means cardtable scan in the finishing pause. In order to reduce pause time and overhead, we extend cementing for the finishing pause. Now we don't uncement objects (during sgen_cement_reset) that are still pinned in the roots at the start of the concurrent collection. We won't mark mod_union entries for these objects and they will survive the collection in the nursery. They can become uncemented at the start of the next major collection, given that they are no longer pinned in the roots.
2016-03-28 20:56:27 +03:00
Vlad Brezae e222e31395 [sgen] Don't scan the roots on the worker
We used to enqueue the jobs on the worker only for us to wait for them to finish in the same pause.
2016-03-28 20:32:35 +03:00
Aleksey Kliger 497f16a441 [runtime] MonoError-ize mono_lookup_dynamic_token 2016-03-28 12:37:35 -04:00
Aleksey Kliger 1c96b12e8a [runtime] MonoError-ize mono_lookup_dynamic_token_class
It just calls mono_reflection_lookup_dynamic_token directly.
2016-03-28 12:37:35 -04:00
Aleksey Kliger 10745c153b [runtime] Remove MonoLookupDynamicToken indirection
Call mono_reflection_lookup_dynamic_token directly from
mono_lookup_dynamic_token.

Delete mono_install_lookup_dynamic_token () and the
MonoLookupDynamicToken typedef.
2016-03-28 12:37:35 -04:00
Aleksey Kliger 96373eb62e [reflection] MonoError-ize mono_reflection_lookup_dynamic_token
Since it gets installed as a callback, update the MonoLookupDynamicToken typedef.
2016-03-28 12:37:35 -04:00
Aleksey Kliger 9cc0c474c6 [SRE] Fix compile warning in encode_cattr_value
Landed mono_object_isinst_checked PR in a way that broke encode_cattr_value.
2016-03-28 12:36:07 -04:00
Vlad Brezae e899317ec2 [sgen] Fix sgen binary protocol timestamp
TV_ELAPSED was cast to long instead of gint64, overflowing on some platforms.
2016-03-28 19:34:38 +03:00
Vlad Brezae 4dba3647b8 Merge pull request #2621 from BrzVlad/feature-conc-preclean
[sgen] Concurrent precleaning of card table
2016-03-28 23:26:08 +07:00
Aleksey Kliger (λgeek) d86a194f61 Merge pull request #2795 from lambdageek/dev/marshal-no-raise
[marshal] Don't raise an exception, just assert
2016-03-28 11:27:36 -04:00
monojenkins c92b046a66 Merge pull request #2770 from lambdageek/dev/monoerror-object_isinst_mbyref
[runtime] MonoError-ize mono_object_isinst{,_mbyref}

Also mark them external only.  Runtime should use mono_object_isinst_mbyref_checked and mono_object_isinst_checked
2016-03-28 15:45:22 +01:00
Zoltan Varga c60098a18a [aot] Emit a .subsections_via_symbols directive on arm. 2016-03-27 20:45:07 -04:00
Zoltan Varga 8c52b398c5 [aot] Fix a memory leak. 2016-03-27 18:49:57 -04:00
Zoltan Varga a24d194910 [runtime] Avoid setting klass->instance_size if its already set, this can happen when loading cached class info from an AOT image. This could lead to random crashes/asserts since klass->instance_size is directly modified while it is computed. 2016-03-27 18:43:37 -04:00
Zoltan Varga b97ac00232 [runtime] Fix a memory leak in ves_icall_Type_GetNestedTypes (). 2016-03-27 18:43:37 -04:00
Alexander Köplinger 19f7526091 Merge pull request #2779 from akoeplinger/fix-socket-closed
[System] Use Monitor.Wait/Pulse in SafeSocketHandle instead of Thread.Sleep
2016-03-27 17:33:48 +02:00
Alexander Köplinger c44bb41913 [System] Use Monitor.Wait/Pulse in SafeSocketHandle instead of Thread.Sleep
We are quite frequently seeing an error on the ARM workers on Jenkins:

```
Test Case Failures:
1) MonoTests.System.Net.Sockets.SocketTest.SendAsyncFile : System.Exception : Could not abort registered blocking threads before closing socket.
at System.Net.Sockets.SafeSocketHandle.ReleaseHandle () [0x000be] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System/System.Net.Sockets/SafeSocketHandle.cs:77
at System.Runtime.InteropServices.SafeHandle.DangerousReleaseInternal (Boolean dispose) <0x42cb0050 + 0x0020b> in <filename unknown>:0
at System.Runtime.InteropServices.SafeHandle.InternalDispose () <0x446ba758 + 0x00023> in <filename unknown>:0
at System.Runtime.InteropServices.SafeHandle.Dispose (Boolean disposing) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/runtime/remoting/callcontext.cs:804
at System.Runtime.InteropServices.SafeHandle.Dispose () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/runtime/remoting/callcontext.cs:795
at System.Net.Sockets.Socket.Dispose (Boolean disposing) [0x00047] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System/System.Net.Sockets/Socket.cs:3321
at System.Net.Sockets.Socket.Dispose () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System/System.Net.Sockets/Socket.cs:3327
at System.Net.Sockets.Socket.Close () [0x00007] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System/System.Net.Sockets/Socket.cs:3256
at MonoTests.System.Net.Sockets.SocketTest.SendAsyncFile () [0x000e7] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs:4331
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0003d] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs:103
```

Let's see if implementing the suggestion from https://github.com/mono/mono/pull/1612/files#r26393224
fixes this. I couldn't reproduce the test failure even on the same ARM machine so this is a bit of
an opportunistic change, but it feels like the more "correct" solution anyway.

I decided to inline AbortRegisteredThreads as at the only place we're calling it we already know
blocking_threads can't be null and acquired the lock.
2016-03-27 03:59:26 +02:00
monojenkins 26c35ad402 Merge pull request #2789 from lambdageek/dev/monoerror-threading
[threadpool-ms] MonoError-ize

1. Convert icalls that throw `NotImplementedException` to do it via mono_error_set_pending_exception
2. Add MonoError outargs to `mono_threadpool_ms_enqueue_work_item` and `mono_threadpool_ms_begin_invoke`
2016-03-26 01:41:10 +00:00
Aleksey Kliger fbe1210790 [runtime] MonoError-ize mono_object_isinst
Mark it external only. Runtime should use mono_object_isinst_checked.
2016-03-25 18:11:12 -04:00
Aleksey Kliger 63ac55e2eb [threadpool-ms] MonoError-ize mono_threadpool_ms_begin_invoke 2016-03-25 17:23:01 -04:00
monojenkins 8e7561bc87 Merge pull request #2748 from lambdageek/dev/monoerror-mono_value_box
[runtime] Make mono_value_box use MonoError

Mark it external only.  Runtime should use mono_value_box_checked.
2016-03-25 20:55:38 +00:00
Aleksey Kliger 6be18d1f6c [runtime] MonoError-ize mono_object_isinst_mbyref
Also mark it external only.  Runtime should use mono_object_isinst_mbyref_checked
2016-03-25 15:36:47 -04:00
Aleksey Kliger 9f0dd935da [MonoError] change mono_error_set_pending_exception to return a bool
Return TRUE if pending exception was set, FALSE otherwise.

The idea is that you can write:
  if (mono_error_set_pending_exception (error)) {
    /* cleanup */
    return;
  }
2016-03-25 15:36:46 -04:00
Rodrigo Kumpera e3b4f547ec [android] Fix Krait CPU bug on Android.
Krait cpus don't ignore thumb ITT state in ARM mode (it's unspecified CPU behavior).
The linux kernel then didn't bother resetting that state when landing an ARM signal handler.

The end result was that Krait cpus would skip the first few instructions of the signal handler
and things would explode in the most amazing possible ways.

Patch by Mark Probst <[email protected]>.
2016-03-25 15:23:15 -04:00
Aleksey Kliger ca72936e8f [marshal] Don't raise an exception, just assert
Don't raise deep in the marshalling code, just assert.

(Raising means we'd have to convert the code to use MonoError and then
thread it out through all of the marshalling code resulting in a lot of
code churn)
2016-03-25 13:30:38 -04:00
Aleksey Kliger 7962352afa [runtime] MonoError-ize mono_nullable_box 2016-03-25 13:01:26 -04:00
Aleksey Kliger 31d655b5e3 [runtime] Make mono_value_box use MonoError
Mark it external only.  Runtime should use mono_value_box_checked.
2016-03-25 13:01:26 -04:00
Aleksey Kliger f86ab8b8a5 [threadpool-ms] MonoError-ize mono_threadpool_ms_enqueue_work_item
Take a MonoError outarg; return boolean on success/failure.
2016-03-25 11:38:19 -04:00
Aleksey Kliger c83750365f [threadpool-ms] MonoError-ize some not implemented icalls.
1. ves_icall_System_Threading_ThreadPool_ReportThreadStatus
2. ves_icall_System_Threading_ThreadPool_PostQueuedCompletionStatus
2016-03-25 11:38:19 -04:00
Aleksey Kliger (λgeek) ac0cc68b7f Merge pull request #2791 from lambdageek/dev/monoerror-cleanup-deadcode
[runtime] Remove dead code and don't throw in embedding API functions
2016-03-25 11:33:37 -04:00
Vlad Brezae b555a68a06 [sgen] Add option for enabling/disabling precleaning 2016-03-25 02:12:57 +02:00
Vlad Brezae ff9488f11f [sgen] Preclean mod union entries before the finishing pause
When the concurrent mark ends, we have another concurrent phase where we scan the cardtable trying to clean as many cards as possible. The way we achieve this is by first copying all the mod union cards (for each block/los_obj) to a separate temporary card_table. When scanning we will only scan these cards. Therefore we will first preclean these cards in the actual mod_union card_tables, followed by a full memory barrier (which assures us that, when scanning, we will observe the changes that led to the corresponding card marks) and then by a normal mod_union scan, which can remark some of these cards, without any races with the preclean phase.
2016-03-25 02:12:57 +02:00
Vlad Brezae 93bc7c02fe [sgen] Move assert to the right place 2016-03-25 02:12:57 +02:00
Vlad Brezae f457f41dcb [runtime] Enclose define parameters in parentheses 2016-03-25 02:12:57 +02:00
Vlad Brezae 6a712c9d4e [sgen] Add separate scan function for handling a single pointer entry
This way we avoid duplicating cardtable marking code, making sure we have consistent code.

For example, when scanning los objects in the mod union scan step, we didn't check whether the object is cemented or not, leading to additional unnecessary global remsets for the next nursery collection.
2016-03-25 02:12:57 +02:00
Vlad Brezae 15fc3dabbc [sgen] Move scan vtype with the other object ops 2016-03-25 02:12:56 +02:00
Vlad Brezae ffa21caf85 [sgen] Simplify defines for object ops 2016-03-25 02:12:56 +02:00
Vlad Brezae 411e560fa7 [sgen] Allow read only access on block list without taking GC_LOCK
Still, block list should not be accessed while sweep is running.
2016-03-25 02:12:56 +02:00
Vlad Brezae 67275f09c0 [sgen] Allow read only access of los object list without taking GC_LOCK
Still, object lists should not be accessed while sweep is running.
2016-03-25 02:12:56 +02:00
Vlad Brezae 33beedda93 [sgen] Extract the handle array code for reuse
We add a new data structure which contains a bucket of entries, exponentially increasing in sizes. The structure is customizable through a few callbacks.

Setting is_slot_set_func enables us to also lookup empty slots, instead of only adding entries at the end of the list.

Setting set_slot_func enables the use of a customized function for setting the slot. If this function is not set, the slots and array fields will be set directly, therefore the structure won't be thread safe.
2016-03-25 02:12:56 +02:00
Vlad Brezae 32ec26d7f4 [sgen] Don't prefetch unused memory when scanning the card table
When doing the mod union scan, we use the block's cardtable (instead of the global one), which we also cannot prefetch, since that would mean dereferencing the block info.
2016-03-25 02:12:56 +02:00
Alexander Köplinger a9a485768f Merge pull request #2793 from radical/fix-mcs-args
[mcs] Accept and ignore command line args supported by csc that we don't
2016-03-25 01:05:23 +01:00
Aleksey Kliger 86776605f7 [runtime] mark mono_domain_unload external only
Runtime should use mono_domain_try_unload
2016-03-24 19:29:09 -04:00
Aleksey Kliger 50f9712da2 [runtime] Remove CHECK_MONOTYPE macro
It's dead code.
2016-03-24 19:27:22 -04:00
Aleksey Kliger f92d01d3e1 [runtime] Delete mono_assert and mono_assert_not_reached
Runtime should use g_assert and g_assert_not_reached or set a MonoError,
as needed.

Also remove REAL_PRINT_REG dead macros from mini-x86.c and mini-amd64.c
2016-03-24 19:27:22 -04:00
Aleksey Kliger 21b44cc5e0 [runtime] Change mono_object_castclass_mbyref not to throw
Mark the function external only. (There are no uses inside the runtime).

Change behavior to return NULL if unable to cast, instead of throwing.
2016-03-24 19:27:22 -04:00
Aleksey Kliger (λgeek) 0589a490e0 Merge pull request #2790 from lambdageek/dev/monoerror-corlib-execeptions
[MonoError] Helpers for some common corlib exceptions
2016-03-24 19:19:49 -04:00
Andi McClure 9a0806c1b6 Make --aot=full able to emit executables on 64 bit Windows
- COFF does not use .local or .size
- COFF does use .def to mark functions and .data to mark data
- The seh_handler functions should not be called on full aot builds (Zoltan says they are unnecessary in full aot, and they attempt to jit)

The executables do not yet run without crashing.
2016-03-24 14:11:48 -07:00
Andi McClure 20c21e17ce Support tool-prefix in mono/mini fullaotcheck
* Support MONO_FULLAOT_ADDITIONAL_ARGS env var for make fullaotcheck, appended to --aot parameters
* To support above, permit "blank" parameters (ie trailing commas on parameter list) to --aot=
* --aot tool-prefix parameter now supported for LD as well as AS
2016-03-28 17:30:56 -04:00
Andi McClure de6acf94b5 Fix debug Windows builds in MSVC 2015
We were sometimes passing invalid input to isalnum(). On the debug version of MSVCRT this would result in an assert.
2016-03-28 17:26:09 -04:00
Zoltan Varga 12d24c694f [arm] Fix support for soft breakpoints. 2016-03-24 20:04:59 +00:00
Ankit Jain 22a512306a [mcs] Accept and ignore command line args supported by csc that we don't
support:

	/analyzer
	/appconfig
	/baseaddress
	/deterministic
	/errorendlocation
	/errorlog
	/features
	/link
	/moduleassemblyname
	/pathmap
	/pdb
	/preferreduilang
	/publicsign
	/reportanalyzer
	/ruleset
	/sqmsessionguid
2016-03-24 15:21:58 -04:00
Zoltan Varga 9e469ff9b0 [runtime] Make the appdomain-unload.exe test more verbose. 2016-03-24 12:49:47 -04:00
Zoltan Varga 81b0643704 [aot] Reenable the emission of line number info using GAS .file/.loc directives, recent versions of clang seems to support it. 2016-03-24 12:06:33 -04:00
Zoltan Varga ef24a9be0c [jit] Fix the dwarf info structure when there is no line number table. 2016-03-24 11:45:56 -04:00
Zoltan Varga f0527c1d77 [jit] Remove the 'appending' support from the dwarf writer, its no longer used. 2016-03-24 11:28:38 -04:00
Zoltan Varga 6a857be649 [jit] Get rid of the create_delegate_trampoline_data () helper function which only has one caller. 2016-03-24 11:28:38 -04:00
Aleksey Kliger (λgeek) 1e764e5c29 Merge pull request #2768 from lambdageek/dev/monoerror-cominterop
[com] MonoError-ize cominterop.c
2016-03-24 11:19:42 -04:00
Alexis Christoforides 8004de2b79 Merge pull request #2663 from esdrubal/islocal
[System] Fixes HttpListenerRequest.IsLocal.
2016-03-24 10:45:48 -04:00
Chris Hamons 6d65ef281b Create xammac_net_4_5 variant of System.Runtime.Remoting 2016-03-24 08:47:40 -05:00
Alexander Köplinger c5789eb523 Trigger a rebuild of Mono.Security 2016-03-24 03:11:47 +01:00
Martin Baulig 2b3bd83a8a [Mono.Security]: MonoTlsProvider.InvokeSystemCertificateValidator() now takes 'ref X509Chain'. 2016-03-23 19:47:13 -04:00
Martin Baulig 204435045c [System]: Add private 'X500DistinguishedName' API to store the canonical encoding and use it for fast comparison. 2016-03-23 19:47:05 -04:00
Martin Baulig 2ff8515937 [System]: SystemCertificateValidator.CheckUsage(): lazily convert to X509Certificate2 if needed. 2016-03-23 19:46:51 -04:00
Martin Baulig e75c32654e [System]: Make 'X509Certificate2' and 'X509Chain' lazily-initialized.
Add new internal 'X509Certificate2Impl' and 'X509ChainImpl' classes similar to
'X509CertificateImpl' in corlib and only initialize them when actually needed.
2016-03-23 19:44:56 -04:00
Martin Baulig a9fc9c628e [corlib]: Cleanup the internal 'X509CertificateImpl' API. 2016-03-23 19:44:55 -04:00
Zoltan Varga 2129176357 [ppdb] Disable the metadata verifier for ppdb tables for now. Fixes #39631. 2016-03-23 17:11:28 -04:00
Aleksey Kliger fc8d1f17fd [MonoError] Use mono_error_set_execution_engine helper 2016-03-23 15:11:48 -04:00
Aleksey Kliger 8ea690b721 [MonoError] Use mono_error_set_not_supported helper 2016-03-23 15:11:48 -04:00
Aleksey Kliger 652c720de4 [MonoError] Use mono_error_set_not_implemented helper 2016-03-23 15:03:25 -04:00
Aleksey Kliger b1ca6ff58a [MonoError] add helpers for some corlib exceptions
System.ExecutionEngineException
System.NotSupportedException
System.NotImplementedException
2016-03-23 15:00:16 -04:00
Alexander Kyte 86878c3516 [runtime] Make memory allocation for method headers consistent, stop leaking 2016-03-23 14:40:26 -04:00
Zoltan Varga dc612228c0 [man] Remove documentation for the nonexistent MONO_ENABLE_SHM environment variable. 2016-03-23 14:10:16 -04:00
Alexander Köplinger 256f554592 Merge pull request #2784 from mhutch/msbuild-fixes
Fix regressions in Microsoft.Build.dll
2016-03-23 16:43:24 +01:00
Marek Safar 17bfe86a0f [cil-stringreplacer] Use Cecil as reference dependency 2016-03-23 15:44:25 +01:00
Marek Safar 0dc62df603 [cil-stringreplacer] Update debug symbol 2016-03-23 13:09:15 +01:00
monojenkins 54bb28c8a7 Merge pull request #2783 from alexanderkyte/strdup_memory_leaks
[runtime] Fix memory leaks related to short-lived strings
2016-03-22 22:35:21 +00:00
monojenkins c116b85fb9 Merge pull request #2775 from lambdageek/dev/monoerror-reflection-icalls
[SRE] MonoError-ize some icalls

* Cleanup some memory that would leak on failure; improve a few error messages
* Add MonoError to `mono_reflection_call_is_assignable_to` and `fieldbuilder_to_mono_class_field`.
* Update several SRE icalls to follow the pattern:
  ```c
    void
    the_icall (args... )
    {
       MonoError error;
       (void) the_real_work_function (args..., &error);
       mono_error_set_pending_exception (&error);
    }
    
    static gboolean
    the_real_work_function (args..., MonoError *error)
    {
       ... /* return TRUE on success, FALSE and set error on failure */ ...
    }
  ```
  Do this to:
        1. `mono_reflection_register_with_runtime`
        2. `mono_reflection_setup_internal_class`
        3. `mono_reflection_create_internal_class`
        4. `mono_reflection_generic_class_initialize`
        5. `mono_reflection_event_builder_get_event_info`
        6. `mono_reflection_initialize_generic_parameter`
        7. `mono_reflection_create_dynamic_method`
2016-03-22 22:35:16 +00:00
Alexander Köplinger f6de55f558 Merge pull request #2782 from madewokherd/process-sessionid
[System.Diagnostics] Return dummy value from Process.SessionId.
2016-03-22 18:58:06 +01:00
Vincent Povirk b151d03acb [System.Diagnostics] Return dummy value from Process.SessionId. 2016-03-22 12:46:13 -05:00
Joao Matos 38d3186f9e [sgen] Switch the default GC bridge to the new mode. 2016-03-22 17:45:57 +00:00
Alexander Kyte 6e9d37ed8a [runtime] Free leaked short-lived MonoType 2016-03-22 13:19:50 -04:00
Mikayla Hutchinson e306282d71 [Microsoft.Build] Shut down single-use build manager 2016-03-22 12:06:19 -04:00
Marcos Henrich e1403cc11a Merge pull request #2764 from esdrubal/fileinfo_tostring
[corlib] Fix FileInfo.ToString after MoveTo
2016-03-22 14:41:18 +00:00
Marcos Henrich 07eed74767 [mono-symbolicate] Use SeqPointInfo instead of PInvoking. 2016-03-22 14:22:49 +00:00
Marcos Henrich 11aa99476b [mono-symbolicate] Created SeqPointInfo.cs
SeqPointInfo is a c# implementation of the debug data decoding process
that is done natively by the runtime.
2016-03-22 14:22:49 +00:00
Marcos Henrich dec4f74c28 [corlib] Removed unused icall
icall StackFrame.GetILOffsetFromFile is no longer used by mono-symbolicate.
2016-03-22 14:17:42 +00:00
Marcos Henrich 1802414280 [System.ServiceModel] Fixes reflection call to undefined method
This fixes an issue while using WCF on android.

Fixes #36080
2016-03-22 14:09:05 +00:00
Marcos Henrich 2dd061dd2d [System.ServiceModel] Test EndpointAddress10
The issue only occurs in monodroid.

Covers #36080
2016-03-22 14:09:04 +00:00
monojenkins 51d88a0dc5 Merge pull request #2534 from mhutch/install-api-html
Install mono-api-html

We install its counterpart mono-api-info already
2016-03-22 01:35:28 +00:00
Alexander Kyte 6c15399918 [runtime] Free cached_info tables on cleanup 2016-03-21 19:52:14 -04:00
Alexander Kyte 1283043d09 [runtime] Prevent leaking inflated headers by marking them transient, only free in one place. 2016-03-21 19:19:07 -04:00
Alexander Kyte d7c7e97981 [runtime] Make mono_basic_block_split take the header it uses 2016-03-21 19:19:07 -04:00
mhutch 3bf54b6ddf Install mono-api-html
We install its counterpart mono-api-info already
2016-03-21 18:07:36 -04:00
mhutch b9dedbdca5 [Microsoft.Build] Set IsBackground on builder thread
It should not prevent the process from terminating. Fixes
issue where the thread is not shut down if ProjectInstances
are built directly instead of via the build manager.
2016-03-21 18:03:02 -04:00
mhutch fb1ee67560 [Microsoft.Build] Fix exception disposing BuildManager 2016-03-21 18:03:02 -04:00
Alexander Kyte 6287948e23 [runtime] Remove string memory leak related to basename 2016-03-21 17:54:57 -04:00
Alexander Kyte 470887fae2 [runtime] Fix reassignment over string-pointing var without freeing 2016-03-21 17:54:48 -04:00
Alexander Kyte 85d318b725 [runtime] Implement performant unbounded-depth sequence point search
With this change we search for sequence points to unbounded depth and memoize in basic blocks
2016-03-21 12:09:18 -04:00
Andi McClure 50f2a10358 Merge pull request #2778 from xmcclure/checked-build-updates-2
Fix patch merge error in PR#2753, was breaking checked build
2016-03-21 10:27:40 -04:00
Andi McClure 4d1e42ce27 Fix patch merge error in PR#2753, was breaking checked build 2016-03-21 10:24:13 -04:00
Alexander Köplinger f7e403c72b Add note about acceptance-tests to top level README 2016-03-21 14:28:25 +01:00
Alexander Köplinger 969e00e1dd Fix "make dist" 2016-03-20 20:20:39 +01:00
Zoltan Varga a0149991af [gsharedvt] Add a test for #39528. 2016-03-19 23:19:00 +01:00
Zoltan Varga 3a271bbebc [runtime] Remove some dead test code added by c736aba5c9. 2016-03-19 15:52:20 +01:00
Zoltan Varga c736aba5c9 [runtime] Implement support for passing icall methods as delegates in pinvoke. Fixes #39347. 2016-03-19 13:03:31 +01:00
Zoltan Varga eac8dbdb77 [runtime] Remove an mistaken assert. Fixes #39568. 2016-03-19 12:21:15 +01:00
Zoltan Varga 6c6ab8c0db [jit] Remove an mistaken assert. Fixes #39746. 2016-03-19 12:11:20 +01:00
monojenkins 65e51c54aa Merge pull request #2777 from xmcclure/win-makefile-aotcheck
Make `make fullaotcheck` in mono/mini runnable on Windows

Run with  
MONO_EXECUTABLE=/path/to/msvc/mono.exe LIST_SEPARATOR=";"  
This assumes you are running the test harness in Cygwin and you built mono with MSVC. Also, the test does not currently succeed.  
Being able to run the test is a zeroth step toward making the test pass.
2016-03-19 01:30:17 +00:00
Alexander Köplinger 074266c4c7 [System.Net.Http] Make HttpClientTest.RequestUriAfterRedirect test more reliable
It was the only test in the class that required network access (for looking up xamarin.com in the redirect).
Replacing the redirect target with a second local HttpListener should be more resilient to network/DNS issues.
2016-03-19 02:28:20 +01:00
Andi McClure 9a1720e9ab mono/mini make fullaotcheck can now be run on Windows
Test harness now uses the proper path separator and also now supports
MONO_EXECUTABLE if you built with MSVC.
2016-03-18 18:24:41 -04:00
monojenkins 23fbdb6643 Merge pull request #2753 from xmcclure/checked-build-updates
Changes to "checked build" feature

Here are some changes to checked builds I made while trying to debug some coop gc problems. The changes made are:

- Replace the checked build configure flags with a single --enable-checked-build= flag
- Runtime environment variable required for checked build asserts to run
- Report the thread transition history for more kinds of asserts
- For the `mono_threads_reset_blocking` functions, add an assert that guarantees proper nesting

In addition to this, I have documented the checked build feature as implemented here, see my pull request for the website: https://github.com/mono/website/pull/187

Overall my goals with this patch were

- Make it easier to do rapid-fire testing with the checked builds (runtime switch, default-off)
- Make the checked build implementation more internally consistent (more uniform names etc)

Notice I do make the change that instead of checked build sub-features being disabled with a blacklist, you now must enable them with a whitelist. I think this is an improvement because it makes it easier to just casually keep a checked build around  (for one thing I would have the option to ship debug builds to users with the checked build modes included but dormant) but I could be talked out of it if this change turns out to be controversial. The only thing I feel strongly about is that if the configure flag is changed back to a blacklist the environment variable should switch to a blacklist also.

If we accept this change the CI bots will need to adopt the new configure flag and environment variable.
2016-03-18 22:00:34 +00:00
monojenkins 4a1dbf8e22 Merge pull request #2746 from lambdageek/dev/monoerror-mono_reflection_create_runtime_class
[System.Reflection.Emit] MonoError in mono_reflection_create_runtime_class

Depends on #2745
Bubble MonoError up to `mono_reflection_create_runtime_class`.  Use `mono_error_set_pending_exception` instead of `mono_error_raise_exception` And try to release resources on the way out.
2016-03-18 22:00:24 +00:00
Aleksey Kliger f52e4e1a9d [SRE] Refactor a few icalls
The icalls follow the pattern:
    void
    the_icall (args... )
    {
       MonoError error;
       (void) the_real_work_function (args..., &error);
       mono_error_set_pending_exception (&error);
    }

    static gboolean
    the_real_work_function (args..., MonoError *error)
    {
       ... /* return TRUE on success, FALSE and set error on failure */ ...
    }

Do this to:
1. mono_reflection_register_with_runtime
2. mono_reflection_setup_internal_class
3. mono_reflection_create_internal_class
4. mono_reflection_generic_class_initialize
5. mono_reflection_event_builder_get_event_info
6. mono_reflection_initialize_generic_parameter
7. mono_reflection_create_dynamic_method
2016-03-18 14:41:26 -07:00
Aleksey Kliger 8f1bee6746 [SRE] Some cleanups in mono_method_body_get_object_checked
Don't leak method header on failure.
2016-03-18 14:41:25 -07:00
Aleksey Kliger 1132d61ac2 [SRE] MonoError for fieldbuilder_to_mono_class_field 2016-03-18 14:41:24 -07:00
Neale Ferguson a6bc6cda4a mono-threads.c - Use the environment variable (if set) to determine the abort time
libmonoutils.vcxproj - Add new logging source code files to the project
2016-03-18 16:28:40 -04:00
Andi McClure 173e2d4ce6 Add mono_threads_reset_blocking nesting checks to gc checked mode 2016-03-18 15:18:38 -04:00
Andi McClure c89d68e055 Rename checked build assertion_fail to mono_fatal_with_history, use in more places 2016-03-18 16:07:14 -04:00
monojenkins 1652651cf4 Merge pull request #2772 from WeiHeCN/master
Update mini-llvm.c

These header files are already included in mini-llvm-cpp.h.
2016-03-18 18:15:24 +00:00
WeiHeCN 617e374a51 Update mini-llvm.c 2016-03-18 11:40:41 +08:00
Aleksey Kliger c2d8f707aa [reflection] MonoError for mono_reflection_call_is_assignable_to 2016-03-17 14:46:02 -07:00
Aleksey Kliger cde8064664 [SRE] MonoError for mono_reflection_create_runtime_class
1. Don't raise while holding locks.

2. Change remove_instantiations_of_and_ensure_contents (called via
  g_hash_table_foreach_remove) to populate a MonoError instead of
  throwing.  If there are multiple errors, we just stash the first one
  in user_data and clean up the rest.

3. Use mono_erro_set_pending_exception instead of
  mono_error_raise_exception since it's an icall.
2016-03-17 14:44:23 -07:00
monojenkins ca7b692f45 Merge pull request #2745 from lambdageek/dev/monoerror-sre-internals
[System.Reflection.Emit] Propagate MonoError through some more static functions

Some externally visible changes include:
* Bubble MonoError up to one more SRE icall: `System.Reflection.Emit.CustomAttributeBuilder.GetBlob()`
* `fix_partial_generic_class` and `ensure_generic_class_runtime_vtable` now expect their callers to set the class failure state which they do under slightly more circumstances now than previously (now: whenever there's an error set from the above functions; before: only when we had trouble initializing the generic type definition.)
* Previous API for `mono_reflection_bind_generic_parameters` didn't make it clear whether NULL was a valid return value or not.  Now when we return NULL we always set the `error` out-arg. So non-NULL is success and NULL is failure.
2016-03-17 21:35:31 +00:00
Aleksey Kliger 36bd9d8839 [reflection] MonoError for mono_marshal_spec_from_builder 2016-03-17 11:12:55 -07:00
Aleksey Kliger e987b3ec4f [reflection] Mark mono_reflection_get_custom_attrs_blob external only.
The runtime should use mono_reflection_get_custom_attrs_blob_checked.
The icall is now ves_icall_System_Reflection_Emit_CustomAttributeBuilder_GetBlob.
2016-03-17 11:12:55 -07:00
Aleksey Kliger 83d8c46875 [reflection] MonoError for resolve_object 2016-03-17 11:12:54 -07:00
Aleksey Kliger f77174ed85 [reflection] MonoError for ensure_complete_type 2016-03-17 11:12:54 -07:00
Aleksey Kliger 504495a40d [reflection] MonoError for mono_reflection_get_dynamic_overrides 2016-03-17 11:12:54 -07:00
Aleksey Kliger c7d2742b8a [reflection] MonoError for mono_reflection_method_get_handle 2016-03-17 11:12:54 -07:00
Aleksey Kliger 3b053ac4fd [SRE] Don't set failiure flag in ensure_generic_class_runtime_vtable
Leave it up to the caller to set the flag.
2016-03-17 11:12:54 -07:00
Aleksey Kliger fff7cecf59 [SRE] Don't set class failure in fix_partial_generic class
Leave it to callers to set it based on the MonoError.

Also return a boolean indicating whether we succeeded or failed.
2016-03-17 11:12:53 -07:00
Aleksey Kliger 57fd64fcf5 [reflection] MonoError for fix_partial_generic_class 2016-03-17 11:12:53 -07:00
Aleksey Kliger 4b33c812d4 [SRE] Use MonoError for mono_reflection_bind_generic_parameters
This commit also changes the behavior of
mono_reflection_bind_generic_parameters slightly: if the passed in class
isn't generic, it sets error and returns NULL.  (It wasn't clearly
previously whether NULL was an error condition or not - with this commit
we clarify that a NULL result is an error).
2016-03-17 11:12:53 -07:00
Aleksey Kliger 51791a4014 [reflection] Use MonoError in encode_{cattr_value,named_val} 2016-03-17 11:12:53 -07:00
Aleksey Kliger 904b13af1d [reflection] MonoError in get_{prop,field}_name_and_type 2016-03-17 11:12:53 -07:00
Aleksey Kliger 2dc5eeb616 [reflection] MonoError in parameters_to_signature
And a few other static fns
2016-03-17 11:12:52 -07:00
Marek Safar ff7d80856e [gacutil] Add support for pdb file 2016-03-17 17:13:18 +01:00
Marek Safar 84a447da80 [build] Fix more incomplete mcs references names 2016-03-17 17:07:30 +01:00
Marek Safar aa4ca12eb2 [mcs] Allow local variables and parameters on lhs of nameof expression. Fixes #39455 2016-03-17 16:58:44 +01:00
Ludovic Henry 6277ba55de [runtime] Fix potential overflow when using mono_msec_ticks
Because mono_msec_ticks would previously return the number of milliseconds since boot time, it would overflow after ~49 days. That would mean that anywhere you would use it, you would need to be careful of arithmetic overflow.

By simply returning a gint64 we will not overflow before ~30k years.

Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=38666
2016-03-17 14:46:05 +00:00
Ludovic Henry 12ff2e4514 [io-layer] Remove dead code 2016-03-17 14:44:19 +00:00
Alexander Köplinger 8754b987e4 [mono] Remove al2/dmcs from TEST_SUPPORT_FILES too 2016-03-17 14:12:26 +01:00
Alexander Köplinger 3a403c38d8 [mono] Remove dmcs from temp install folder 2016-03-17 14:04:00 +01:00
Marek Safar d053f6600d [mono] Remove al2 from temp install folder 2016-03-17 13:57:35 +01:00
Alexander Köplinger 32c2049b85 [acceptance-tests] Bump ms-test-suite to pick up 4a95604fdf2c0523e68eaad64a17d22eebb051b3: 2016-03-17 13:55:42 +01:00
Zoltan Varga 3736375ac2 [runtime] Cleanup the debug info module before the images module since ppdb debug info depends on images. Fixes #39715. 2016-03-17 12:06:02 +01:00
Zoltan Varga 0b134076cf [ppdb] Avoid an assert if the ppdb image has an empty guid heap, it can happen if the assembly has no types thus no document guids. Fixes #39644. 2016-03-17 11:33:07 +01:00
Zoltan Varga 59887e3736 [arm] Avoid storing fp arguments below the stack pointer if the param area has size 0. Fixes #38161. 2016-03-17 11:14:53 +01:00
Marek Safar 07facde9a2 Bump referencesource 2016-03-17 10:23:49 +01:00
Aleksey Kliger dccb74f08a [com] Push MonoError through cominterop_get_ccw 2016-03-16 16:13:48 -07:00
Aleksey Kliger 85f8a3290f [com] Push MonoError through cominterop_get_idispatch_for_object 2016-03-16 16:13:47 -07:00
Aleksey Kliger e8011b9b9b [com] Push MonoError through cominterop_get_interface 2016-03-16 16:13:47 -07:00
Aleksey Kliger (λgeek) 11d21b86d2 Merge pull request #2766 from lambdageek/dev/monoerror-jit
[runtime] Propagate error from class loading when JIT-ing
2016-03-16 15:24:00 -07:00
Aleksey Kliger 43257ac125 [com] Change cominterop_raise_hr_exception to cominterop_set_hr_error
Don't throw the exception, just store the instance in a MonoError.
2016-03-16 14:39:39 -07:00
Alexander Köplinger 583567dc94 [acceptance-test] Ensure the exit code of the main test script is used
Due to our usage of chained commands it'd use the exit code of the last command,
which is not what we want. We use chaining because e.g. in the ms-test-suite
case we still want to run the systemruntimebringup suite even if the conformance
suite had a failing test.
2016-03-16 22:22:31 +01:00
Aleksey Kliger 9ff3f74910 [runtime] Propagate error from class loading when JIT-ing
This is another approach to a341404ecd
which was backed out because it was
stale (2a899492c3).
2016-03-16 10:41:59 -07:00
Marek Safar 09e4e3806a [bcl] Remove wrong IVT attributes 2016-03-16 18:36:33 +01:00
Marek Safar e78b5e75cc Merge pull request #2765 from akoeplinger/mcs-fix-test-windows-backslash
[compiler-tester] Fix incorrect failure with Windows paths in error messages
2016-03-16 18:18:27 +01:00
Marek Safar 2a899492c3 Revert "Merge pull request #2454 from tastywheattasteslikechicken/FixVtableAbort"
This reverts commit a341404ecd, reversing
changes made to 04a177b2be.
2016-03-16 15:55:40 +01:00
Marek Safar 14f96f65f5 [build] Add missing explicit references in docs 2016-03-16 15:45:48 +01:00
Marcos Henrich ecc975f035 [corlib] Fix FileInfo.ToString after MoveTo
Fixes #38796
2016-03-16 10:07:06 +00:00
Marcos Henrich bd79fac689 [corlib] Test FileInfo.ToString after MoveTo
Covers #38796
2016-03-16 10:06:33 +00:00
Zoltan Varga a341404ecd Merge pull request #2454 from tastywheattasteslikechicken/FixVtableAbort
[runtime] Fixes an abort caused by a TypeLoadException in certain ins…
2016-03-16 10:54:02 +01:00
Marek Safar 04a177b2be [corlib] RuntimeEnvironment from referencesource 2016-03-16 10:44:34 +01:00
Alexander Köplinger ef407901f8 [tests] Don't use AppDomain.AppendPrivateBinPath for assembly-load-remap.exe
It's not supposed to contain a full path to a directory, but rather a relative path
to a subdirectory of the ApplicationBase. However, this isn't enforced in all cases
by Mono so setting a full path worked when the path doesn't contain a '.' because then
the code in [1] doesn't clear the variable and the path is added to the domain->search_path.

This caused the test to fail on Wrench on the mono-4.4.0 lane because the path contains
a dot while confusingly it worked fine on master.

Fixing this by appending the xbuild_14 path via an alternative (albeit slightly hacky)
method related to the standard MONO_PATH env var. Because the variable is only read
once at app startup we need to call into the runtime to explicitly set the new path
before trying to load the MSBuild 14 assemblies. This is fine since we only
want to test that the correct assembly version is loaded and nothing else.

[1] https://github.com/mono/mono/blob/37b2b9fbc25a2199aba1d794117924d4828360a7/mono/metadata/appdomain.c#L1319-L1337
2016-03-16 03:33:24 +01:00
James Venning 9ca4e0ee28 [runtime] Fixes an abort caused by a TypeLoadException in certain instances 2016-03-16 10:20:36 +10:00
Martin Baulig 37b2b9fbc2 [System]: Fix certificate validation on Linux. Bug #39307. 2016-03-15 18:55:21 -04:00
Martin Baulig e21ff252af [System]: Properly propagate exceptions in 'MonoTlsStream'.
(cherry picked from commit a7ab399d09)
2016-03-15 18:45:54 -04:00
Martin Baulig af01f84119 [System]: Copy 'ServicePoint.Certificate' and 'ClientCertificate' from the referencesource.
(cherry picked from commit 76e0f64862)
2016-03-15 18:45:38 -04:00
Martin Baulig d7f52b74c9 [System]: In 'WebConnection.EndWrite()': always call EndWrite() on the underlying socket.
(cherry picked from commit dd9d66a7c2)
2016-03-15 18:44:58 -04:00
Alexander Köplinger 648414942c [System.Net.Http] Make HttpClientTest.GetString_Many test more reliable
It's flaky on Jenkins, removing the dependency on an external server and instead using a local HttpListener
to answer the requests should hopefully make it more reliable.
2016-03-15 21:16:24 +01:00
Marek Safar cf4f8ad342 [mcs] Partially revert c9d4cc55a1 2016-03-15 21:05:58 +01:00
Marek Safar c9d4cc55a1 [mcs] Don't sign sqlmetal and linker tools 2016-03-15 18:41:43 +01:00
Marek Safar 9f26108f3a [compiler-tester] Expand members error reporting to avoid problems with members called {} 2016-03-15 18:07:52 +01:00
monojenkins 195367f959 Merge pull request #2747 from lambdageek/dev/monoerror-mono_remote_class
[runtime] Add MonoError to mono_remote_class
2016-03-15 17:00:19 +00:00
Alexander Köplinger c5d740ff6a [tools] Don't install cil-stringreplacer
It's a tool that is only used during the Mono class lib build.
2016-03-15 15:44:10 +01:00
Miguel de Icaza f91bb070c1 [getline] Fix condition where Console.WriteLi<TAB><ENTER> completed to Console.WriteLinene 2016-03-15 10:25:57 -04:00
Miguel de Icaza 11b6f9b662 [repl] Further fine tuning; Show newlines as actual newlines in strings, plus fix quoting of chars < 32 2016-03-15 10:22:20 -04:00
Miguel de Icaza 998566db36 [repl] Do not escape space when pretty printing strings 2016-03-15 10:11:55 -04:00
Marcos Henrich 2a9c47b194 [corlib] Moved GetFullNameForStackTrace into StackTraceHelper
Moved StackTrace.GetFullNameForStackTrace into a new class
StackTraceHelper so the code can be reused by mono-symbolicate.

Reusing GetFullNameForStackTrace in mono-symbolicate allows the tool to
easily match a stack trace line with a method without doing a rather
complicate parsing of types and possible generic parameters
combinations.
2016-03-15 13:56:04 +00:00
Marcos Henrich 29c8d688db [mono-symbolicate] Load assemblies in reflection only context 2016-03-15 13:56:03 +00:00
Marek Safar 066f6b8ca8 [build] Use full filename for csc references 2016-03-15 13:58:30 +01:00
Marek Safar 788ee811f6 [compiler-tester] Remove moonlight build 2016-03-15 13:55:59 +01:00
Marek Safar 56d6468811 [monodoc] Remove redundant codepage argument 2016-03-15 13:55:30 +01:00
Marek Safar 916f39005c [System.Xml.Linq] Simplify dependencies 2016-03-15 13:53:54 +01:00
Marek Safar a12e9262e2 [Mono.Security.Providers.NewSystemSource] Use LIB_REFS to track references 2016-03-15 13:50:00 +01:00
Marek Safar d9ebd10b57 [system.runtime.serialization] Use correct IVT key for System.ServiceModel.Web 2016-03-15 13:48:24 +01:00
Alex Rønne Petersen 5fc03f6027 Merge pull request #2543 from ermshiperete/Xamarin-31021
Don't ignore drives with type "aufs" or "overlay" (Xamarin-31021)
2016-03-15 12:41:02 +01:00
Alexander Köplinger 1d828a45c9 Merge pull request #2757 from akoeplinger/fix-coreclr-test
Two coreclr test fixes
2016-03-15 01:16:54 +01:00
Zoltan Varga 966d6cbdd4 Fix the build. 2016-03-14 22:52:29 +01:00
Alexander Köplinger 00e71eef12 [corlib] Fix Delegate.Combine() to throw on non-matching types
This was inadvertently removed in https://github.com/mono/mono/commit/611a43ee0f672adbac3e25dc77731843a3d10cf1 from MulticastDelegate.CombineImpl().

Add the type check back in the Delegate base class, we already do the same in Remove().

Add unit tests to cover the behavior to the corlib test suite. (reverted from commit f29878dc713f4e148fe0a1e703fae8929e6fb6e0)

Needed to update some monodoc tests to match that an exception is now thrown again.
2016-03-14 19:19:13 +01:00
Andi McClure 3d44b341e1 Merge pull request #2755 from xmcclure/disable-omit-fp
"disable_omit_fp" option for MONO_DEBUG
2016-03-14 14:12:24 -04:00
Marek Safar 3fc399cb9b Merge pull request #2750 from radical/tasklogger
[xbuild] TaskLoggingHelper: Implement support for correctly using tas…
2016-03-14 18:47:22 +01:00
Ankit Jain aef44c0fdc [xbuild] TaskLoggingHelper: Implement support for correctly using task resources
- make task resources available to TaskLoggingHelper
- verify TaskLoggingHelper method args
- tests
2016-03-14 13:41:47 -04:00
Zoltan Varga e7c1138676 [jit] Remove some loader error usage. 2016-03-14 16:22:19 +01:00
Alexander Köplinger 4e2b2ff5af [corlib] Fix UIntPtr.ToString() 64bit implementation
Cast to ulong instead of uint, this is also what referencesource does:
https://github.com/Microsoft/referencesource/blob/d925d870f3cb3f6acdb14e71522ece7054e2233b/mscorlib/system/uintptr.cs#L114-L122

Also bump coreclr submodule to bring in another UIntPtr fix.
2016-03-14 15:46:59 +01:00
Marek Safar 57afae880b [mcs] Better check for automatically implemented property inside a type with an explicit StructLayout. Fixes #39574 2016-03-14 13:34:48 +01:00
Marek Safar ed05a531e8 [system.net.http] The backslash character may be used as a single-character quoting mechanism within quoted-string. Fixes #39569 2016-03-14 12:36:02 +01:00
Zoltan Varga f9f9746f98 Fix the build. 2016-03-14 10:15:33 +01:00
monojenkins 598062953a Merge pull request #2754 from markusbeth/fix-mono-config
fixed replacement of $mono_libdir in config file

strncpy does not NUL-terminate the destination string in this case so one cannot use strcat to append

This fixes the error "malloc: top chunk is corrupt" as reported on mono-devel-list back in 2015-10-20 (subject: "malloc error executing OBS-built mono") at least for me.
2016-03-14 04:35:14 +00:00
monojenkins d231e5bd62 Merge pull request #2756 from vargaz/llvm-jit-3.9
[llvm] Finish JIT support for llvm 3.9.
2016-03-13 20:35:18 +00:00
Zoltan Varga a9f5ba370a [llvm] Finish JIT support for llvm 3.9. 2016-03-13 19:49:10 +01:00
Bernhard Urban c7ccd6ef31 [mono-config] fix copying of prefix during replacement 2016-03-12 09:51:48 +01:00
Alexander Köplinger 56272d7ec1 [acceptance-tests] Bump coreclr and ms-test-suite to bring in some fixes
Also disable a test that makes no sense.
2016-03-12 01:12:12 +01:00
monojenkins d6c0ebf313 Merge pull request #2752 from kumpera/the_loader_error_highlander
This removed the last source of loader error from the runtime

The last source was on the AOT compiler in load_image.

I hooked enough MonoError to bubble the issue to a reasonably higher layer.

@vargaz please review.
2016-03-11 23:05:20 +00:00
Markus Beth c18c66ed64 fixed more srtncpy bugs 2016-03-11 22:52:34 +01:00
Rodrigo Kumpera d4404d563b Merge pull request #2740 from lambdageek/dev/monoerror-reflection-icalls1
[reflection] MonoError for a few icalls
2016-03-11 16:25:06 -05:00
Rodrigo Kumpera 389a34059a Merge pull request #2739 from lambdageek/dev/monoerror-type_load_class
[MonoError] Use class name for mono_error_set_type_load_class() exceptions
2016-03-11 16:06:25 -05:00
Rodrigo Kumpera 0579cc7b3c [aot] Load errors in mono_aot_get_method_from_vt_slot must not be fatal as failed slots will simply use the JIT. 2016-03-11 15:19:29 -05:00
Ankit Jain b9dd48c9c4 [xbuild] Remove ErrorTest.TestExecute1()
This was an incorrect test. Tasks can't really be used like this
especially this once since it tries to Log an error, but it hasn't been
assigned a BuildEngine yet!

Other fixes in TaskLoggingHelper expose this issue.
2016-03-11 14:48:33 -05:00
Andi McClure 0404254a15 "disable_omit_fp" can now be included in MONO_DEBUG
Option disables a compiler optimization that omits framepointers from the stack.
2016-03-11 14:30:49 -05:00
monojenkins 4fb6b12257 Merge pull request #2751 from akoeplinger/fix-msbuild-remapping
Fix msbuild remapping

First commit:
```
Revert "Do not remap framework assembly if it's version is higher than the runtime version"

It would cause issues on mobile, cause the runtime version is 2.0.5.0 there and loading
e.g. System.dll v4.0 would no longer be mapped to that version anymore after this change.
```
---
Second commit:
```
[runtime] Stop remapping higher versions of
 Microsoft.Build.Framework/Engine and remap Microsoft.Build.Utilities/Tasks
 (.v3.5)

The previous remapping was added in 725ed3f824, but it didn't actually
fix the bug in https://bugzilla.xamarin.com/show_bug.cgi?id=32561.

The underlying cause of the bug is that in Mono 4.0 we removed the 2.0/3.5 profiles.
This meant that Microsoft.Build.Utilities.dll and Microsoft.Build.Utilities.v3.5.dll weren't installed
in the GAC anymore, because MSBuild 4.0 uses Microsoft.Build.Utilities.v4.0.dll, so the app failed
to load the 2.0 version of the assembly. The same applies for the .Tasks variants.

We remap earlier versions of the Microsoft.Build.Utilities/Tasks assemblies to the v4.0 version.
I've introduced another item in the AssemblyVersionMap struct which allows remapping to target a different
assembly name, because MSBuild made the questionable decision to put the version number in the assembly name.
While strictly speaking this is not what .NET is doing (it just fails there if .NET 2.0 isn't installed)
on Mono there's no way to install those older profiles anymore, so we remap them to v4.0 to keep apps working.

Newer versions of Microsoft.Build.Framework/Engine (like 12.0, 14.0) however have the same name, so we need to be
more careful here and only do a remapping to the 4.0 version if it's an earlier version (e.g. 2.0 -> 4.0).
This avoids issues with accidentally remapping 14.0 -> 4.0.

I tested the app from the bug report and it now works fine.
```
2016-03-11 15:45:21 +00:00
Alexander Köplinger 5d4ab58d38 [runtime] Stop remapping higher versions of Microsoft.Build.Framework/Engine and remap Microsoft.Build.Utilities/Tasks (.v3.5)
The previous remapping was added in 725ed3f824, but it didn't actually
fix the bug in https://bugzilla.xamarin.com/show_bug.cgi?id=32561.

The underlying cause of the bug is that in Mono 4.0 we removed the 2.0/3.5 profiles.
This meant that Microsoft.Build.Utilities.dll and Microsoft.Build.Utilities.v3.5.dll weren't installed
in the GAC anymore, because MSBuild 4.0 uses Microsoft.Build.Utilities.v4.0.dll, so the app failed
to load the 2.0 version of the assembly. The same applies for the .Tasks variants.

We remap earlier versions of the Microsoft.Build.Utilities/Tasks assemblies to the v4.0 version.
I've introduced another item in the AssemblyVersionMap struct which allows remapping to target a different
assembly name, because MSBuild made the questionable decision to put the version number in the assembly name.
While strictly speaking this is not what .NET is doing (it just fails there if .NET 2.0 isn't installed)
on Mono there's no way to install those older profiles anymore, so we remap them to v4.0 to keep apps working.

Newer versions of Microsoft.Build.Framework/Engine (like 12.0, 14.0) however have the same name, so we need to be
more careful here and only do a remapping to the 4.0 version if it's an earlier version (e.g. 2.0 -> 4.0).
This avoids issues with accidentally remapping 14.0 -> 4.0.

I tested the app from the bug report and it now works fine.
2016-03-11 15:03:18 +01:00
Markus Beth eca635aa31 fixed replacement of $mono_libdir in config file
strncpy does not terminate the destination string in this case so one
cannot use strcat to append
2016-03-11 01:47:19 +01:00
Alexander Köplinger 4ceb8b72fe [System] Bump CTS timeout in BlockingCollectionTests
Saw a few failures on Jenkins on the slower ARM machines over the last days:

```
) MonoTests.System.Collections.Concurrent.BlockingCollectionTests.AddAnyCancellable : System.OperationCanceledException : The operation was canceled.
at System.Collections.Concurrent.BlockingCollection`1[T].TryAddToAnyCore (System.Collections.Concurrent.BlockingCollection`1[] collections, System.Collections.Concurrent.T item, Int32 millisecondsTimeout, CancellationToken externalCancellationToken) [0x00092] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/external/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs:1041
at System.Collections.Concurrent.BlockingCollection`1[T].TryAddToAny (System.Collections.Concurrent.BlockingCollection`1[] collections, System.Collections.Concurrent.T item, Int32 millisecondsTimeout, CancellationToken cancellationToken) [0x00006] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/external/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs:971
at System.Collections.Concurrent.BlockingCollection`1[T].AddToAny (System.Collections.Concurrent.BlockingCollection`1[] collections, System.Collections.Concurrent.T item, CancellationToken cancellationToken) <0x4421bf18 + 0x0002b> in <filename unknown>:0
at MonoTests.System.Collections.Concurrent.BlockingCollectionTests.AddAnyCancellable () [0x00031] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/System/Test/System.Collections.Concurrent/BlockingCollectionTests.cs:276
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0003d] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs:103
```

100ms is likely just too short, bumping it.
2016-03-11 00:39:56 +01:00
monojenkins 5a9dfc17d9 Merge pull request #2749 from BrzVlad/fix-suspend-deadlock
[runtime] Fix deadlock while unwinding the stack of suspended thread

A suspended thread, in non-coop case, can be holding runtime locks. When the suspender tries to unwind the stack for this thread, it might require taking of runtime locks (ex. in aot case we might search for the jit info in the aot image and then register it, which requires the domain lock). Mark the suspender thread as running in async context while it unwinds other threads.
2016-03-10 23:20:19 +00:00
Andi McClure 609e1617d8 Runtime enable for checked-build asserts
In addition to --enable-checked-build, it is now mandatory to put the
requested checked-build modes in the environment variable
MONO_CHECK_MODE at runtime.

Also add a MONO_CHECK_THREAD_TRANSITION_HISTORY environement variable
for thread transition history length (instead of hardcoding 3).
2016-03-10 17:42:06 -05:00
Andi McClure 7dea485a01 Replace the checked build configure flags with a single --enable-checked-build= flag
Also make the define names more consistent.
2016-03-10 17:39:57 -05:00
Rodrigo Kumpera 9542c16f35 [aot] Add MonoError to decode_method_ref. 2016-03-10 16:46:56 -05:00
Rodrigo Kumpera 4b8dec6bc7 [aot] Add MonoError to decode_method_ref_with_target. 2016-03-10 16:46:55 -05:00
Rodrigo Kumpera 6f5175d160 [aot] Introduce MonoError in decode_resolve_method_ref. 2016-03-10 16:46:50 -05:00
Alexander Köplinger de1c6b843a Revert "Do not remap framework assembly if it's version is higher than the runtime version"
This reverts commit 100bd760a4.

It would cause issues on mobile, cause the runtime version is 2.0.5.0 there and loading e.g. System.dll v4.0 would
no longer be mapped to that version anymore after this change.
2016-03-10 22:22:55 +01:00
Rodrigo Kumpera 8300c685ee [aot] Introduce MonoError in decode_generic_context. 2016-03-10 15:49:09 -05:00
Rodrigo Kumpera 8014f30b8b [aot] Add MonoError to load_image. 2016-03-10 15:49:09 -05:00
Rodrigo Kumpera 6365e34cd1 [aot] Wire up MonoError into decode_klass_ref, decode_type and decode_generic_inst. 2016-03-10 15:49:09 -05:00
Alexander Köplinger 1180491691 [runtime] Fix monodroid build 2016-03-10 19:44:02 +01:00
Marek Safar 4e86d2771d Merge pull request #2744 from akoeplinger/convert-fixes
[corlib] Fix Convert.ToUInt32 not throwing OverflowException with a too large number
2016-03-10 18:43:04 +01:00
Marek Safar faa1368df4 [mcs] Codegen update for specialized struct initialization with awaited element initializer. Fixes #39459 2016-03-10 18:04:35 +01:00
Aleksey Kliger 9a6211315c [runtime] Add MonoError to mono_remote_class 2016-03-10 11:52:17 -05:00
Alexander Köplinger 4e01ac5771 [tests] Add test for assembly remapping change from 100bd760a4
Testing for the remap message via grep isn't ideal, a better way to verify the assembly
version would be to check asm.GetName().Version, but unfortunately in the test environment
when MONO_PATH is set the assembly loading always fallsback to a simple file name matching
in the directory so we end up with the wrong (v4.0) assembly in that case.
2016-03-10 16:38:01 +01:00
Alexander Köplinger c1c0bc7b5c Merge pull request #2733 from ludovic-henry/fix-mono_cpu_count
[utils] Make distinction between configured and online CPU count
2016-03-10 16:02:40 +01:00
Zoltan Varga 40caace6db [jit] Add a separate header file for llvm-jit.cpp. 2016-03-10 15:45:37 +01:00
Alexander Köplinger d1a08e5957 [corlib] Fix Convert.ToUInt32 not throwing OverflowException with a too large number
This was revealed by the CoreCLR tests/src/CoreMangLib/cti/system/convert/converttouint3219.exe test.

When we tried to convert a number larger than UInt32.MaxValue (in this case 4933891728) we would cast
the intermediate result to uint which overflows and makes the end result smaller which means we don't throw.

Storing the intermediate result in a long before checking for the correct range fixes this.

Added a few additional tests that I felt were missing and/or only present for other Convert.* methods.
I found two more cases that don't throw OverflowException but fixing it looked more involved so I punted
and just ignored them with a FIXME for now.
2016-03-10 13:19:00 +01:00
Ludovic Henry 2debfb8803 [utils] Make distinction between ARM platforms for CPU count
ARM platform tends to try very hard to save power by switching off CPUs. This could lead to inconsistencies in the value returned by mono_cpu_count

Recap from Alexander Köplinger <[email protected]>:

When we merged the change from PR #2722, we started seeing random failures on ARM in the MonoTests.System.Threading.ThreadPoolTests.SetAndGetMaxThreads and MonoTests.System.Threading.ManualResetEventSlimTests.Constructor_Defaults tests. Both of those tests are dealing with Environment.ProcessorCount to verify some implementation details.

It turns out that on the Jetson TK1 board we use on public Jenkins and on ARM kernels in general, the value returned by sched_getaffinity (or _SC_NPROCESSORS_ONLN) doesn't contain CPUs/cores that are powered off for power saving reasons. This is contrary to what happens on x86, where even cores in deep-sleep state are returned [1], [2]. This means that we would get a processor count of 1 at one point in time and a higher value when load increases later on as the system wakes CPUs.

Various runtime pieces like the threadpool and also user code however relies on the value returned by Environment.ProcessorCount e.g. for deciding how many parallel tasks to start, thereby limiting the performance when that code thinks we only have one CPU.

Talking to a few people, this was the reason why we changed to _SC_NPROCESSORS_CONF in https://github.com/mono/mono/pull/1688 and why we added a special case for Android in https://github.com/mono/mono/commit/de3addcde5bf875dcd43d3e2c6536d61871e7675 to get the "real" number of processors in the system.

Because of those issues Android/Dalvik also switched from _ONLN to _SC_NPROCESSORS_CONF for the Java API Runtime.availableProcessors() too [3], citing:
> Traditionally this returned the number currently online,
but many mobile devices are able to take unused cores offline to
save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of
cores that could be made available if there were no power or heat
constraints.

The problem with sticking to _SC_NPROCESSORS_CONF however is that it breaks down in constrained environments like Docker or with an explicit CPU affinity set by the Linux `taskset` command, They'd get a higher CPU count than can be used, start more threads etc. which results in unnecessary context switches and overloaded systems. That's why we need to respect sched_getaffinity.

So while in an ideal world we would be able to rely on sched_getaffinity/_SC_NPROCESSORS_ONLN to return the number of theoretically available CPUs regardless of power saving measures everywhere, we can't do this on ARM.

I think the pragmatic solution is the following:
* use sched_getaffinity (+ fallback to _SC_NPROCESSORS_ONLN in case of error) on x86. This ensures we're inline with what OpenJDK [4] and CoreCLR [5] do
* use _SC_NPROCESSORS_CONF exclusively on ARM (I think we could eventually even get rid of the PLATFORM_ANDROID special case)

Thoughts?

Helpful links:

[1] https://sourceware.org/ml/libc-alpha/2013-07/msg00383.html
[2] https://lists.01.org/pipermail/powertop/2012-September/000433.html
[3] https://android.googlesource.com/platform/libcore/+/750dc634e56c58d1d04f6a138734ac2b772900b5%5E1..750dc634e56c58d1d04f6a138734ac2b772900b5/
[4] https://bugs.openjdk.java.net/browse/JDK-6515172
[5] https://github.com/dotnet/coreclr/blob/7058273693db2555f127ce16e6b0c5b40fb04867/src/pal/src/misc/sysinfo.cpp#L148
2016-03-10 10:46:25 +00:00
Ludovic Henry 2323f293c5 [build] Define HOST_* architecture 2016-03-10 10:46:25 +00:00
monojenkins 2ed84027d9 Merge pull request #2732 from radical/asm_remap
Do not remap framework assembly if it's version is higher than the ru…

…ntime version

Currently, assemblies like Microsoft.Build.Framework and
Microsoft.Build.Engine get remapped to the current runtime version, at
load time. This means that if an assembly references the above
assemblies with a version like `14.1.0.0`, then that would get remapped
to `4.0.0.0`. This is incorrect behavior and breaks msbuild. Instead,
now we do the remapping only if the requested version is lower than the
runtime version.
2016-03-10 04:00:18 +00:00
Alexander Köplinger 3df1a68186 Merge pull request #2741 from akoeplinger/acceptance-tests-split
A few improvements to acceptance-tests
2016-03-09 23:42:27 +01:00
Marek Safar 4ddd0aff0f Merge pull request #2743 from qmfrederik/fixes/complete-eventsource-3
System.Diagnostics.Tracing: Add EventListener and related classes
2016-03-09 23:26:15 +01:00
Marek Safar d59a6e1931 [xbuild] Remove explicit warning level set when csproj does not have it and leave the default to compiler 2016-03-09 23:17:49 +01:00
Vlad Brezae ee8a9b3f6c [runtime] Fix deadlock while unwinding the stack of suspended thread
A suspended thread, in non-coop case, can be holding runtime locks. When the suspender tries to unwind the stack for this thread, it might require taking of runtime locks (ex. in aot case we might search for the jit info in the aot image and then register it, which requires the domain lock). Mark the suspender thread as running in async context while it unwinds other threads.
2016-03-09 23:34:28 +02:00
Ankit Jain 100bd760a4 Do not remap framework assembly if it's version is higher than the runtime version
Currently, assemblies like Microsoft.Build.Framework and
Microsoft.Build.Engine get remapped to the current runtime version, at
load time. This means that if an assembly references the above
assemblies with a version like `14.1.0.0`, then that would get remapped
to `4.0.0.0`. This is incorrect behavior and breaks msbuild. Instead,
now we do the remapping only if the requested version is lower than the
runtime version.

@akoplinger: This will actually impact xbuild too right now because
we're defaulting to xbuild 14.0 in Mono 4.4 now so we'd see messages
like Mono: The request to load the assembly Microsoft.Build.Framework
v14.0.0.0 was remapped to v4.0.0.0 in the assembly loading log, which
will break in very subtle ways.
2016-03-09 15:37:12 -05:00
Marek Safar 400fd94984 Bump ikdasm 2016-03-09 19:27:16 +01:00
Frederik Carlier 778dc786bf System.Diagnostics.Tracing: Add EventListener and related classes 2016-03-09 19:11:24 +01:00
Marek Safar d211287c27 Merge pull request #2742 from mono/revert-2738-fixes/complete-eventsource-2
Revert "Add EventListener and EventListenerEventArgs to Mono"
2016-03-09 18:58:29 +01:00
Marek Safar b2390a28ca Revert "Add EventListener and EventListenerEventArgs to Mono" 2016-03-09 18:58:13 +01:00
Alexander Köplinger 2be1eed169 [acceptance-tests] Better description in readme 2016-03-09 18:50:42 +01:00
Marek Safar ef92155bfa Merge pull request #2738 from qmfrederik/fixes/complete-eventsource-2
Add EventListener and EventListenerEventArgs to Mono
2016-03-09 18:47:33 +01:00
Alexander Köplinger e9ab609729 [acceptance-tests] Stop symlinking System.Console.dll facade
It should no longer be required after 6e81edfa24.
2016-03-09 18:34:05 +01:00
Alexander Köplinger b827d683c6 [acceptance-tests] Split the test suites out of Makefile.am into own files 2016-03-09 18:34:05 +01:00
Marek Safar 6970156500 [mcs] nameof operator can use static member. Fixes #39455 2016-03-09 17:59:30 +01:00
Aleksey Kliger 9e638a8013 [reflection] Use MonoError in mono_reflection_get_token
Mark it external only.  Runtime should use mono_reflection_get_token_checked.
2016-03-09 11:10:33 -05:00
Aleksey Kliger bfd3705c80 [reflection] Add MonoError-ized mono_reflection_get_type_checked
Mark mono_reflection_get_type external only.
2016-03-09 11:10:32 -05:00
Neale Ferguson 76ce319312 Fix typos 2016-03-09 11:06:33 -05:00
Aleksey Kliger d9a026be4b [MonoError] Use class name for mono_error_set_type_load_class() exceptions
If MONO_ERROR_TYPE_LOAD is set and there's a error->exn.klass available,
try to grab the type name from the klass when preparing an exception.
2016-03-09 11:02:12 -05:00
Zoltan Varga 7084863662 [llvm] Add beginnings of JIT support for LLVM > 3.9. 2016-03-09 16:58:59 +01:00
Alexander Köplinger 4063befe57 [acceptance-tests] Move git "submodules" to acceptance-tests/external instead of next to Mono repo
A few people told me it's surprising that acceptance-tests checks out repos into <mono repo>/../
and it can cause unwanted changes when a repo with the same name already exists there.

While this structure is used in several internal repos I agree for Mono it's better to keep
everything inside the repo itself.
2016-03-09 16:54:09 +01:00
Aleksey Kliger 89513382d9 [reflection] MonoError in mono_method_body_get_object
Mark it external only.  Runtime should use mono_method_body_get_object_checked
2016-03-09 10:49:47 -05:00
Zoltan Varga 5a33ae7c7f [aot] Fix a buffer overflow in the statistics code. 2016-03-09 16:22:46 +01:00
Zoltan Varga cb87c8585f [runtime] Remove some unused code. 2016-03-09 14:28:36 +01:00
Frederik Carlier e5c8431849 Remove #if NET_4_6
Remove conditional compilation statement as per PR feedback
2016-03-09 09:05:38 +01:00
monojenkins 4dd277660f Merge pull request #2736 from xmcclure/more-trampolines
Increase default number of aot-compile trampolines

The current defaults are not enough to successfully run
`make fullaotcheck` in mono/mini
2016-03-09 05:20:19 +00:00
monojenkins 73cda12003 Merge pull request #2735 from xmcclure/early-lookup-addr
Early ICALL_ADDR lookup on pinvoke to fix checked-build assert

The pinvoke implementation in the failure case was creating a managed
exception object while in blocking mode, a rules violation. This patch
puts a redundant lookup early so that any exceptions occur before
blocking mode is entered. (The "real" lookup is unchanged because the
current pattern is optimized well by the JIT.)
2016-03-09 03:55:27 +00:00
monojenkins 9e4c2757e7 Merge pull request #2731 from Phyyl/master
Remove throw statement in IPAddress.TryParse

In Microsoft's implementation, no exceptions are thrown in this particular method. See here for details: http://referencesource.microsoft.com/#System/net/System/Net/IPAddress.cs,54a3a3f536d5a22c
2016-03-09 00:00:42 +00:00
monojenkins 257af4ff16 Merge pull request #2674 from lambdageek/dev/monoerror-mono_field_get_value_object
Use MonoError for mono_field_get_value_object

Mark it external only.  Runtime should use mono_field_get_value_object_checked.
2016-03-08 22:20:43 +00:00
Andi McClure d230022eeb Increase default number of aot-compile trampolines
The current defaults are not enough to successfully run
`make fullaotcheck` in mono/mini
2016-03-08 17:14:26 -05:00
monojenkins 4c0fe9aa74 Merge pull request #2718 from lambdageek/dev/monoerror-sre
[System.Reflection.Emit] Use MonoError in static functions
2016-03-08 21:50:33 +00:00
Andi McClure 98dbaf2bde Fix an assert in checked-build GC mode
The pinvoke implementation in the failure case was creating a managed
exception object while in blocking mode, a rules violation. This patch
puts a redundant lookup early so that any exceptions occur before
blocking mode is entered. (The "real" lookup is unchanged because the
current pattern is optimized well by the JIT.)
2016-03-08 16:44:49 -05:00
Zoltan Varga b2bf28d071 [runtime] Fix the support for coop in managed-native wrappers by finishing blocking inside the try clause before converting the result, and only unblocking in the finally clause if we didn't unblock in the try clause. 2016-03-08 21:52:46 +01:00
Neale Ferguson 746971d090 Fix whitespace 2016-03-08 15:07:08 -05:00
Neale Ferguson 1ca9141f91 Correct entry point names 2016-03-08 15:04:28 -05:00
Neale Ferguson 76fe267817 Improve trace logging -
- Add logfile and syslog capability. For Windows, the latter is simulated by writing to a file. Adding Eventlog support is for a future effort. The choice of logging mode is made via MONO_LOG_DEST environment variable.
- Add timestamps and pid to the trace messages to make them more useful
- Add timestamps to SGEN_LOG
- Related to tracing: when tracing and using something like Valgrind the system may be slowed so much that the sleep abort limit may be exceeded for threads. This fix adds an environment variable lookup of "MONO_SLEEP_ABORT_LIMIT" which is a value greater than 40, which defines the number of milliseconds to wait for threads to complete pending operations. If not set, the valus is 200.
2016-03-08 14:54:11 -05:00
Phyyl bbe084366d Added null check in IPAddress.Parse
This check was previously handled in the IPAddress.TryParse method but, but the latter never throws anymore
2016-03-08 14:05:39 -05:00
Frederik Carlier 62c49f89ad Merge branch 'master' 2016-03-08 19:41:40 +01:00
Aleksey Kliger 9efee8e99a [SRE] MonoError in mono_image_emit_manifest 2016-03-08 11:42:21 -05:00
Aleksey Kliger acfca794f0 [SRE] MonoError in mono_image_fill_export_table 2016-03-08 11:42:20 -05:00
Aleksey Kliger 717d279795 [SRE] MonoError in mono_image_get_array_token 2016-03-08 11:42:20 -05:00
Aleksey Kliger c8f5294f27 [SRE] MonoError in mono_image_get_sighelper_token 2016-03-08 11:42:19 -05:00
Aleksey Kliger b81d94dfaa [SRE] MonoError in mono_image_get_generic_field_token 2016-03-08 11:42:19 -05:00
Aleksey Kliger 41b56ac777 [SRE] MonoError in add_custom_modifiers 2016-03-08 11:42:18 -05:00
Aleksey Kliger 96a188d034 [SRE] MonoError in create_generic_typespec 2016-03-08 11:42:17 -05:00
Aleksey Kliger 86cf9e9c72 [SRE] MonoError in mono_image_get_field_on_inst_token 2016-03-08 11:42:17 -05:00
Aleksey Kliger 098597398c [SRE] MonoError in encode_constraints 2016-03-08 11:42:16 -05:00
Aleksey Kliger 984a6f79aa [SRE] MonoError in mono_image_get_event_info 2016-03-08 11:42:16 -05:00
Aleksey Kliger e74bcb89a3 [SRE] MonoError in property_encode_signature 2016-03-08 11:42:15 -05:00
Aleksey Kliger 36040a8ad9 [SRE] MonoError in mono_image_get_field_info 2016-03-08 11:42:15 -05:00
Aleksey Kliger f8de085f98 [SRE] MonoError in encode_marshal_blob 2016-03-08 11:42:14 -05:00
Aleksey Kliger d0f8acdeea [SRE] MonoError in field_encode_signature 2016-03-08 11:42:14 -05:00
Aleksey Kliger 6052e07353 [SRE] MonoError in method_encode_clauses 2016-03-08 11:42:13 -05:00
Aleksey Kliger 5a74ca218e [SRE] MonoError in encode_locals 2016-03-08 11:42:13 -05:00
Aleksey Kliger b6566d0d34 [SRE] MonoError in encode_reflection_type and encode_custom_modifiers 2016-03-08 11:42:12 -05:00
monojenkins 5a35123636 Merge pull request #2706 from ludovic-henry/fix-unhandledexception
[runtime] Set exit code on unhandled exception even if a managed handler is present

In case we would add a AppDomain.CurrentDomain.UnhandledException callback, we would not exit the VM in case of unhandled exception.
This goes against the expected behaviour, as we should indeed call these managed callbacks in all cases, but they should not stop the VM from exiting.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=39077
2016-03-08 16:25:25 +00:00
monojenkins c911cceab0 Merge pull request #2634 from ludovic-henry/coop-fix-managed-to-native
[coop] Fix managed-to-native wrapper
2016-03-08 16:25:20 +00:00
Aleksey Kliger 74237c9988 [runtime] Use MonoError in mono_field_get_value_object
Mark it external only.  Runtime should use mono_field_get_value_object_checked.
2016-03-08 11:03:22 -05:00
Jonathan Mitchell 1e843e0607 Embedded API. Fix method signature match failure for generic types with multiple type parameters.
Details are on the list.
http://mono.1490590.n4.nabble.com/Re-Embedded-API-ctor-method-signature-query-mono-td4667551.html

Robert Jordan said:

It looks like a bug in mono_method_desc_new ():

https://github.com/mono/mono/blob/master/mono/metadata/debug-helpers.c#L378

The function is treating

	.ctor(System.Func`2<string, string>)

like a method with 2 arguments:

	arg0 = System.Func`2<string
	arg1 = string>

This is obviously wrong :)

The function is then storing the (wrong) argument count
for optimization purposes, and the comparison of methods
is starting to fail.
2016-03-08 17:02:07 +01:00
monojenkins 65b4aaf118 Merge pull request #2707 from lambdageek/dev/monoerror-mono_image_load_module_dynamic
[sre] Propagate MonoError in mono_image_load_module_dynamic
2016-03-08 15:10:37 +00:00
Philippe Paré 3e1d158dbf Updated TryParse_IpString_Null for IPAddress tests
Now reflects the new behaviour in IPAddress class, not throwing any exceptions in the TryParse method
2016-03-08 09:20:03 -05:00
Philippe Paré 706046434e Remove throw statement in IPAddress.TryParse
In Microsoft's implementation, no exceptions are thrown in this particular method. See here for details: http://referencesource.microsoft.com/#System/net/System/Net/IPAddress.cs,54a3a3f536d5a22c
2016-03-08 08:18:33 -05:00
Marek Safar f9df298156 [mcs] Fixes codegen for lifted null bitwise operators with constant left side of null value 2016-03-08 13:41:14 +01:00
Ludovic Henry d6afa9b8c1 [tests] Add unhandled exception tests with AppDomain.UnhandledException managed handler 2016-03-08 11:32:18 +00:00
Ludovic Henry b7d32e7e24 [runtime] Set exit code on unhandled exception even if a managed handler is present
In case we would add a AppDomain.CurrentDomain.UnhandledException callback, we would not exit the VM in case of unhandled exception.
This goes against the expected behaviour, as we should indeed call these managed callbacks in all cases, but they should not stop the VM from exiting.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=39077
2016-03-08 11:32:18 +00:00
monojenkins eaa4d8c440 Merge pull request #2708 from lambdageek/dev/monoerror-assorted-get_type
[reflection] MonoError for mono_reflection_{get_type_with_rootimage,type_from_name}
2016-03-08 11:25:24 +00:00
monojenkins 82041260ed Merge pull request #2668 from lambdageek/dev/monoerror-mono_security
[runtime] MonoError cleanup in mono-security.c

Some easy MonoError cleanup in mono-security.c: use set_pending_exception, don't raise in helper functions, free memory on errors.
2016-03-08 11:20:58 +00:00
monojenkins 9f6dc46ae3 Merge pull request #2670 from lambdageek/dev/monoerror-mono_runtime_object_init
[runtime] Use MonoError in mono_runtime_object_init

Mark mono_runtime_object_init checked external only.  Runtime should use mono_runtime_object_init_checked.
2016-03-08 11:20:52 +00:00
monojenkins 4ef4438ad9 Merge pull request #2687 from lambdageek/dev/monoerror-mono_param_get_objects_internal
[reflection] Use MonoError in mono_param_get_objects
2016-03-08 11:20:46 +00:00
Ludovic Henry 50b6d6f8cd [runtime] Wrap mono_prepare_blocking and mono_finish_blocking in try { ... } finally { ... } clause
This is to guarantee that even in the case an exception is thrown between both calls, we switch back and forth correctly from RUNNING to BLOCKING state.
2016-03-08 10:54:17 +00:00
Zoltan Varga cb23d8edde [runtime] Fix the emission of CEE_MONO_VTADDR opcodes, they need to be emitted right after native calls. 2016-03-08 10:54:16 +00:00
Zoltan Varga 9665e4dd6e [jit] Add a new ICALL_ADDR_CALL patch type which is only used on calls, since ICALL_ADDR might be used without a call. 2016-03-08 06:27:43 +01:00
Marek Safar 15082972b9 [mcs] Null conditional operator is never suppose to work with await according to current C# standard. Fixes #39266 2016-03-07 21:02:55 +01:00
Aleksey Kliger 622c172b26 [reflection] Fix mono_reflection_type_get_handle when
DISABLE_REFLECTION_EMIT is set

Fixup of 20a111a215
2016-03-07 14:05:32 -05:00
Marek Safar 62ecbc7d9c [mcs] Remove test as it cannot reliably depend on process shutdown 2016-03-07 19:50:57 +01:00
Greg Young 123aaa5db0 handles AwaitAsync finishing synchronously
A connect flood will break the async loop and take down the entire HttpListener instance (will stop accepting connections).

To reproduce. Take a HttpListener run say 2 wrk test instances against it (1000 connections each works here). After the run the HttpListener has broken its async loop and will no longer accept any connections after. The reason for this is that it was not previously handling the case that AcceptAsync can return synchronously. In this case event will not be called with args.

Patch handles this case and the above issue is not reproducible with.
2016-03-07 15:24:01 +02:00
monojenkins b129b29d4d Merge pull request #2727 from akoeplinger/fix-system-testports
[System] Fix more hardcoded test ports

A test failed on Jenkins today with "address already in use".
Opportunistically replaced a few more hardcoded test ports to avoid failures in the future.

@monojenkins merge
2016-03-05 16:10:17 +00:00
Alexander Köplinger 1492386668 [System/ServiceModel] Fix more hardcoded test ports
A test failed on Jenkins today with "address already in use".
Opportunistically replaced a few more hardcoded test ports to avoid failures in the future.
2016-03-05 15:50:28 +01:00
Marek Safar 17bd978756 [mcs] All returns with values from async block with finally need to be captured. Fixes #39153 2016-03-05 11:31:11 +01:00
Alexander Köplinger 52c79e1fe2 [corlib] Enable the shim __ComObject for other profiles than mobile_static too
Otherwise they crash in a similar way during verification tests.
2016-03-05 00:21:19 +01:00
Alexander Köplinger 202806306b [System] Switch DNS tests to a more stable domain/IP
info.diku.dk stopped resolving today. Use Google's public DNS server instead which should be much more stable.
2016-03-05 00:09:13 +01:00
Alexander Köplinger ee0bec4d89 [runtime] Compile arch before utils when INSTALL_MONOTOUCH is enabled
We'd run into an error before:

```
In file included from ../../mono/utils/mono-context.h:234:0,
                 from ../../mono/utils/mono-stack-unwinding.h:10,
                 from ../../mono/utils/mono-threads.h:14,
                 from mono-mmap.c:36:
../../mono/arch/arm/arm-codegen.h:936:41: fatal error: mono/arch/arm/arm_dpimacros.h: No such file or directory
```

This was done for the other cases in 637ee7cbaa, but not when the monotouch
special case was added in cf754cdb63.
2016-03-04 23:06:13 +01:00
monojenkins 7c7729117b Merge pull request #2714 from lambdageek/dev/monoerror-mono_reflection_type_get_handle
[reflection] MonoError for mono_reflection_type_get_handle

`mono_reflection_type_get_handle` is really a kind of normalization procedure that synthesizes real `MonoType`s from reflection's derived types such as `System.Reflection.Emit.ArrayType, ByRefType`, etc.  So we call it all over the place in System.Reflection.Emit runtime code.

That would all be fine, except that users are allowed to subclass `System.Type`, so we have to call the `UnderlyingSystemType()` method to get a real type.  Which means that an override can throw.  Which in coop mode means we have to thread around a `MonoError`.  So that's why this code is uglier.

But really this code is doing a lot of type inspection and high-level work that we should figure out how to migrate to managed.
2016-03-04 22:00:19 +00:00
Alexander Köplinger bed9bc56d8 [bcl] Ensure all .sources files have newline at the end
It causes an issue with gensources.sh when using #include on Linux otherwise.
2016-03-04 21:48:09 +01:00
Aleksey Kliger 20a111a215 [reflection] MonoError for mono_reflection_type_get_handle 2016-03-04 15:09:37 -05:00
Rodrigo Kumpera 7a94cbe3d4 Merge pull request #2704 from BrzVlad/fix-monitor-abort
[runtime] Fix monitor abort
2016-03-04 14:49:33 -05:00
Alexander Köplinger bfe239ca60 Fix filename casing in mobile_System.Data.dll.sources
It broke on Linux.
2016-03-04 20:35:19 +01:00
iain holmes e1dcf63505 [Profiler] Keep a reference to assemblies while coverage is running
In certain circumstances, for example when running under nunit-console, assemblies could be unloaded while the profiler still had a reference to them in order to generate the coverage data. In these cases, the memory referred to by the profiler would be invalid and would crash.

Fix this by incrementing the reference count of the assemblies preventing them from being unloaded while coverage is being collected.

Fixes BXC #39325
2016-03-04 18:54:53 +00:00
monojenkins 1dca08f943 Merge pull request #2722 from ludovic-henry/fix-39279-docker-cpu-count
[utils] Get processor count from scheduler affinity if available

In case the user has set a scheduler CPU affinity, we should use it as the number of available CPU for the runtime. This is particularly important on docket which uses cgroups that set the container a cpu affinity, and by not using that, the runtime report the total number of CPU the machine has, and not the number of CPU the container has.

Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=39279
2016-03-04 18:00:30 +00:00
monojenkins 4428d53812 Merge pull request #2700 from akoeplinger/monotouch-mobile-static
Enable building of monotouch/xammac profiles without mono-extensions and expose mobile_static in configure.ac

Relies on https://github.com/xamarin/mono-extensions/pull/17

This enables us to compile the monotouch, xammac and mobile_static profiles on public Jenkins without mono-extensions.
2016-03-04 17:20:16 +00:00
monojenkins cec2e9ac7e Merge pull request #2723 from akoeplinger/fix-decimal-test-culture
[corlib] Fix three decimal tests to not rely on current culture for formatting

They'd fail on cultures where "." is not the decimal separator before.

I've also reenabled them on mobile cause the workaround for #27269 is no longer necessary since all bots are now on Mono 4.0+.

@monojenkins merge
2016-03-04 16:30:31 +00:00
Rodrigo Kumpera 45c2792569 Merge pull request #2719 from kumpera/aot_cctor_encoding_in_method_info
[runtime] Explicitly encode the need of running a cctor on method infos.
2016-03-04 11:18:05 -05:00
Alexander Köplinger ec700aafb2 Add a shim __ComObject class to the mobile_static build
We need this because when the runtime is built without --enable-minimal=com the runtime crashes
when trying to AOT because it tries to find the __ComObject (even though nothing in mobile_static
actually uses COM). With this shim we can AOT the mobile_static assemblies even with a "normal"
runtime.
2016-03-04 16:46:27 +01:00
Alexander Köplinger edd133b371 [corlib] Fix three decimal tests to not rely on current culture for formatting
They'd fail on cultures where "." is not the decimal separator before.

I've also reenabled them on mobile cause the workaround for #27269 is no longer necessary since all bots are now on Mono 4.0+.
2016-03-04 15:53:25 +01:00
Marek Safar 24fb876247 [corlib] Fixes build to using correct build profile dependency 2016-03-04 15:37:44 +01:00
Ludovic Henry 6a635a42ce [utils] Get processor count from scheduler affinity if available
In case the user has set a scheduler CPU affinity, we should use it as the number of available CPU for the runtime. This is particularly important on docket which uses cgroups that set the container a cpu affinity, and by not using that, the runtime report the total number of CPU the machine has, and not the number of CPU the container has.

Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=39279
2016-03-04 13:35:29 +00:00
Marek Safar a2a8937393 [tools] Remove unused comment 2016-03-04 13:58:05 +01:00
Marek Safar 7af74e36c2 [lc] Remove Option.cs local copy 2016-03-04 13:44:17 +01:00
Marek Safar ab47527e0f [bcl] Redo referencesource resource string integration to not depend on mcs 2016-03-04 13:44:16 +01:00
Marek Safar c2097068e1 [corlib] Remove duplicate file entry 2016-03-04 13:44:16 +01:00
Rodrigo Kumpera 4d1784ded9 [runtime] Explicitly encode the need of running a cctor on method infos.
This removes the case where decode_klass_ref returning NULL would be ok.
2016-03-03 18:26:10 -05:00
Zoltan Varga e82fc16a1e [aot] Rename init_llvm_method () to init_method () since it is used for all methods, not just llvm ones. 2016-03-03 22:58:53 +01:00
Alexander Köplinger e4936dee55 [acceptance-tests] Work around an issue that caused Roslyn tests to stop working
xplat MSBuild uses a wrong, to be removed regex that doesn't catch our recent profile names. Temporarily work around it for now.
2016-03-03 22:11:43 +01:00
Vlad Brezae 032a79f8a2 Merge pull request #2716 from BrzVlad/fix-tramp-jinfo
[aot] Set null uw_info for tramps without unwind info
2016-03-03 21:56:47 +07:00
Rodrigo Kumpera d5a07c6532 Merge pull request #2268 from kumpera/coreclr-testsuite-fixes-1
First batch of bug fixes found in the CoreClr test suite.
2016-03-03 01:08:01 -05:00
Rodrigo Kumpera 31061124d6 Merge pull request #2710 from akoeplinger/fix-typo
[jit] Fix duplicated left-hand side in comparison
2016-03-02 22:43:50 -05:00
Rodrigo Kumpera d01b3054fd [jit] Fix target_type_is_incompatible to type check byref enums correctly. 2016-03-02 19:05:49 -05:00
monojenkins 42b099c71b Merge pull request #2709 from lewurm/jit-phase-typo
[jit] remove 'jit_' prefix in two phases in stats output

@monojenkins merge
2016-03-02 23:45:34 +00:00
Rodrigo Kumpera af315df3ab Merge pull request #2645 from alexrp/profiler-stability
Fix a crash in the MONO_LLS_FOREACH_SAFE macro
2016-03-02 15:33:07 -05:00
Alexander Köplinger 5fea0a5c0e [jit] Fix duplicated left-hand side in comparison
The typo introduced by 1a784475c0 caused the if to always be false,
because it would compare like if (true == MONO_EXCEPTION_FIELD_ACCESS).
2016-03-02 21:01:27 +01:00
Bernhard Urban 65b5cbcc3b [jit] remove 'jit_' prefix in two phases in stats output 2016-03-02 10:24:44 -08:00
Alex Rønne Petersen b8ebdb1e77 [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.
2016-03-02 17:30:08 +01:00
Alex Rønne Petersen 4d673f2793 [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 56a6ae2bd0.

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.
2016-03-02 17:26:43 +01:00
Alex Rønne Petersen 8a7a253912 [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).
2016-03-02 17:26:42 +01:00
Alex Rønne Petersen 4351feabd9 [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.
2016-03-02 17:26:13 +01:00
Alexander Köplinger 7503fd6749 Merge pull request #2145 from dlech/patch-2
Strip extra null characters in socketAddress
2016-03-02 17:12:08 +01:00
Aleksey Kliger 33de469647 [reflection] Use MonoError in mono_reflection_type_from_name
Mark it external only.  Runtime should use mono_reflection_type_from_name_checked.
2016-03-02 11:11:12 -05:00
Aleksey Kliger 9d92d33c4e [reflection] Use MonoError in mono_reflection_get_type_with_rootimage 2016-03-02 11:11:12 -05:00
Aleksey Kliger 41b2967358 [sre] Propagate MonoError in mono_image_load_module_dynamic 2016-03-02 11:09:59 -05:00
Alexander Köplinger 3e947106f2 Merge pull request #2699 from pruiz/integrate-syswebrouting-master
Completely replace System.Web.Routing with implementation from reference source
2016-03-02 17:02:06 +01:00
Rodrigo Kumpera 595ff89bea [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.
2016-03-02 10:32:09 -05:00
Rodrigo Kumpera cdd1cf1dcc [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.
2016-03-02 10:32:09 -05:00
Rodrigo Kumpera c5a8e92fe7 [jit] Using a literal field with stdsfld/ldsfld should trigger a MissingFieldException. Fixes b13452. 2016-03-02 10:32:08 -05:00
Rodrigo Kumpera 4b6b72f6b8 [runtime] Fail Void arrays with Invalid Program exception instead of a TLE. Fixes b353858. 2016-03-02 10:32:08 -05:00
Rodrigo Kumpera 02146ff903 [mini] ckfinite throws OverflowException and not ArithmeticException. Fixes JIT/Regression/VS-ia64-JIT/M00/b108366. 2016-03-02 10:32:07 -05:00
Rodrigo Kumpera eb91e08f3b [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.
2016-03-02 10:32:01 -05:00
monojenkins 3bd82f9fdf 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
2016-03-02 15:30:51 +00:00
monojenkins 1f34699221 Merge pull request #2696 from lambdageek/dev/unlock-mono_class_create_runtime_vtable
[runtime] Don't raise exception while holding locks
2016-03-02 15:30:41 +00:00
Rodrigo Kumpera 6a122b823c [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.
2016-03-02 10:19:31 -05:00
Rodrigo Kumpera 2bd29b6ea2 [runtime] Null check the pointer argument of Interlocked::Exchange<T>. Fixes exchangetneg. 2016-03-02 10:19:31 -05:00
Alexander Köplinger 736f64940c [msvc] Update .def files to fix Windows build 2016-03-02 15:04:54 +01:00
Ludovic Henry 42ddfea489 [runtime] Use MonoError for mono_get_exception_type_initialization, mono_get_exception_reflection_type_load and mono_get_exception_runtime_wrapped 2016-03-02 13:27:26 +00:00
Vlad Brezae 1bd48e361b [runtime] Obey requests to abort when waiting on monitors
If we are clearing the interruption_requested flag, we also need to throw the corresponding exception, otherwise we miss it.

Fixes #39042
2016-03-02 11:50:04 +02:00
Vlad Brezae b772131cb4 [runtime] Don't return from Monitor.Wait without holding the lock
Even if we are interrupted we must throw the exception only after we have regained the lock. This prevents throwing an SynchronizationLockException in the finally clause of common scenarios like :

lock (obj) {
	Monitor.Wait (obj);
}

The downside of this is that, if another thread doesn't give up the lock, we could fail to abort the thread. But this is what MS does.
2016-03-02 11:50:04 +02:00
Vlad Brezae 636457dac5 [runtime] Remove unreachable code
A monitor enter internal method returns -1 for interrupted, 0 for timed out, 1 for acquired. When doing a monitor wait, we regain the lock using an infinite wait (which can't time out) and retrying in the case of interruption.
2016-03-02 11:50:04 +02:00
Vlad Brezae b9606d0e89 [runtime] Fix LOCK_DEBUG build, for monitor debugging 2016-03-02 11:50:03 +02:00
Vlad Brezae f54b3d4a8b [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
2016-03-02 10:19:01 +02:00
Zoltan Varga 73beb1f50c [runtime] Move some mono_error_raise_exception () calls to icalls from utility functions. NFC. 2016-03-02 03:11:46 +01:00
Zoltan Varga c5f90e0023 [runtime] Rename some icalls to match the icall naming convention. NFC. 2016-03-02 03:11:03 +01:00
Rodrigo Kumpera f8a061ca98 Merge pull request #2705 from kumpera/loader-error-cleanup7
[runtime] Remove the loader error from the remaining of the loader.
2016-03-01 21:07:22 -05:00
Pablo Ruiz d750c58ae9 Replaced System.Web.Routing with referencesources own implementation. 2016-03-02 01:45:29 +01:00
Rodrigo Kumpera 6ef125709b [misc] Multiple small fixes and cleanups. 2016-03-01 18:20:52 -05:00
Rodrigo Kumpera bab7ea252b [utils] Add mono_error_move. 2016-03-01 18:03:04 -05:00
Rodrigo Kumpera f7a72826ee [runtime] Ban mono_method_get_header and promote mono_method_get_header_check to the API as the profiler needs it. 2016-03-01 14:38:21 -05:00
Jonathan Pryor 2a6e0ba6b6 Merge pull request #2662 from mattleibow/pcl-mono.options
[Mono.Options] Changed the code a bit so that it works with PCL
2016-03-01 09:20:28 -08:00
David Lechner abad361206 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
2016-03-01 10:52:17 -06:00
David Lechner 0f0d4804b1 Add unit tests for Mono.Unix.UnixEndpoint and Mono.Unix.UnixListener
Tests for regression of https://bugzilla.xamarin.com/show_bug.cgi?id=35004
2016-03-01 10:52:17 -06:00
Rodrigo Kumpera e4bb9420fd [runtime] Remove all usages of mono_method_get_header from the runtime. 2016-03-01 11:51:52 -05:00
Rodrigo Kumpera bcd5485c4d [runtime] Replace mono_method_get_header with mono_method_get_header_checked. 2016-03-01 11:51:52 -05:00
Rodrigo Kumpera 0952606a6f [runtime] Use mono_method_get_header_checked in debug-helpers.c 2016-03-01 11:51:52 -05:00
Rodrigo Kumpera 0a09d4e60c [gc] Use the new MonoMethodBuilder:init_locals field. 2016-03-01 11:51:52 -05:00
Rodrigo Kumpera 9fc47df284 [runtime] Add init_locals field to MonoMethodBuilder to make it easy to get it set to false. 2016-03-01 11:51:51 -05:00
Rodrigo Kumpera aae5a8af07 [runtime] Add mono_method_get_header_checked and implement mono_method_get_header using it. 2016-03-01 11:51:51 -05:00
Rodrigo Kumpera 3452a8224b [runtime] Ban mono_method_get_signature_full. It has no runtime usage left. 2016-03-01 11:51:51 -05:00
Rodrigo Kumpera 798f966c38 [runtime] Ban mono_method_get_signature. Nothing else uses it. 2016-03-01 11:51:51 -05:00
Rodrigo Kumpera 0dbb9a0501 [runtime] Ban mono_class_inflate_generic_type from usage by the runtime. Move code to use mono_class_inflate_generic_type_checked. 2016-03-01 11:51:50 -05:00
Rodrigo Kumpera a405895162 [runtime] Remove mono_class_inflate_generic_class, replace usage with mono_class_inflate_generic_class_checked. 2016-03-01 11:51:49 -05:00
Rodrigo Kumpera 299c2ee9ec [runtime] Add mono error to inflate_generic_header. Fix buglet in mono_method_get_signature_checked. 2016-03-01 11:51:49 -05:00
Rodrigo Kumpera a5e6ac82c9 [runtime] Ban mono_metadata_parse_mh from the runtime. 2016-03-01 11:51:49 -05:00
Rodrigo Kumpera 3b4a2938b5 [runtime] Introduce MonoError in mono_metadata_parse_mh_full. 2016-03-01 11:51:49 -05:00
Rodrigo Kumpera bd356a9269 [runtime] Remove dead function mono_metadata_parse_type_full. 2016-03-01 11:51:48 -05:00
Rodrigo Kumpera 8c863fbfab [runtime] Disallow usage of mono_metadata_parse_type, mono_metadata_parse_param and mono_metadata_parse_field_type. 2016-03-01 11:51:48 -05:00
Rodrigo Kumpera da536d72ea [mono-error] mono_metadata_parse_array is not longer used by the runtime, ban it. 2016-03-01 11:51:48 -05:00
Rodrigo Kumpera 2701121e94 [mono-error] mono_class_from_name and mono_class_from_name_case now can cleanly return NULL on failure. 2016-03-01 11:51:48 -05:00
monojenkins ce285efd3a Merge pull request #2686 from ludovic-henry/monoerror-mono_remoting_invoke
[runtime] Use MonoError for mono_remoting_invoke
2016-03-01 15:30:18 +00:00
Alexander Köplinger bee9ca6aab Automatically define MONO_DISABLE_GSHAREDVT variable when gsharedvt isn't enabled
Before when the variable wasn't set (= the default), the mobile_static profile would try to pass
the -O=gsharedvt flag even when gsharedvt is not enabled (e.g. when building without mono-extensions)
which causes AOTing to fail.

A better solution is to export the variable from configure.ac into the mcs build system depending
on whether gsharedvt is enabled at configure time.
2016-03-01 14:31:50 +01:00
João Matos b1aabf5b47 Merge pull request #2701 from akoeplinger/fix-async-read-test
Fix unreliability in async_read.exe test
2016-03-01 10:14:29 +00:00
João Matos 1232756868 Merge pull request #2702 from akoeplinger/bug-38933
[System.Security] Fix CryptographicException from ProtectedData.Protect with multiple threads
2016-03-01 10:10:59 +00:00
monojenkins 0368c0d931 Merge pull request #2703 from akoeplinger/pupitetris-Bug-35635
Don't trim TimeZone names ending in parenthesys

Replaces/Closes #2206

@monojenkins merge
2016-03-01 08:35:20 +00:00
Alexander Köplinger 3bbe1d5066 [corlib] Add test for #35635 2016-03-01 08:06:15 +01:00
Arturo Espinosa 33332daa00 Don't trim TimeZone names ending in parenthesys.
Such as "Central Standard Time (Mexico)"
2016-03-01 08:06:14 +01:00
Alexander Köplinger 70cb5fdd9f [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
2016-03-01 07:24:02 +01:00
Alexander Köplinger 016efd505f 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.
2016-03-01 06:15:25 +01:00
monojenkins 10813c8865 Merge pull request #2695 from vargaz/process-set-pending
[runtime] Use pending exceptions in process.c.
2016-03-01 03:45:21 +00:00
Alexander Köplinger a989ac959f Don't try AOTing Facades assemblies in the mobile_static profile
Facade assemblies don't have code so they don't need to be AOTd.
2016-03-01 02:42:10 +01:00
Alexander Köplinger d827987af7 Expose mobile_static profile in configure.ac
Pass --with-mobile_static to enable it.
2016-03-01 02:42:10 +01:00
Alexander Köplinger 82a1747f86 Enable building of monotouch and xammac profiles without mono-extensions
By using the <profile>_opt_<assembly>.sources file we can specify files
that are used when mono-extension is not enabled and add shims for the
classes or methods that are missing an implementation in that case.

This allows us to build the monotouch and xammac profiles on public Jenkins.
2016-03-01 02:37:34 +01:00
Zoltan Varga 9d596e5b2b [runtime] Use the return_if_nok () macros in socket-io.c. 2016-03-01 01:55:55 +01:00
Zoltan Varga 644a8cfbfe Merge pull request #2691 from vargaz/socket-io-pending-exception
[runtime] Use pending exceptions in socket-io.c.
2016-03-01 01:14:04 +01:00
Zoltan Varga 194dfd5ae1 [runtime] Use return_if_nok/return_val_if_nok to simplify error handling code in process.c. 2016-03-01 00:37:25 +01:00
monojenkins 4c4af589f3 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
2016-02-29 22:35:35 +00:00
Aleksey Kliger f789e6d99d [reflection] Use MonoError in mono_get_object_from_blob 2016-02-29 16:28:36 -05:00
Aleksey Kliger 753f639a9d [reflection] MonoError in mono_param_get_objects_internal
Mark mono_param_get_objects external only.
2016-02-29 16:28:36 -05:00
monojenkins 797c536463 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.
2016-02-29 21:15:43 +00:00
Marcos Henrich e8744b6fc0 [System.Runtime.Serialization] DataContractSerializerTest
Added test that covers #37116.
2016-02-29 19:09:19 +00:00
monojenkins 185609a229 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.
2016-02-29 19:05:41 +00:00
Rodrigo Kumpera edaff9f900 [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.
2016-02-29 13:51:21 -05:00
Rolf Bjarne Kvinge 4741c8e208 [corlib] Fix tests to compile when Thread.Suspend/Resume is not supported. 2016-02-29 19:03:14 +01:00
Aleksey Kliger 94d3608661 [runtime] Don't raise exception while holding locks 2016-02-29 11:51:41 -05:00
Aleksey Kliger 50ae6746df [reflection] Expect no loader error in mono_reflection_get_custom_attrs_by_type anymore 2016-02-29 11:17:22 -05:00
Aleksey Kliger 915c5be91e [reflection] Use MonoError for mono_custom_attrs_from_param
Mark it external only.  Runtime should use mono_custom_attrs_from_param_checked
2016-02-29 11:17:22 -05:00
Aleksey Kliger d151380f20 [reflection] Use MonoError for mono_custom_attrs_from_field
Mark it external only.  Runtime should use mono_custom_attrs_from_field_checked.
2016-02-29 11:16:29 -05:00
Aleksey Kliger 2c1ad79f57 [reflection] Use MonoError for mono_custom_attrs_from_event
Mark it external only.  Runtime should use mono_custom_attrs_from_event_checked.
2016-02-29 11:15:27 -05:00
Aleksey Kliger 15158c01d7 [reflection] Use MonoError for mono_custom_attrs_from_property
Mark it external only.  Runtime should use mono_custom_attrs_from_property_checked.
2016-02-29 11:14:35 -05:00
Aleksey Kliger 58bf2901cd [reflection] Use MonoError for mono_custom_attrs_from_module 2016-02-29 11:12:46 -05:00
Aleksey Kliger daf526a452 [reflection] Use MonoError for mono_custom_attrs_from_assembly
Mark it external only.  Runtime should use mono_custom_attrs_from_assembly_checked.
2016-02-29 11:12:46 -05:00
Aleksey Kliger efd6fa136d [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.
2016-02-29 11:10:49 -05:00
Aleksey Kliger aa0abb8067 [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.
2016-02-29 11:09:24 -05:00
Ludovic Henry feac360890 [runtime] Fix compilation warning 2016-02-29 15:59:09 +00:00
Ludovic Henry 9ed6d805bb [runtime] Use MonoError for mono_remoting_invoke 2016-02-29 15:55:57 +00:00
Aleksey Kliger a44a9c4c7a Use MonoError in mono_string_{is_interned,intern}
Also mark mono_string_intern external only.  Runtime should use
mono_string_intern_checked.
2016-02-29 10:51:34 -05:00
Zoltan Varga bca31ce009 [runtime] Use pending exceptions in process.c. 2016-02-29 16:23:48 +01:00
Ludovic Henry 315e59dc35 [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.
2016-02-29 14:49:17 +00:00
monojenkins f23be9286b 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.
2016-02-29 13:30:19 +00:00
Dean Ellis b59807ecfa [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.
2016-02-29 11:55:15 +00:00
monojenkins 53970822d0 Merge pull request #2692 from vargaz/process-coding-conv
[runtime] Use mono coding conventions in process.c.
2016-02-29 04:00:17 +00:00
Zoltan Varga 75bb097c88 [runtime] Use mono coding conventions in process.c. 2016-02-29 03:35:15 +01:00
Zoltan Varga 3050bbc285 [runtime] Use pending exceptions in socket-io.c. 2016-02-29 02:58:38 +01:00
Alexander Köplinger 046dacbc2d Merge pull request #2690 from steffen-kiess/json-operator-uint
Fix typo in JsonValue which broke the conversion to uint and add test case
2016-02-29 00:06:51 +01:00
Steffen Kieß 314568184c Fix typo in JsonValue which broke the conversion to uint and add test case 2016-02-28 18:40:22 +01:00
Miguel de Icaza ab7138d5c9 Bring new IKVM 2016-02-27 15:27:46 -05:00
João Matos 3c2f3d4ea9 Merge pull request #2580 from ItsVeryWindy/master
Updates to WebRequestHandler
2016-02-27 12:37:39 +00:00
João Matos 71e8d4d76f Merge pull request #2672 from Numpsy/sgenexception
[sgen] catch NotSupportedException from system.xml.serialization
2016-02-27 12:36:36 +00:00
Zoltan Varga c448cbe7a4 Merge pull request #2689 from vargaz/socket-io-cleanup
[runtime] Clean up the socket-io.c file to use the mono coding conven…
2016-02-27 06:46:01 -05:00
Zoltan Varga 3178ed38cc [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. 2016-02-27 01:48:10 -05:00
monojenkins 6b665a8cdd Merge pull request #2688 from vargaz/marshal-set-pending
[runtime] Use pending exceptions instead of mono_raise_exception () i…

…n Marshal icalls.
2016-02-27 05:55:17 +00:00
Zoltan Varga 518af27e5d [runtime] Use pending exceptions instead of mono_raise_exception () in Marshal icalls. 2016-02-26 23:19:10 -05:00
Zoltan Varga d27bb08606 [aot] Fix the usage of MonoError in init-llvm_method (). 2016-02-26 22:40:29 -05:00
Marek Safar 7013a709c3 Merge pull request #2678 from esdrubal/filestream
[corlib] Fixed FileStream Write after Read issue
2016-02-26 15:12:18 -08:00
Aleksey Kliger (λgeek) cde5626319 Merge pull request #2685 from ludovic-henry/monoerror-mono_object_register_finalizer
[runtime] Use MonoError for mono_object_register_finalizer
2016-02-26 15:28:08 -05:00
monojenkins 4755f806bd Merge pull request #2671 from lambdageek/dev/monoerror-mono_runtime_class_init
[runtime] Use MonoError for mono_class_vtable_full and mono_runtime_class_init_full

Switch from a boolean `raise_on_error` arg to a MonoError outarg and let
callers decide what to do with the error.

Also mark mono_runtime_class_init external only.  Runtime should use
mono_runtime_class_init_full.
2016-02-26 18:00:20 +00:00
Aleksey Kliger d17b896095 [runtime] Use MonoError for mono_class_vtable_full and mono_runtime_class_init_full.
Switch from a boolean raise_on_error arg to a MonoError outarg and let
callers decide what to do with the error.

Also mark mono_runtime_class_init external only.  Runtime should use
mono_runtime_class_init_full.
2016-02-26 10:51:02 -05:00
Alexander Köplinger cae295aca4 [scripts] Point scripts like nunit-console2/mono-service2 to the 4.5 directory
The 2.0 profile doesn't ship with Mono anymore. To avoid breaking existing scripts we just point to the 4.5 version instead.
2016-02-26 15:28:53 +01:00
Alexander Köplinger a63b5d2f9f [System.ServiceModel] Fix a hardcoded port in a test
This failed with an "address already in use" error on Jenkins yesterday.
2016-02-26 15:28:53 +01:00
Ludovic Henry 8bbae7b059 [runtime] Use MonoError for mono_object_register_finalizer 2016-02-26 13:49:28 +00:00
Rodrigo Kumpera 17078213ce Merge pull request #2679 from lambdageek/dev/monoerror-reflection
[reflection] MonoError cleanups
2016-02-25 17:42:39 -08:00
Zoltan Varga 0936cea298 [runtime] Remove some declarations from marshal.h which are not used outside of marshal.c. 2016-02-25 17:10:04 -08:00
Alexander Köplinger 3478462128 Merge pull request #2683 from mfilippov/master
Add generation WepApplication.targets for v12.0 and v14.0 xbuild.
2016-02-26 01:23:19 +01:00
Mikhail Filippov 6b257ea753 Add generation WepApplication.targets for v12.0 and v14.0 xbuild. 2016-02-26 03:18:08 +03:00
monojenkins cc44053429 Merge pull request #2681 from kumpera/pedump_fix
[pedump] Fix init crash on pedump when using --verify.

@marek-safar  here's your fix

@monojenkins merge
2016-02-26 00:05:22 +00:00
Zoltan Varga 05f297f331 [aot] Move a mono_error_raise_exception () call higher up the call chain. 2016-02-25 13:53:53 -08:00
Rodrigo Kumpera 105325919d [pedump] Fix init crash on pedump when using --verify. 2016-02-25 13:40:10 -08:00
Zoltan Varga 07f91a9a68 [sdb] Remove some mono_error_raise_exception () calls. 2016-02-25 13:30:23 -08:00
Martin Baulig 9be67a219f [jit]: Correctly restore callee saved registers in mono_arch_get_call_filter() on amd64.
(cherry picked from commit 8c1ffe78cc)
2016-02-25 15:59:00 -05:00
Marcos Henrich 5878958ac2 [corlib] Fixed MonoIO.Write loop. 2016-02-25 18:47:22 +00:00
Marcos Henrich 2fd036928c [corlib] Fixed FileStream Write after Read issue
FileStream was writing to the wrong position When a value longer than
the FileStream buffer was written after a read.

This was fixed by doing a seek before doing the problematic write.

Fixes #11699
2016-02-25 18:47:09 +00:00
Marcos Henrich abaf937ca5 [corlib] Test FileStream with Read and Writes
Covers #11699
2016-02-25 18:38:05 +00:00
João Matos 1c4d28ddb4 Fixed the build. 2016-02-25 18:29:21 +00:00
João Matos ec0063b889 [support/zlib] Added API exports to exported calls from zlib-helper.c.
This is so we can re-use this code from libmonodroid, which currently has its own duplicated copy.
2016-02-25 17:37:49 +00:00
João Matos 1b82e02ea5 [support/zlib] Remove eglib link dependencies from zlib-helper.c.
This is so we can re-use this code from libmonodroid, which currently has its own duplicated copy.
2016-02-25 17:37:48 +00:00
Aleksey Kliger 833b07a4e9 [reflection] MonoError in mono_reflection_get_custom_attrs_info
Also mark that function external only.  Runtime should use
mono_reflection_get_custom_attrs_info_checked
2016-02-25 12:20:30 -05:00
Aleksey Kliger 1d7a1480dc [reflection] MonoError for mono_reflection_type_get_underlying_system_type 2016-02-25 11:30:12 -05:00
Ludovic Henry 53370ea717 Merge pull request #2655 from ludovic-henry/fix-wait-timeout
[WaitHandle] Fix Wait(One|Any|All) and SignalAndWait with timeout
2016-02-25 16:28:20 +00:00
Aleksey Kliger 8808162171 [reflection] MonoError for mono_custom_attrs_data_construct 2016-02-25 11:12:14 -05:00
Aleksey Kliger fc1f1adcf0 [reflection] MonoError for create_cattr_{typed,named}_arg 2016-02-25 10:52:52 -05:00
Aleksey Kliger 667103359d [reflection] MonoError for mono_reflection_method_on_tb_inst_get_handle 2016-02-25 10:52:32 -05:00
Zoltan Varga c8ed3d4e7b [jit] Remove a few mono_error_raise_exception () calls. 2016-02-25 00:36:57 -08:00
Zoltan Varga 7764aef8f6 Fix the build. 2016-02-24 23:30:33 -08:00
Zoltan Varga 1adda99f10 [jit] Add a MonoError argument to mono_create_jit_trampoline (), get rid of the mono_create_jit_trampoline_in_domain () variant. 2016-02-24 23:28:44 -08:00
Zoltan Varga 7736232995 [jit] Add a MonoError argument to mono_create_jump_trampoline (). 2016-02-24 23:15:22 -08:00
Zoltan Varga f343a79ed0 [llvm] Remove some unused argument passing conventions. 2016-02-24 13:50:16 -08:00
Marek Safar 07009a81b6 Merge pull request #2673 from serpentblade/master
[System.Data.SqlClient] Fix for bulk copy inserts via IDataReader
2016-02-24 12:21:16 -08:00
Dan Krieger 257f1e07d8 [System.Data.SqlClient] Fix for bulk copy inserts via IDataReader
Resolve same with DataTable requiring name problem fixed in 1858ce4a94
2016-02-24 11:57:20 -08:00
Richard Webb 50276ee436 [sgen] catch NotSupportedException from system.xml.serialization
System.Xml.Serialization.TypeDesc.CheckSupported might throw a
NotSupportedException, so catch it and ignore the current type
2016-02-24 13:18:12 +00:00
Zoltan Varga b5a35306e1 [llvm] Fix the loaded llvm build. 2016-02-24 01:23:58 -08:00
Zoltan Varga 9a99994e88 Fix the build. 2016-02-24 01:22:18 -08:00
Zoltan Varga 91cebc53f7 [llvm] Emit dwarf debug info when running with llvm 3.9. This is not enabled yet, since it doesn't seem to work, the dwarf info is in the object file emitted by llc, but disappears during linking. 2016-02-24 00:23:35 -08:00
Marek Safar ee16d551a3 [mcs] escaped quoted interpolated format specifier has no restrictions. Fixes #38992 2016-02-23 13:48:19 -08:00
Aleksey Kliger 0e76a2726a [runtime] Use MonoError in mono_runtime_object_init
Mark mono_runtime_object_init checked external only.  Runtime should use mono_runtime_object_init_checked.
2016-02-23 12:59:21 -05:00
monojenkins 978c84a68c Merge pull request #2664 from lambdageek/dev/monoerror-mono_rand
[runtime] Use MonoError in mono_rand_try_get_bytes
2016-02-23 17:30:20 +00:00
Aleksey Kliger 638dce48ca [runtime] MonoError cleanup in mono-security.c 2016-02-23 12:13:13 -05:00
João Matos 7c4d41a518 [System.IO.Compression.DeflateStream] Fixed end condition in decompression loop.
Keep track of total bytes read from input stream and break from the loop if it matches the number of bytes inflated by zlib.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=34916.
2016-02-23 16:09:36 +00:00
Alexander Köplinger 22cc7b350e [msvc] %PATH% is sometimes empty in Jenkins, so "powershell" doesn't run
Try using a system-standard default variable which points to the required folder instead.
2016-02-23 17:03:11 +01:00
monojenkins 087088f3fa Merge pull request #2666 from lambdageek/dev/kill-InternalReplaceStrComp
[runtime] Remove ves_icall_System_String_InternalReplace_Str_Comp

It appears to be dead code.
2016-02-23 15:55:17 +00:00
Aleksey Kliger 2e8a703611 [runtime] Use MonoError in mono_rand_try_get_bytes 2016-02-23 10:50:10 -05:00
Alexis Christoforides d5785dcfa5 Bump Mono version -> 4.5.0 2016-02-23 09:25:09 -05:00
Aleksey Kliger 4895e70948 [runtime] Remove ves_icall_System_String_InternalReplace_Str_Comp
It appears to be dead code.
2016-02-22 18:45:16 -05:00
monojenkins 9f6238791f Merge pull request #2661 from ludovic-henry/fix-safehandle-abort
[SafeHandle] Avoid handle leakage in case of ThreadAbortException

If we get a ThreadAbortException while at SafeHandle.cs:124 (before this commit), we would not set release to true, even after incrementing the internal reference count of the SafeHandle. That could lead to potential leak, as the caller (following the common following pattern) would never call DangerousRelase, thus never calling PerformRelease. The finalizer or Dispose would not lead to the call of PerformRelease either, as the DangerousAddRef / DangerousRelase calls are unbalanced.

The common pattern for DangerousAddRef / DangerousRelease is the following:

bool release = false;
try {
  safeHandle.DangerousAddRef (ref release);
  /* do something with safeHandle.DangerousGetHandle () */
} finally {
  if (release)
    safeHandle.DangerousRelease ();
}

@monojenkins merge
2016-02-22 22:25:34 +00:00
monojenkins 26053ef5b5 Merge pull request #2657 from xmcclure/little-embed-fixes
Minor platform-support fixes

* Fix error in DISABLE_HW_TRAPS implementation
* Rename class in mono/tests/threadpool.cs to allow embedding
2016-02-22 19:45:29 +00:00
monojenkins 71a9582dda Merge pull request #2653 from lambdageek/dev/exception_type-1
[runtime] Don't access MonoClass::exception_type directly.

Use `mono_class_get_failure ()` and `mono_class_has_failed ()`

This is mostly just cleanup refactoring at this point that will make it easier to change how exception_type is used.

Also from this exercise we've learned that most of the class handling code just cares whether the class has an error or not, not what sort of error it was.
2016-02-22 19:30:33 +00:00
Ankit Jain 5317fbc0cd Merge pull request #2646 from ludovic-henry/fix-processwatch-dispose
[Microsoft.Build] Fix XS build error + Fix expected output newline from ProcessWrapper.OutputStreamChanged and ProcessWrapper.ErrorStreamChanged
2016-02-22 13:26:24 -05:00
Ludovic Henry 942bd2b8b2 [SafeHandle] Avoid handle leakage in case of ThreadAbortException
If we get a ThreadAbortException while at SafeHandle.cs:124 (before this commit), we would not set release to true, even after incrementing the internal reference count of the SafeHandle. That could lead to potential leak, as the caller (following the common following pattern) would never call DangerousRelase, thus never calling PerformRelease. The finalizer or Dispose would not lead to the call of PerformRelease either, as the DangerousAddRef / DangerousRelase calls are unbalanced.

The common pattern for DangerousAddRef / DangerousRelease is the following:

bool release = false;
try {
  safeHandle.DangerousAddRef (ref release);
  /* do something with safeHandle.DangerousGetHandle () */
} finally {
  if (release)
    safeHandle.DangerousRelease ();
}
2016-02-22 16:54:57 +00:00
Ludovic Henry 55492cbbee [WaitHandle] Fix Wait(One|Any|All) and SignalAndWait with timeout
In the case where we would call for example WaitHandle.WaitOne with a timeout, we could run in the case where we would wait way longer than the timeout would allow it (240s instead of 90s for example). This would be due to spurious wake, which would not be considered to be an error, but which would lead calling the `mono_os_cond_timedwait` function with the same timeout every time. That would mean that `mono_os_cond_timedwait` would return that it timedout, if and only if, it would timed out after N milliseconds, with N the millisecondsTimeout parameter to WaitOne in this example. That mean that any spurious wake would effectively lead to rewaiting with a full timeout every time.

That could lead to the following scenario:
 - T1 calls waitHandle.WaitOne(timeout = 1000ms) at T=0ms
 - T1 calls mono_os_cond_timedwait(timeout = 1000) at T=0ms
 - GC suspend T1 at T=500ms <- here it's not necessarily the GC, it can be anything suspending/signaling the thread
 - T1 spurious wake, and call mono_os_cond_timedwait(timeout = 1000) at T=500ms
 - GC interrupt T1 at T=1250ms
 - T1 spurious wake, and call mono_os_cond_timedwait(timeout = 1000) at T=1250ms
 - etc.

As you can see, T1 should have returned from waitHandle.WaitOne before the second spurious wake, but as it recalled mono_os_cond_timedwait with a timeout of 1000ms again, it didn't.

The fix consists in keeping track of when the call is supposed to finish, and pass an adaptable timeout to mono_os_cond_timedwait, which decreases as time goes on, to enventually reach 0, and return in a timely manner.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38382
2016-02-22 16:48:52 +00:00
Ludovic Henry c153626bdf Merge pull request #2620 from ludovic-henry/referencesource-waithandle
[corlib] Import System.Threading.WaitHandle
2016-02-22 16:04:36 +00:00
Marcos Henrich c7683d0cbd [System] Fixes HttpListenerRequest.IsLocal.
IsLocal was only returning true when the loopback address was used.
Fixes #38322.
2016-02-22 15:44:34 +00:00
Alexander Köplinger 0c3c632c32 Merge pull request #2651 from akoeplinger/dmcs-warning
[scripts] Add deprecation warning to dmcs
2016-02-22 16:43:44 +01:00
Aleksey Kliger 52ca8647ad [runtime] Don't access MonoClass::exception_type directly.
Use mono_class_has_failure () or mono_class_get_failure ()
2016-02-22 10:43:17 -05:00
Marcos Henrich 56f877287d [System] Test HttpListenerRequest.IsLocal.
Covers #38322.
2016-02-22 15:43:00 +00:00
Joao Matos 77b034cbe7 [System.IO.Compression] Lower minimum version in ZIP headers for compatibility.
This fixes compatibility with tools like MS Excel, file tool, and others that do not know how to recognize newer ZIP version formats.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=33553.
2016-02-22 14:53:09 +00:00
Matthew Leibowitz d95ccb2ca5 [Mono.Options] Changed the code a bit so that it works with PCL
- TypeDescriptor is unavailable, but basic conversion can be done using IConvertible
2016-02-22 16:45:28 +02:00
Ludovic Henry f558ee9034 Merge pull request #2593 from ludovic-henry/coop-fix-native-to-managed
[coop] Fix native-to-managed wrapper
2016-02-22 11:23:34 +00:00
Ludovic Henry 0a7389d4ba [WaitHandle] Call SafeWaitHandle DangerousAddRef / DangerousRelease around native calls
We do not want to wait on a handle that have been cleaned up, as that will lead to a warning message from the io-layer, without any error in managed code. That mean we could not detect this error case and recover from it.

By doing this DangerousAddRef / DangerousRelease before going to native, we ensure that the WaitHandle is and will stay alive while waiting on it. This same is done in CoreCLR, but in the marshalling code.
2016-02-22 11:22:56 +00:00
Ludovic Henry f6fa8f0359 [corlib] Import System.Threading.WaitHandle 2016-02-22 11:22:56 +00:00
Ludovic Henry 98f96e9559 [io-layer] Fix process_wait return value for current process
When waiting on the current process, we would return WAIT_FAILED, as waitpid would return -1, with errno set to ECHILD.
But the semantic of WaitForSingleObjectEx and WaitForMultipleObjectsEx when waiting on current process is to return WAIT_TIMEOUT. This is then a special case that we need to add to this code.
2016-02-22 11:22:46 +00:00
Alexander Köplinger 9e36a50147 [scripts] Add deprecation warning to dmcs
dmcs was deprecated in favor of mcs a while back, yet people are still creating new scripts with it.
Adding a message that shows up on each dmcs invocation should hopefully make this more obvious.
2016-02-22 11:50:26 +01:00
Vlad Brezae 28b7a83ff6 Merge pull request #2648 from BrzVlad/fix-cprop-vregs
[jit] Fix init of cprop defs for vregs
2016-02-22 17:49:35 +07:00
Zoltan Varga efa2d17df2 [llvm] Avoid setting the mono.nofail.load flag with the new llvm branch, its not supported there. 2016-02-22 02:43:36 -05:00
Rodrigo Kumpera 35190b72b5 Merge pull request #2660 from kumpera/loader-error-cleanup6
[mono-error] This PR eliminates mono_class_from_name and a couple of assorted fixes.
2016-02-21 17:46:35 -05:00
Rodrigo Kumpera 3ae2835c31 [runtime] Ban mono_class_from_name mono_class_from_name_case.
They are no longer in use by the runtime. Begone!
2016-02-20 13:28:45 -05:00
Rodrigo Kumpera 00b0d3c451 [tests] Pass cli args to test runner so we can pick which test to run 2016-02-20 13:28:45 -05:00
Rodrigo Kumpera 9e963b91f3 [util] When creating the TLE exception only provide aditional data if both type and assembly names are provided. Otherwise one would fail and we'd get an OOM instead. 2016-02-20 13:28:44 -05:00
Rodrigo Kumpera b5f738d8dc [runtime][jit] Replace usage of mono_class_from_name with mono_class_load_from_name for variable type lookups. 2016-02-20 13:28:43 -05:00
Rodrigo Kumpera 9c6331cd5d [runtime] Switch probing usage of mono_class_from_name to mono_class_try_load_from_name.
Those are call sites that can handle missing types correctly.
2016-02-20 13:28:43 -05:00
Rodrigo Kumpera 4bdeab0dbb [runtime] Add MonoError to search_modules. Fix signature of mono_class_from_name_checked_aux (MonoError MUST be last arg). 2016-02-20 13:28:42 -05:00
Rodrigo Kumpera 103a5097c0 [runtime] Switch GENERATE_GET_CLASS_WITH_CACHE to use mono_class_load_from_name. Kill dead macro. 2016-02-20 13:28:41 -05:00
Rodrigo Kumpera a2b7d129d1 [runtime] Add manually coded version of GENERATE_GET_CLASS_WITH_CACHE that uses System.dll 2016-02-20 13:28:41 -05:00
Rodrigo Kumpera 61b243e8ca [runtime] Replace mono_class_from_name with mono_class_load_from_name for explicit loads that must not fail. 2016-02-20 13:28:37 -05:00
Rodrigo Kumpera 4ebdf07bd1 [runtime] Add type load caching to one missing thing appdomain.c 2016-02-20 13:23:25 -05:00
Rodrigo Kumpera 1da6b76297 [runtime] Use mono_class_load_from_name to load types in mono_defaults.
We can use mono_class_load_from_name in all cases that we previously used to assert after loading.

All optional types have being moved over to use GENERATE_TRY_GET_CLASS_WITH_CACHE.

All but System.Runtime.ConstrainedExecution.CriticalFinalizerObject which is used within
sgen and we must ensure we don't try to lazy load it there.

I'm not 100% sure whether it should be optional, maybe it's a leftover from the 1.0 -> 2.0 timeframe?

The problem is that marking more types as required would be a burden on linkers as they might not force
it to be preserved.

I'm not particularly happy with the current large set of types that are loaded upfront. A significant
number of them could be lazy loaded.
2016-02-20 13:23:24 -05:00
Rodrigo Kumpera 29a95bafd8 [runtime] Replace explicit lookup with GENERATE_GET_CLASS_WITH_CACHE in cominterop.c
Last place with adhoc lookup & caching.
2016-02-20 13:23:24 -05:00
Rodrigo Kumpera 0cd805af4c [runtime] Add GENERATE_TRY_GET_CLASS_WITH_CACHE macro that generates a probing function.
This function generates probing functions that rely on mono_class_try_load_from_name.

In addition replace usage of hand crafted loading code from all around.
2016-02-20 13:23:24 -05:00
Rodrigo Kumpera d0e10f8670 [runtime] Add mono_class_load_from_name and mono_class_try_load_from_name.
Those are variants of mono_class_from_name_checked that implement two common type loading scenarios in the rutime.

The first is mono_class_load_from_name, that loads critical types that the runtime cannot function without.
This means we abort if the type is missing or broken. We should use it in places where today we crash when
either of those would happen.

The other is mono_class_try_load_from_name, which is ok if the type is not found, but will abort if the type is broken.
The reasoning for aborting on a broken type is that it's unclear on whether the runtime should be using the type or not,
specially given most of those optional types change behavior of the application. This, in practice, forces the linker to
not produce a broken corlib.
2016-02-20 13:23:24 -05:00
Alexander Köplinger 9fa6112821 Merge pull request #2647 from qmfrederik/fixes/eventsources
WSDualHttpBinding: Additional constructor overloads to match .NET 4.5
2016-02-20 16:42:23 +01:00
Marek Safar 640be884a4 Merge pull request #2659 from tritao/system_io_compression_reopen
[System.IO.Compression] Fixed re-opening of disposed Zip entry streams.
2016-02-20 09:41:08 +01:00
Vlad Brezae 89d73428e0 Revert "Revert "[jit] Don't allocate memory for unused vreg""
This reverts commit c4037092ac.
2016-02-20 09:25:29 +02:00
Vlad Brezae 5e07e270f3 [jit] Clear defs only for valid vregs used by the bblock's instructions
Also clean the most significant part of long vregs.
2016-02-20 09:25:29 +02:00
Alexander Köplinger 93df50c3c3 [System.Web.ApplicationServices] Add new file to EXTRA_DISTFILES
It was added in 383d80a785. Fixes tarball.
2016-02-20 05:21:21 +01:00
monojenkins 51c8a6e1a9 Merge pull request #2638 from gofman/fixprintsettings
[System.Drawing.Printing] CUPS default PageSize and InputSlot should …

[System.Drawing.Printing] CUPS default PageSize and InputSlot should override PPD defaults.

There is already a test case for that (PrintingServicesUnixTest.cs, Bug602934_PrinterSettingsReturnActualValues) which fails when user configured options are different from PPD settings. Patch also makes this test not to fail if "Resolution" option is not present in CUPS options.
2016-02-20 03:40:28 +00:00
Zoltan Varga 4014e7476e [llvm] Allow the llvm backend to work with a new version of the mono llvm fork based on llvm 3.9.
This version is at:
https://github.com/mono/llvm/tree/llvm-master
It has a mono api version starting from 100. Currently, using LLVM in JIT mode is not supported, only AOT.
2016-02-19 20:44:29 -05:00
Alexander Köplinger 0a4084de8e Merge pull request #2649 from kjuby8709gsome/master
[System]: System.TimeZoneInfo - implemented GetUtcOffset with DateTim…
2016-02-20 01:30:29 +01:00
Joao Matos 3745b6d369 [System.IO.Compression] Fixed re-opening of disposed Zip entry streams.
Fixes System.IO.Compression to work against Microsoft Office OpenXML SDK which depends on this behavior.

Also partial fix for https://bugzilla.xamarin.com/show_bug.cgi?id=33553.
2016-02-19 23:58:55 +00:00
Frederik Carlier 3309b3cb83 Add placeholders for missing methods:
* WSDualHttpBinding: Add additional constructor overloads to match .NET 4.5
* Dispatcher: Add support for the various InvokeAsync methods
2016-02-19 23:04:07 +01:00
Alexis Christoforides 959f4bd8ac Merge pull request #2656 from lambdageek/dev/bug-38600
[mkbundle] Support spaces, strange symbols in assembly names
2016-02-19 17:01:56 -05:00
Aleksey Kliger 7eec60e471 [mkbundle] Support spaces, strange symbols in assembly names
In the asm stubs, replace everything that isn't a-zA-Z0-9_ by an underscore.

Sprinkle quotes in commandline args when running the linker.

Fixes [Bugzilla #38600](https://bugzilla.xamarin.com/show_bug.cgi?id=38600)
2016-02-19 16:54:10 -05:00
Andi McClure ab43a32c0e Rename class in mono/tests/threadpool.cs to allow embedding 2016-02-19 16:51:03 -05:00
Andi McClure 4ca0f35d90 Fix error in DISABLE_HW_TRAPS implementation 2016-02-22 10:46:57 -05:00
Alex Rønne Petersen a339e6b286 Merge pull request #2652 from PAVBAN95/master
Fixed typo in README.md
2016-02-19 21:14:32 +01:00
PAVAN BANSAL e4f37a04f5 Fixed typo in README.md
slightly was misspelled as slighty.
2016-02-20 01:22:33 +05:30
Marek Safar 383d80a785 Merge pull request #2632 from kasthack/sysweb-import
[System.Web.*] Reference source import
2016-02-19 20:52:07 +01:00
Ludovic Henry 4ad73a5413 [runtime] Wrap mono_jit_attach and mono_jit_detach in try { ... } finally { ... } clause
This is useful for coop mode only, as coop needs additionnal thread state transition from BLOCKING to RUNNING and vice versa, and if both these transitions are not done properly, we finish in a incorrect state.
In non-coop mode, the mono_jit_detach only sets the domain to NULL, to avoid scanning threads unnecessarily, so not actually detaching properly is not hurting anything.
2016-02-19 18:05:22 +00:00
Ludovic Henry 289b6d55f7 [coop] Fix native-to-managed wrapper thread attach
Previously, when we would invoke a native-to-managed wrapper from a thread that has not been attached to the runtime, we would simply ensure to attach this thread to the runtime. The issue arise when using coop and needing to switch a thread which is not executing runtime or managed code to BLOCKING state.

That would arise on iOS when using dispatch_async:
 - the user would enqueue a Delegate, triggering a call to mono_delegate_to_ftnptr, generating this native-to-managed wrapper
 - the wrapper would be called asynchronously on a thread managed by the OS/dispatch_async
 - the thread would attach to the runtime, switching its state from STARTING -> RUNNING
 - the thread would finish executing the delegate, thus 'detaching' from the runtime, but without switching its state from RUNNING -> BLOCKING
 - during the next garbage collection, the GC would try to suspend this thread as it is still in RUNNING state, but because it's neither executing runtime code, neither managed code, it will never hit a safepoint, leading to a timeouting suspend.

To fix that issue, we need to support the following state switches:
 - STARTING -> RUNNING -> BLOCKING: happens when it's the first time this thread calls a native-to-managed wrapper
 - BLOCKING -> RUNNING -> BLOCKING: happens when it's not the first time this thread is called from a facility like dispatch_async, or if it is, for example, called as a callback from an external library
 - RUNNING -> RUNNING -> RUNNING: if we call this wrapper from runtime or managed code, see for example System.Reflection.Emit.ILGeneratorTest.TestEmitCalliWithNullReturnType

This facility also need to take care of the current domain, to ensure that we switch properly between domains, and set it to the one that was used when creating this delegate, then restoring the original one.
2016-02-19 18:05:22 +00:00
Marek Safar faef6b6520 Merge pull request #2650 from radical/csc-args
[mcs] Accept and ignore command line args supported by csc that we don't
2016-02-19 18:33:00 +01:00
Ankit Jain 889774c852 [mcs] Accept and ignore command line args supported by csc that we don't
support:

	/win32manifest
	/nowin32manifest
2016-02-19 12:16:11 -05:00
kchernyavskiy ebdbf10605 [System]: System.TimeZoneInfo - implemented GetUtcOffset with DateTimeOffset 2016-02-19 21:03:15 +04:00
Oliver Neal 2d1ab0ef20 updated client certificates to handle non-manual case 2016-02-19 15:41:52 +00:00
Oliver Neal 9dc8e0289d added support for client certificates and the server certificate validation callback 2016-02-19 15:41:52 +00:00
kasthack 36e026d6c1 [System.Web.*] Reference source import: System.Web.Profile.(ProfileInfoCollection, ProfileInfo, ProfileAuthenticationOption, DefaultProfile), missing System.Web.ModelBinding and System.Web.UI types, System.Web.ApplicationServices.(...) 2016-02-19 18:04:06 +03:00
Ludovic Henry fb85e55a98 [Microsoft.Build] Fix expected output newline from ProcessWrapper.OutputStreamChanged and ProcessWrapper.ErrorStreamChanged
The previous implementation of ProcessWrapper OutputStreamChanged and ErrorStreamChanged would manually launch a background thread to read on the process StandardOutput and StandardError, then simply passing the output to the OutputStreamChanged and ErrorStreamChanged events. This mean that even the newline characters would be passed to these events, leaving these events callbacks deal with splitting the output line by line.
On the other hand, Process.OutputDataReceived and Process.ErrorDataReceived already split the data line by line, and discard the newline character. That implies that, to keep the old ProcessWrapper behaviour, we need to add these newlines character before calling OutputStreamChanged and ErrorStreamChanged events callbacks.
2016-02-19 14:45:52 +00:00
Ludovic Henry 3dd741e9cb [Microsoft.Build] Fix XS build error
We observe the following error when building XS:

"Threadpool worker" tid=0x0x7f011bfff700 this=0x0x7f01394bfb30 thread handle 0x432 state : not waiting owns ()
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Threading.WaitHandle.WaitAll_internal (System.Threading.WaitHandle[],int,bool) <0x0005d>
  at System.Threading.WaitHandle.WaitAll (System.Threading.WaitHandle[]) <0x00026>
  at Microsoft.Build.Utilities.ProcessWrapper.<Start>m__0 (object,System.EventArgs) <0x0008f>
  at System.Diagnostics.Process.OnExited () <0x000ed>
  at System.Diagnostics.Process.RaiseOnExited () <0x0009f>
  at System.Diagnostics.Process.CompletionCallback (object,bool) <0x00017>
  at System.Threading.RegisteredWaitHandle.DoCallBack (object) <0x00088>
  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (object) <0x00058>
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) <0x001c6>
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) <0x00020>
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x0004c>
  at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x001d6>
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x00008>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_bool (object,intptr,intptr,intptr) <0x0005a>

And the process output would contains a bunch of "_wapi_handle_ref: Attempting to ref unused handle 0x1234" and "_wapi_handle_unref_full: Attempting to unref unused handle 0x1234".

The expected behaviour is for WaitHandle.(WaitAll|WaitAny|WaitOne|SignalAndWait) and EventWaitHandle.Set to throw an ObjectDisposedException in case the WaitHandle (or one of them if calling WaitAll, WaitAny or SignalAndWait) have been disposed.

This error would be due to a race between ProcessWrapper.Dispose, which closes endEventOut and endEventErr, and the above Process.Wrapper.<Start>m__0 (the base.Exited) callback, which waits on endEventOut and endEventErr.
2016-02-19 14:39:36 +00:00
Marek Safar 1f5f38da2d [bcl] Add workaround for csc bug 2016-02-19 13:26:09 +01:00
Paul Gofman bbf7ea470a [System.Drawing.Printing] CUPS default PageSize and InputSlot should override PPD defaults.
There is already a test case for that (PrintingServicesUnixTest.cs,
Bug602934_PrinterSettingsReturnActualValues) which fails when user
configured options are different from PPD settings. Patch also makes
this test not to fail if "Resolution" option is not present in CUPS
options.

*Update: removed leftover debug Console.WriteLine from patch
2016-02-19 13:01:10 +03:00
Zoltan Varga 347cd69e66 [jit] Fix a regression introduced by c0b9be3e03. 2016-02-19 00:25:42 -05:00
Zoltan Varga 85fa53bab4 [runtime] Avoid a crash when trying to load a non-assembly file as an assembly. Fixes #38825. 2016-02-18 23:33:36 -05:00
Alexander Köplinger 2a6c3eb278 Revert accidental change to submodule from 40017f9 2016-02-19 02:51:28 +01:00
monojenkins c9957bc981 Merge pull request #2643 from xmcclure/disable-hw-traps
DISABLE_HW_TRAPS flag to disable signal reliance

Single switch for both explicit null checks and explicit illegal-divide checks.
2016-02-19 00:10:18 +00:00
Zoltan Varga 3a5dbc7e3d [jit] Add missing div check to OP_IREM_IMM. 2016-02-18 18:36:14 -05:00
monojenkins 8e663307d6 Merge pull request #2626 from lewurm/jit-time-track
[jit] add more detailed statistics for single phases

@vargaz: can I have a review on that please? :)
2016-02-18 23:08:36 +00:00
Zoltan Varga c0b9be3e03 [jit] Add div checks to OP_LDIV etc. opcodes. 2016-02-18 17:53:28 -05:00
monojenkins 2cf52cba07 Merge pull request #2642 from kumpera/monodis_fix
[monodis] Improve error handling so it can survive the broken assembly from #37393.
2016-02-18 22:40:24 +00:00
Andi McClure 2b4484b4d8 DISABLE_HW_TRAPS flag to disable signal reliance
Single switch for both explicit null checks and explicit illegal-divide checks
2016-02-18 17:16:29 -05:00
Alexis Christoforides 40017f9aa0 [mkbundle] Small fixes under Windows
* Quote source files before passing to cl.exe
* Use Windows subsystem instead of console but still use main() entry point and not WinMain()
2016-02-18 16:54:20 -05:00
Zoltan Varga 04636f9981 [jit] Add div checks to the OP_IDIV_IMM etc. opcodes if needed. 2016-02-18 15:56:21 -05:00
Miguel de Icaza ca6666ddbd [Mainsoft] Remove deprecated code: the Mainsoft code has not been maintained in years 2016-02-18 14:49:40 -05:00
Rodrigo Kumpera cec2b91483 [monodis] Improve error handling so it can survive the broken assembly from #37393. 2016-02-18 14:36:55 -05:00
Alexander Köplinger 051f49639d Merge pull request #2609 from directhex/xambug-30902
Use X509 serial number in Mono cert store filename
2016-02-18 12:45:52 +01:00
Ludovic Henry 1ad39faaa0 Merge pull request #2624 from ludovic-henry/monoerror-appdomain
[runtime] Use MonoError for appdomain.c functions
2016-02-18 11:11:41 +00:00
Ludovic Henry e455981212 Merge pull request #2630 from ludovic-henry/fix-registeredwaithandle-leak
[corlib] Fix potential RegisteredWaitHandle resource leak
2016-02-18 10:53:37 +00:00
Rodrigo Kumpera 5ad8e35be3 Merge pull request #2635 from xmcclure/timezoneinfo
Broaden readlink load failure check in TimeZoneInfo
2016-02-17 23:12:15 -05:00
Zoltan Varga 5ad7794575 [jit] Get rid of the non-checked variant of mono_resolve_patch_target (), its not used any more. 2016-02-17 22:23:40 -05:00
Martin Baulig 082a47eed5 Bump Makefile to trigger full build.
(cherry picked from commit 905088bb90)
2016-02-17 20:41:10 -05:00
Martin Baulig 80741c16fd [System]: 'ServicePointManager.CertificatePolicy': lazily initialize.
The internal GetLegacyCertificatePolicy() now returns null unless this
property has explicitly been assigned to, so the legacy handler will not
be used in ChainValidationHelper.

(cherry picked from commit e69e878405)
2016-02-17 20:40:59 -05:00
Martin Baulig e6e26d9231 [Mono.Security]: Make 'MonoTlsSettings.UseServicePointManagerCallback' a 'bool?'.
The default value is 'true' when using HttpWebRequest, but false when using SslStream
directly.

(cherry picked from commit c871ff63ff)
2016-02-17 20:40:44 -05:00
Martin Baulig 3680b3077b [System]: 'HttpWebRequest.Proxy' - update ServicePoint on assignment.
(cherry picked from commit 08e3a4120c)
2016-02-17 20:40:32 -05:00
Martin Baulig f8f7de7356 [System]: Properly propage exceptions in HttpWebRequest.BeginGetResponse().
(cherry picked from commit acf6c4bd37)
2016-02-17 20:40:19 -05:00
Martin Baulig a429d91690 [System]: Disallow "https" proxies in ServicePointManager.FindServicePoint().
(cherry picked from commit e734cd8b59)
2016-02-17 20:40:09 -05:00
Martin Baulig c56f5c199c [System]: Use correct default value for ServicePointManager.SecurityProtocol.
(cherry picked from commit ddf47829d9)
2016-02-17 20:39:58 -05:00
Martin Baulig 26d5b83fee [System]: Clone the X509Certificate instance that's stored in ServicePoint.
(cherry picked from commit 65afb9f640)
2016-02-17 20:38:52 -05:00
Andi McClure fc58345df6 Broaden readlink load failure check in TimeZoneInfo
Previously this caught only cases where libc was absent, now it catches cases where libc is present but does not contain readlink
2016-02-17 16:49:15 -05:00
monojenkins f1be12dd91 Merge pull request #2633 from xmcclure/fixmobile
Fix mobile/AOT build following System.Diagnostics.Process import

System.Diagnostics.Process was recently added to Mono. This introduced two problems for mobile builds:

- Support classes were not added to the mobile profile .sources.
- The imported referencesource code did not build on fullaot.

This PR fixes both issues.
2016-02-17 21:35:34 +00:00
Chris Hamons c4fe9721ff Prepare XM for Http additions 2016-02-17 14:20:15 -06:00
Alexander Köplinger 83af26bad5 [jit] Fix build on ppc
Declaration of the 'error' variable was missed in 3b438cfce3
2016-02-17 21:20:03 +01:00
Bernhard Urban f42da3fd21 [jit] add timers for several phases 2016-02-17 10:53:13 -08:00
Bernhard Urban 0daccc76e8 [jit] refactor branch fixups between basic blocks into function 2016-02-17 10:51:16 -08:00
Bernhard Urban 7b4e9a661d [jit] refactor basic block ordering in separate function 2016-02-17 10:40:50 -08:00
Bernhard Urban be89deceec [jit] update jit statistics during aot compilation 2016-02-17 10:40:01 -08:00
Bernhard Urban 2ca8b4fb56 [jit] refactor out time tracking function 2016-02-17 10:34:37 -08:00
João Matos c9e1f8f2ed [man] Updated Mono man page with AOT gen-seq-points-file option. 2016-02-17 17:48:09 +00:00
João Matos 066b506905 [aot] Remove debugging print. 2016-02-17 17:48:09 +00:00
monojenkins 25b04d16d9 Merge pull request #2631 from ludovic-henry/fix-microsoftbuild
[Microsoft.Build] Fix Microsoft.Build.Execution.BuildManagerTest.BasicManualParallelBuilds

The previous implementation of ProcessWrapper would launch its own threads to read on the process stdout and stderr. We can more simply use OutputDataReceived and ErrorDataReceived which will do the same under the hood. We use as well the Exited event to track the end of the Process.
2016-02-17 17:25:30 +00:00
Andi McClure f0b9f524fa Update referencesources (to fix full-aot build) 2016-02-17 11:25:19 -05:00
João Matos d7da0cc294 [aot] Reworked sequence points file AOT option to allow an explicit path passed.
This will be used to fix msym files being overwritten per ABI compilation in AOT compilation driven by Monodroid.
2016-02-17 15:59:26 +00:00
Ludovic Henry 8b8450d52c [tests] List files from the repo intead of / for process-stress-3.cs
On some machines, slow remote devices can be attached, leading to very slow find commands, leading to timeouts.
2016-02-17 15:48:35 +00:00
monojenkins 529a16fc14 Merge pull request #2628 from kumpera/misc-loader-error
[runtime] Small set of cleanups to the loader code.
2016-02-17 15:38:52 +00:00
Ludovic Henry 0d0f435afb [Microsoft.Build] Fix Microsoft.Build.Execution.BuildManagerTest.BasicManualParallelBuilds
The previous implementation of ProcessWrapper would launch its own threads to read on the process stdout and stderr. We can more simply use OutputDataReceived and ErrorDataReceived which will do the same under the hood. We use as well the Exited event to track the end of the Process.
2016-02-17 15:22:26 +00:00
Ludovic Henry 48a0a73f84 [runtime] Use MonoError for mono_context_init 2016-02-17 13:53:12 +00:00
Ludovic Henry 44171d1f6b [runtime] Use MonoError for mono_runtime_init 2016-02-17 13:53:11 +00:00
Ludovic Henry 7f0c3d59f3 [runtime] Use MonoError for mono_domain_try_type_resolve 2016-02-17 13:52:21 +00:00
Ludovic Henry 8315bd378e [runtime] Mark mono_domain_create_appdomain as MONO_RT_EXTERNAL_ONLY 2016-02-17 13:46:30 +00:00
Ludovic Henry 63b999868b [runtime] Use MonoError for mono_try_assembly_resolve 2016-02-17 13:43:15 +00:00
Ludovic Henry 050742207f [runtime] Use MonoError for copy_app_domain_setup 2016-02-17 13:43:15 +00:00
Ludovic Henry 920ec35630 [corlib] Fix potential RegisteredWaitHandle resource leak
If we construct RegisteredWaitHandle with executeOnlyOnce = true, and never call Unregister, we will keep _waitObject.SafeWaitHandle reference count unbalanced. This will lead to never releasing the waitObject handle.

As we only need to ensure that the waitObject handle is alive while in the Wait method, we use the SafeHandle mechanism only there. The 2 possibles scenarios in the Wait method are:
 - waitObject has not been closed: we increment its ref count, so we ensure that it's alive as long as we use it here
 - waitObject has been closed: a ObjectDisposedException is thrown, we catch it and keep on without trying to wait on the handle
2016-02-17 10:54:49 +00:00
Marcos Henrich eddc210ec6 Check e.NativeErrorCode is SocketError.OperationNotSupported. 2016-02-17 09:56:16 +00:00
Marcos Henrich 91a6e35c9b Updated SocketTest.UdpDoubleBind 2016-02-17 09:56:15 +00:00
Marcos Henrich 9d3d44013f [System] Check SocketOptionName.ReuseAddress support.
Operating systems that use linux kernels before 3.9 do not support
binding multiple socket to the same address and port.

In those systems even if it was possible to set
SocketOptionName.ReuseAddress an exception was thrown on the second
bind.

These changes introduce a SocketException that is thrown when
SocketOptionName.ReuseAddress is set on a system that will fail to bind
multiple times to the same address.
2016-02-17 09:56:14 +00:00
Marek Safar c2c22fa961 Merge pull request #2627 from kasthack/sysweb-import
[System.Web] Reference source import
2016-02-17 10:33:21 +01:00
Marek Safar 8a6828833c Merge pull request #2629 from gofman/fixtimezoneinfo
[System.TimeZoneInfo] Fix finding system time zone when /etc/localtim…
2016-02-17 10:31:11 +01:00
Paul Gofman 5d4f8f40a6 [System.TimeZoneInfo] Fix finding system time zone when /etc/localtime has a relative path. 2016-02-17 12:00:41 +03:00
Zoltan Varga 3b438cfce3 [jit] Use mono_resolve_patch_target_checked () in more places. 2016-02-16 23:57:55 -05:00
Zoltan Varga 868d624e68 [jit] Use mono_resolve_patch_target_checked () in more places. 2016-02-16 23:20:02 -05:00
kasthack 2c2ca5b296 [System.Web] Reference source import: System.Web.Util internal classes 2016-02-17 07:08:56 +03:00
kasthack fa101bb2b6 [System.Web] Reference source import: System.Web.Routing internal classes 2016-02-17 06:35:31 +03:00
kasthack 921b6aa041 [System.Web] Reference source import 2016-02-17 06:15:30 +03:00
Zoltan Varga cbef9ab952 Fix the build. 2016-02-16 21:56:27 -05:00
Zoltan Varga 41879bda03 [llvm] Remove some unfinished code committed by mistake. 2016-02-16 21:56:27 -05:00
monojenkins cc665cda43 Merge pull request #2625 from xmcclure/tinymemoryleak
Fix memory leak in mono_aot_plt_resolve when exiting with exception

We were not cleaning up our allocated memory on all code paths.
2016-02-17 02:45:17 +00:00
Rodrigo Kumpera 40ca6977af [mono-error] Replace mono_metadata_parse_type_full with mono_metadata_parse_type_checked. 2016-02-16 20:12:46 -05:00
Rodrigo Kumpera 0bda3474c1 [metadata] Introduce MonoError into mono_metadata_parse_type_internal. 2016-02-16 20:12:41 -05:00
Rodrigo Kumpera 8d6025df4f [metadata] Remove mono_metadata_parse_array_full, nothing uses it. 2016-02-16 20:12:37 -05:00
Zoltan Varga f88f82d766 [llvm] Fix a crash when a simd argument is returned from a method by reference. 2016-02-16 20:09:48 -05:00
Rodrigo Kumpera ce79e5cbfb [runtime] Fix the build. 2016-02-16 20:09:01 -05:00
kasthack 09e5099266 [System.Web] Reference source import 2016-02-17 04:08:57 +03:00
Rodrigo Kumpera 91f9eddc0a [runtime] Replace hand-written type look up/caching with GENERATE_GET_CLASS_WITH_CACHE in method-to-ir.c and mini-exceptions.c.
The macro generates the right form of corlib type lookup & caching.
2016-02-16 19:28:23 -05:00
Rodrigo Kumpera bb865afc34 [runtime] Replace hand-written type look up/caching with GENERATE_GET_CLASS_WITH_CACHE in threads.c.
The macro generates the right form of corlib type lookup & caching.
2016-02-16 19:28:23 -05:00
Rodrigo Kumpera 814e3fa7d5 [runtime] Replace hand-written type look up/caching with GENERATE_GET_CLASS_WITH_CACHE in verify.c and remoting.c.
The macro generates the right form of corlib type lookup & caching.
2016-02-16 19:28:22 -05:00
Rodrigo Kumpera 49883b4542 [runtime] Replace hand-written type look up/caching with GENERATE_GET_CLASS_WITH_CACHE in security-core-clr.c and security-manager.c.
The macro generates the right form of corlib type lookup & caching.
2016-02-16 19:28:22 -05:00
Rodrigo Kumpera 9903715fa1 [runtime] Replace hand-written type look up/caching with GENERATE_GET_CLASS_WITH_CACHE in reflection.c.
The macro generates the right form of corlib type lookup & caching.
2016-02-16 19:28:22 -05:00
Rodrigo Kumpera b5401a1488 [runtime] Replace hand-written type look up/caching with GENERATE_GET_CLASS_WITH_CACHE in object.c.
The macro generates the right form of corlib type lookup & caching.
2016-02-16 19:28:22 -05:00
Rodrigo Kumpera 3de136f36f [runtime] Replace hand-written type look up/caching with GENERATE_GET_CLASS_WITH_CACHE in marshal.c.
The macro generates the right form of corlib type lookup & caching.
2016-02-16 19:28:21 -05:00
Rodrigo Kumpera bba695c8a1 [runtime] Replace hand-written type look up/caching with GENERATE_GET_CLASS_WITH_CACHE in locale.c.
The macro generates the right form of corlib type lookup & caching.
2016-02-16 19:28:21 -05:00
Rodrigo Kumpera b374449485 [runtime] Replace hand-written type look up/caching with GENERATE_GET_CLASS_WITH_CACHE in icall.c.
The macro generates the right form of corlib type lookup & caching. Plus it's shorter.
2016-02-16 19:28:21 -05:00
Andi McClure f3ebec8b5a Import System.Diagnostics.Process changes to mobile profile
Changes modeled on ludovic-henry commit 00b5517dd3. Fixes build.
2016-02-16 18:04:18 -05:00
Andi McClure 8cb221daeb Fix memory leak in mono_aot_plt_resolve when exiting with exception 2016-02-16 16:45:53 -05:00
Radek Doulik fc92955366 [linker] do not set scope of non-marked typerefs
- fixes #38818

 - setting the *unchanged* scope to non-marked types is harmful,
   because in case the type has declaring type, the scope of declaring
   type is set as well. see
   https://github.com/mono/cecil/blob/master/Mono.Cecil/TypeReference.cs#L132

   public virtual IMetadataScope Scope {
      get ...
      set {
          var declaring_type = this.DeclaringType;
          if (declaring_type != null) {
              declaring_type.Scope = value;
              return;
          }
          scope = value;
      }
   }

   so in our case, we first set correctly scope of
   System.Collections.Generic.Dictionary`2 to mscorlib, then (re)set
   scope of System.Collections.Generic.Dictionary`2/ValueCollection
   and
   System.Collections.Generic.Dictionary`2/ValueCollection/Enumerator
   to System.Collection (note that these types are not marked and are
   swept away by linker), which sets scope of its declaring type
   System.Collections.Generic.Dictionary`2 back to System.Collection

   and because the System.Collection is linked-out, the typeref is
   incorrectly written with the scope set to System later
2016-02-16 22:44:29 +01:00
Ludovic Henry 8b36e3afb7 [runtime] Bump corlib version 2016-02-16 20:42:57 +00:00
Ludovic Henry 75000f290a [Process] Add stress tests
That's to ensure we do not have regression in the Process implementation.
2016-02-16 20:11:59 +00:00
Ludovic Henry 00b5517dd3 [System] Import System.Diagnostics.Process 2016-02-16 20:11:58 +00:00
Ludovic Henry 1a69330766 [corlib] Fix race condition between RegisteredWaitHandle Wait and Unregister methods
In the following case we would have a race between Wait and Unregister methods:
 - T1 calls ThreadPool.RegisterWaitForSingleObject to wait on waitHandle
 - registeredWaitHandle is constructed to wait on waitHandle
 - registeredWaitHandle.Wait method is enqueued on the ThreadPool
 - T1 calls registeredWaitHandle.Unregister
 - T1 calls waitHandle.Close (happens in Process.StopWatchingForExit)
 - TTP (the threadpool thread) calls registeredWaitHandle.Wait
  - TTP calls WaitHandle.WaitAny (waitHandle, ...)

The last step try to access the waitHandle that has been previously closed, leading to a _wapi_handle_ref / _wapi_handle_unref_full error message.

The fix is to ensure that the RegisteredWaitHandle keeps the WaitHandle alive. To achieve this, we simply use the SafeWaitHandle inside the WaitHandle by: increasing its ref count when constructing the RegisteredWaitHandle, and decrementing it when unregistering it.
We also increase the count when using it in Wait, so if we execute Unregister and Wait concurrently, we guarantee that the WaitHandle is still valid in Wait, or get an exception if not.
2016-02-16 20:11:58 +00:00
Marek Safar 19c0bab243 [mcs] Add more known sdk paths redirections 2016-02-16 17:39:51 +01:00
Rodrigo Kumpera 9e17248c03 Merge pull request #2603 from kumpera/fix_set_pending_exception
[runtime] Move pending_exception from InternalThread to Thread to avoid crashing on domain unload.
2016-02-16 08:02:23 -08:00
Marcos Henrich 7c5ad4bc38 Merge pull request #2548 from esdrubal/discovery
[System.Web.Services] Fix DiscoveryClientProtocol
2016-02-16 15:54:54 +00:00
Marcos Henrich 455d287931 Merge pull request #2623 from esdrubal/fileinfo_moveto
[corlib] Fix FileInfo.MoveTo with same name.
2016-02-16 13:57:08 +00:00
Alexander Köplinger 58a583e39a Merge pull request #2615 from akoeplinger/fix-perfcounter-free-mem-calculation
[perfcounters] Fix calculation of free memory in mono_determine_physical_ram_available_size ()
2016-02-16 13:08:55 +01:00
Marcos Henrich a86179ebb1 [System.Web.Services] Test DiscoveryClientProtocol
Covers #36116
2016-02-16 11:56:02 +00:00
Marcos Henrich 80fd18926f [corlib] Fix FileInfo.MoveTo with same name.
FileInfo.MoveTo was not moving a file from one directory to another when
the file name did not change.

Fixes #18361.

An ArgumentException when destFileName is an empty array was added,
otherwise FileInfoTest.MoveTo_DestFileName_Empty would fail. Both
Path.GetFullPath and File.Move throw similar exceptions but
MoveTo_DestFileName_Empty expects the one from File.Move so it was added
to this method.
2016-02-16 11:17:19 +00:00
Marcos Henrich 83b7e81324 [corlib] Test FileInfo.MoveTo with files with same name
Covers #18361
2016-02-16 10:34:08 +00:00
Marek Safar 1ffa612eba Bump reference source to fix the build 2016-02-15 20:29:58 +01:00
Vlad Brezae 0e4acb2215 Merge pull request #2562 from BrzVlad/fix-drainstack-stats
[sgen] Drain the gray stack only in finish gray stack
2016-02-16 02:04:55 +07:00
Marek Safar 41af907ee1 [corlib] MethodInfo from reference source 2016-02-15 18:15:34 +01:00
Marek Safar 4574d1aed6 [mcs] Update expression tree generator to use .net 4.5 api when available. Fixes #38703 2016-02-15 17:00:25 +01:00
Alexander Köplinger 6c355350fc [io-layer] Add Get/SetThreadPriority to wapi-remap.h
The new functions were added in d5768a7f14 but not remapped.
2016-02-15 15:22:20 +01:00
Marek Safar d540bdce6d Merge pull request #2619 from directhex/dont_remap_npgsql
Don't remap all versions of Npgsql to 4.0.0.0
2016-02-15 15:20:59 +01:00
Jo Shields ffa6818b96 Don't remap all versions of Npgsql to 4.0.0.0
Mono has a list of assemblies considered "internal", whose versions are automatically remapped to the distro default version.

Since we no longer bundle Npgsql, it is up to individual distributions to package their own Npgsql - but Mono cannot load any version other than 4.0.0.0 from the GAC, due to this remapping:

Mono: Assembly Ref addref npghello[0x17e2fd0] -> mscorlib[0x1789c00]: 2
Mono: The request to load the assembly Npgsql v2.2.7.0 was remapped to v4.0.0.0
Mono: Assembly Loader probing location: '/usr/lib/mono/gac/Npgsql/4.0.0.0__5d8b90d52f46fda7/Npgsql.dll'.

Npgsql, Version=2.2.7.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7
2016-02-15 14:12:52 +00:00
Alexander Köplinger fa1cb5bbf4 [msvc] Update order.xml and csproj files 2016-02-15 15:03:37 +01:00
Alexander Köplinger 4b041deaba [genproj] Fix bashism in library.make
This was added in 2687866e99, but on systems where /bin/sh (which make uses by default) isn't bash this doesn't work.

Fix is to use a standard switch-case which works in all shells.
2016-02-15 15:02:13 +01:00
Alexander Köplinger 0093dcb9fb [msvc] Update .def files 2016-02-15 14:25:03 +01:00
Marcos Henrich 355d2c5eca Merge pull request #2400 from esdrubal/extrahead
[System] Fix extra head in config bug.
2016-02-15 12:21:29 +00:00
Marcos Henrich c1d81649cc Merge pull request #2323 from esdrubal/servicemodel
[System.ServiceModel] Fixes missing xsi xsd attributes
2016-02-15 12:08:21 +00:00
Marek Safar bc6dd59c11 Merge pull request #2613 from knocte/crypto-refsource
[Crypto] Include CngKeyBlobFormat from reference sources (rm old)
2016-02-15 12:39:28 +01:00
Marek Safar c39da8442e [mcs] Populate ProductVersion from all valid sources. Fixes #38553 2016-02-15 12:34:22 +01:00
Alexander Köplinger cd36778d5e [corlib] Add missing semicolon in StringTest 2016-02-14 00:33:34 +01:00
monojenkins c5000ab439 Merge pull request #2608 from ludovic-henry/monoerror-icall
[runtime] Use MonoError for icall.c functions
2016-02-13 11:50:17 +00:00
Alexander Köplinger 0b7588ee2e Merge pull request #2611 from akoeplinger/cleanup
[corlib] Remove FIXME_CORLIB_CMP section from Makefile
2016-02-13 12:45:56 +01:00
monojenkins 15d74eeea3 Merge pull request #2612 from xmcclure/largestring
Do not run 4GB string tests on low memory systems (fixes #38392)

"Low memory" here is defined as 32-bit, less than 6GB of physical RAM, or mobile (since mobile lacks the class for querying physical RAM).

Without this patch, one of the corlib tests allocates 4 GB of RAM, which causes OOM crashes on low-memory Jenkins instances and also mobile phones.
2016-02-13 06:05:32 +00:00
monojenkins e70b51b10b Merge pull request #2442 from schani/fix-larger-tlab-size
[automerge] Fix larger tlab size
2016-02-13 01:06:05 +00:00
Zoltan Varga 86a7259c28 [jit] Add a checked version to mono_resolve_patch_target () so exceptions are thrown in upper level code. 2016-02-12 19:58:46 -05:00
Alexander Köplinger 63a0af9de9 Revert "[Process] Add stress tests"
This reverts commit a7955a93f5.

The Process import commit was reverted in f74f703719,
this reverts the added tests as well since they fail on Jenkins now.
2016-02-13 01:17:35 +01:00
Mark Probst f91af83b92 Merge pull request #2573 from BrzVlad/fix-conc-memusage
[sgen] Improve memory usage with the concurrent collector
2016-02-12 15:09:38 -06:00
monojenkins 9c73dd16eb Merge pull request #2589 from gofman/master
sgen: fix bit counting in mword

Fixes GC crashe for 64-bit architecture when using libmono.
http://lists.ximian.com/pipermail/mono-devel-list/2016-February/043507.html
2016-02-12 20:25:20 +00:00
Alexander Köplinger 335ad88ff5 [perfcounters] Fix calculation of free memory in mono_determine_physical_ram_available_size ()
The implementation added in b5d0ffe7dd forgot to multiply vmstat.free_count (== number of free pages)
by the page size in the __APPLE__ case, making the reported number much smaller than the reality.
2016-02-12 20:56:35 +01:00
monojenkins bac05b3a82 Merge pull request #2585 from lambdageek/dev/bug-38222
[reflection] Signal pending loader error in mono_reflection_get_custom_attrs_data

Fixes [Bugzilla 38222](https://bugzilla.xamarin.com/show_bug.cgi?id=38222)

While we're at it, convert `mono_reflection_get_custom_attrs_data` to use
`MonoError` and mark it external only.  Runtime should use
`mono_reflection_get_custom_attrs_data_checked`
2016-02-12 19:46:20 +00:00
Andi McClure 712bd53f5b Use Assert.Ignore for insufficient-memory test skips 2016-02-12 14:26:50 -05:00
Andrés G. Aragoneses c2d975db44 [Crypto] Include CngKeyBlobFormat from reference sources (rm old)
CngKeyBlobFormat was never included in the build, but anyway
we can include the one from referencesource now.

Detected by a user of Npgsql 3.0.5 which reported the problem
in stackoverflow:
http://stackoverflow.com/questions/35016066/failure-to-resolve-system-security-cryptography-cngkeyblobformat-when-using-npgs
2016-02-13 03:11:16 +08:00
Andi McClure 5e46772795 Do not run 4GB string tests on low memory systems (fixes #38392)
"Low memory" here is defined as 32-bit, less than 6GB of physical RAM,
or mobile (since mobile lacks the class for querying physical RAM).
2016-02-12 13:56:20 -05:00
Alexander Köplinger c18ed4a393 [corlib] Remove FIXME_CORLIB_CMP section from Makefile
Looks like this isn't needed anymore.
2016-02-12 19:34:54 +01:00
Aleksey Kliger (λgeek) 1113ca6b61 Merge pull request #2605 from lambdageek/dev/bug-38408
[io] Release Pipe and Console shared handles
2016-02-12 13:16:44 -05:00
Ludovic Henry f74f703719 Revert "[System] Import System.Diagnostics.Process"
This reverts commit d30e99d172.
2016-02-12 18:14:02 +00:00
Mark Probst 0054a3c7a8 [sgen] Allow TLABs larger than MAX_SMALL_OBJ_SIZE.
`sgen_ensure_free_space()` assumed that if `size` was larger than
`SGEN_MAX_SMALL_OBJ_SIZE`, it should find free space on the major
heap, so it wouldn't consider triggering a nursery allocation.  Making
TLABs larger than that would thus never trigger nursery collections
anymore.

Now we pass in the generation that says where we want space.
2016-02-12 10:03:34 -08:00
Mark Probst bf6787a531 [sgen] Add necessary type cast. 2016-02-12 10:03:34 -08:00
Ludovic Henry 4c632d9848 [runtime] Use MonoError for mono_module_get_types 2016-02-12 16:26:46 +00:00
Ludovic Henry 5366e1320c [runtime] Use MonoError for fill_reflection_assembly_name 2016-02-12 16:26:45 +00:00
Ludovic Henry d07adf1e23 [runtime] Use MonoError for create_version 2016-02-12 16:26:45 +00:00
Ludovic Henry 098fb60e1b [runtime] Use MonoError for type_from_parsed_name 2016-02-12 16:26:44 +00:00
monojenkins b98e050467 Merge pull request #2576 from ludovic-henry/referencesource-process
[System] Import System.Diagnostics.Process
2016-02-12 16:20:44 +00:00
Jo Shields 1c621b0e33 Use X509 serial number in Mono cert store filename
The Mono cert store traditionally uses the SKI for the filename of a certificate, but this does not handle cases where a cert has been reissued with the same SKI but different serial (seen in the wild with StartCom certs). This patch appends the serial to all new imported certs, and attempts to interoperate cleanly with existing serial-less certificate stores to avoid duplication.

Closes: #30902
2016-02-12 16:03:46 +00:00
Alexander Köplinger eb01e40bda Merge pull request #2604 from mattleibow/pcl-mono.dataconverter
[corlib] Ensure PCL compatibility with Mono.DataConverter
2016-02-12 16:38:32 +01:00
Aleksey Kliger f5d1b1f43b [io] Don't leak Pipe filename
Named FIFOs do indeed have names, but pipe_close doesn't free
it.  (Because CreatePipe doesn't set a filename).
2016-02-12 10:11:21 -05:00
Aleksey Kliger 917e4f39bb [io] Release Pipe and Console shared handles
Allows opening a character device or named fifo more than once with code like:

  using (var f = new FileStream ("/dev/zero", FileMode.Open))
  {
    ...
  }
  using (var f = new FileStream ("/dev/zero", FileMode.Open))
  {
    ...
  }
2016-02-12 10:11:21 -05:00
Aleksey Kliger 145064bb5f [io] Test repeatedly opening a character device
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=38408
2016-02-12 10:11:21 -05:00
monojenkins 49673b8318 Merge pull request #2606 from akoeplinger/fix-hardcoded-testports
[System] Fix a few more hardcoded ports in tests

They'd cause "address already in use" errors when two builds are running concurrently on the same machine on Jenkins.

@monojenkins merge
2016-02-12 15:10:24 +00:00
Miguel de Icaza d31a0b0d26 Add link to the updated location for the utf8 test file 2016-02-12 09:31:16 -05:00
Ludovic Henry a7955a93f5 [Process] Add stress tests
That's to ensure we do not have regression in the Process implementation.
2016-02-12 13:56:39 +00:00
Ludovic Henry d30e99d172 [System] Import System.Diagnostics.Process 2016-02-12 13:56:38 +00:00
Alexander Köplinger 1303a46521 [System] Fix a few more hardcoded ports in tests
They'd cause "address already in use" errors when two builds are running concurrently on the same machine on Jenkins.
2016-02-12 14:33:57 +01:00
Zoltan Varga 7751c24771 [jit] Fix the bblock linking in c5512c0d3e. 2016-02-11 23:05:27 -05:00
Martin Baulig a6289bcc41 [Mono.Security]: Make 'Mono.Security.Protocol.Ntlm' public and include in System.dll on mobile.
(cherry picked from commit 2026a0b408)
2016-02-11 17:53:53 -05:00
Miguel de Icaza 6fae7c2ace Remove old, unused code 2016-02-11 16:15:22 -05:00
Matthew Leibowitz aa3654d707 [corlib] Ensure PCL compatibility with Mono.DataConverter 2016-02-11 22:55:02 +02:00
Rodrigo Kumpera 15f5673e36 [runtime] Move pending_exception from InternalThread to Thread to avoid crashing on domain unload.
InternalThread is a fundamentally different type WRT to appdomain. All instances of Thread bound to the same
os thread have a reference to a shared InternalThread.

InternalThread is always allocated in the root domain, so it MUST NOT have references to other domains as
it will lead to crashes on unload.

This was the case with pending_exception. It could point to an exception meant to the domain unloading.

This bug became more and more frequent as we move to use mono_set_pending_exception in more places. I could
reproduce it in 10 minutes of looping appdomain-unload.exe.
2016-02-11 15:17:19 -05:00
Ludovic Henry 469cf0e8b1 Merge pull request #2560 from ludovic-henry/coop-threads-cleanup
[threads] Split abort/suspend into self and async cases
2016-02-11 18:47:49 +00:00
Aleksey Kliger (λgeek) 98a6a07078 Merge pull request #2587 from lambdageek/monoerror-api-cleanup-mistakes
[runtime] Better error handling in mono_{assembly,module_file}_get_object
2016-02-11 12:29:59 -05:00
Marcos Henrich 55648fae3a Merge pull request #2590 from esdrubal/wcf_req
BCL changes required by dotnet/wcf
2016-02-11 17:19:25 +00:00
Ludovic Henry 3b3c62096d Merge pull request #2595 from ludovic-henry/tests-sgen
[tests] Remove manual for loop to run sgen tests and use different make targets
2016-02-11 16:20:45 +00:00
Aleksey Kliger f03e7a86fd [reflection] Better error behavior for API functions
mono_assembly_get_object and mono_module_file_get_object should return
NULL on failure without raising an exception.
2016-02-11 10:28:27 -05:00
Ludovic Henry 430f0fabb1 [tests] Remove manual for loop to run sgen tests and use different make targets 2016-02-11 12:54:07 +00:00
Ludovic Henry 57fb17a533 [threads] Split abort/suspend into self and async cases
Separate the code path for async and self abort/suspend. This make the code intention more clear. It also allows us to remove some unused parameters (can_raise_excetpion which is always TRUE). Add some comments and harmonise locking behaviours : async_suspend_internal and self_suspend_internal now both call UNLOCK_THREAD.
2016-02-11 12:43:59 +00:00
Marek Safar fbae9f9c04 Merge pull request #2598 from dellis1972/master
[msbuild] Registered the XmlPeek Build Task in the Microsoft.Common.tasks
2016-02-11 11:27:51 +01:00
Dean Ellis 96cd1c9e9f [msbuild] Registered the XmlPeek Build Task in the Microsoft.Common.tasks
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=36183
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38638

The previous commit () was incomplete, while it added the source
file for XmlPeek it did not register them in the appropriate
MSBuild tasks files. As a result the XmlPeek task cannot be used.
2016-02-11 10:26:11 +00:00
Zoltan Varga 992da4b5f4 [aot] Fix the check in mono_aot_get_plt_entry () for thumb code, use 'code-4' instead of 'code', since the latter points to after a call, so it could point outside the range of llvm code. Fixes #36723. 2016-02-11 01:14:29 -05:00
Zoltan Varga c5512c0d3e [jit] Add a fastpath to Monitor.Enter () which doesn't have a wrapper, and add a slowpath which has a wrapper, so async stack traces work for threads blocked on monitors. Fixes #38525. 2016-02-10 21:27:23 -05:00
Zoltan Varga a50e09e99f Fix a warning. 2016-02-10 21:26:06 -05:00
Alexander Köplinger ecbcac8a92 [compiler-tester] Fix incorrect failure with Windows paths in error messages
On Windows we saw a failure like the following in mcs tests:

```
cs1589-2.cs...	REGRESSION (CORRECT ERROR -> WRONG ERROR MESSAGE)
Exp: Unable to include XML fragment `/foo/bar' of file `there-is-no-such-file'. Could not find file "*PATH*/there-is-no-such-file"
Was: Unable to include XML fragment `/foo/bar' of file `there-is-no-such-file'. Could not find file "C:\j\workspace\z\label\w64\mcs\errors\there-is-no-such-file"
```

Fixing it by replacing the backslash with forward slash before comparing it to the expected value.
2016-02-11 02:42:18 +01:00
Zoltan Varga 7b9da19971 [jit] Fix the peephole optimization added by 9fc7c1de3a, compare_imm+cond_exc_imm can only be eliminated if the comparison is false. 2016-02-10 20:09:18 -05:00
Miguel de Icaza fb1dcb42d6 Remove table that was not licensed under MIT 2016-02-10 18:15:27 -05:00
Martin Baulig 6a3d08c01b [Mono.Security]: MonoTlsProviderFactory.GetProvider(string) now returns null on error.
(cherry picked from commit 7f965e8220)
2016-02-10 18:14:30 -05:00
Alexander Köplinger 00a7ef8662 Merge pull request #2591 from gofman/cherry-branch
[System.Windows.Forms] Recreate FosterWindow when required in XplatUIWin32
2016-02-11 00:10:55 +01:00
Alexander Köplinger c795ee45d8 Merge pull request #2594 from akoeplinger/fix-facade-lookup-when-mono-path-overriden
[metadata] Fix Facades lookup in assembly.c when MONO_PATH is set
2016-02-10 23:50:44 +01:00
Alex Rønne Petersen 6c0aafcd4e [profiler] Remove perf_event.h from EXTRA_DIST, too. 2016-02-10 23:08:39 +01:00
Alex Rønne Petersen 504aff4244 [profiler] Only include perf_event.h when actually needed, and use the system header. 2016-02-10 22:34:09 +01:00
Alex Rønne Petersen 02d2c8beab [profiler] Remove the bundled perf_event.h header.
Bundling this in Mono is technically a GPL violation. We need to switch to the
system <linux/perf_event.h> header.
2016-02-10 22:26:59 +01:00
Martin Baulig b207a1f133 [Mono.Security]: Add 'MonoTlsProviderFactory.GetProvider(string)'.
Similar to 'SetDefaultProvider(string)', but return the provider instead
of installing it.

(cherry picked from commit 024241f424)
2016-02-10 16:21:10 -05:00
Zoltan Varga e7357b0f3a [llvmonly] Remove some leftover debugging code. 2016-02-10 15:29:29 -05:00
Marek Safar d5a93b13bf [swf] Flow SynchronizationContext through ExecutionContext. Fixes #38599 2016-02-10 20:24:13 +01:00
Alexander Köplinger 6e81edfa24 [metadata] Fix Facades lookup in assembly.c when MONO_PATH is set
When MONO_PATH is set, the corlib lookup returns early on in mono_assembly_load_corlib (),
without adding the Facades dir to default_path.

This causes any app/library that relies on the facades to fail at runtime.

Fixing this by always doing the Facades lookup when returning the found corlib image.
2016-02-10 19:03:31 +01:00
Marcos Henrich cabf2f2651 [corlib] Adds property AccessToken to WindowsIdentity
System.Security.Principal.WindowsIdentity.AccessToken is required for
dornet/wcf to compile.
2016-02-10 15:18:21 +00:00
Marcos Henrich 5aac2bf16e Impelements IDisposable in X509Store
This class implement IDisposable in .NET and dotnet/wcf depends on this
to compile.
2016-02-10 15:18:21 +00:00
Paul Gofman f082bf0a37 [System.Windows.Forms] Recreate FosterWindow when required in XplatUIWin32
Fixes #38614
2016-02-10 17:47:39 +03:00
Marcos Henrich 1710cecfa1 [System.Net.Security] Adds NegotiateStream methods
System.Net.Security was missing some methods that are used by
dotnet/wcf.
2016-02-10 13:41:11 +00:00
Marcos Henrich 94d400b9b0 [corlib] Added missing properties to EventAttribute 2016-02-10 13:41:10 +00:00
Paul Gofman 3926a95c65 sgen: fix bit counting in mword
Fixes GC crashe for 64-bit architecture when using libmono.
http://lists.ximian.com/pipermail/mono-devel-list/2016-February/043507.html
2016-02-10 13:58:26 +03:00
Marek Safar 35889d4bc2 [corlib] Use correct max/min value for DateTime overflows. Fixes #35876 2016-02-10 03:23:34 -06:00
Marek Safar 8d84a78684 [System] Simple readability changes to SimpleAsyncResult 2016-02-10 03:23:34 -06:00
Zoltan Varga 9fc7c1de3a [jit] Add a peephole optimization to remove the ldaddr+compare_imm 0+cond_exc checks inserted when using explicit null checks. 2016-02-10 01:59:22 -05:00
Zoltan Varga 2a2fac326c [llvmonly] Disable the 'overriding the module target triple with' clang warning when compiling the bitcode files. 2016-02-10 01:10:38 -05:00
Zoltan Varga 8fde659b0d [llvmonly] Fix a few issues passing and returning vtypes smaller than one machine word. 2016-02-10 00:46:57 -05:00
Zoltan Varga a6068096de [llvmonly] Fix the locking in the gsharedvt wrapper creation functions. 2016-02-09 21:55:44 -05:00
monojenkins 1b232dfb39 Merge pull request #2584 from lewurm/fix-mobile-compilation
[bcl] fix compilation of test on mobile

although a nunit category is specified, the compilation still failed on mobile.
2016-02-10 02:20:32 +00:00
Aleksey Kliger f758ac67e0 [reflection] Set pending loader exception in mono_reflection_get_custom_attrs_data
Fixes [Bugzilla 38222](https://bugzilla.xamarin.com/show_bug.cgi?id=38222)

While we're at it, convert mono_reflection_get_custom_attrs_data to use
MonoError and mark it external only.  Runtime should use
mono_reflection_get_custom_attrs_data_checked
2016-02-09 19:53:15 -05:00
Bernhard Urban d022f26e2e [bcl] fix compilation of test on mobile
fix for the following problem:
> [13:33:37] src/System/Test/System.Diagnostics/ProcessTest.cs(1048,19): error CS0103: The name `GetCrossPlatformStartInfo' does not exist in the current context
2016-02-09 15:07:19 -08:00
monojenkins 64c5ac3d07 Merge pull request #2582 from ludovic-henry/fix-threadpool-starvation
[threadpool] Improve the monitor thread heuristic

Because the ThreadPool heuristic is optimized for short lived work item, it has more difficulty when executing long lived work item. That case can lead to a starvation of the worker threads: they are all doing work, while there is outstanding request, and these requests are not satisfied because we reached the max number of working thread.

To fix that issue, we have the monitor thread, whose sole job is to unstuck this kind of starvation cases. Unfortunately, it only works when all the worker threads are in the ThreadState.WaitSleepJoin state, which excludes the case of calling an IO operation in a Task. That includes the case of FileStream.BeginRead/Write/... which implementation can be simplified as follows: FileStream.BeginRead(...) -> Task.Run(() => FileStream.Read(...)).

The way we implement it in this commit is: every MONITOR_INTERVAL (500ms here), we check if there is any outstanding request, and if so, we assume that we are in the starvation case, and we simply increase the max number of working thread. Also to reduce the number of false positives, we do that only if there has been no completed work item for more than at least MONITOR_INTERVAL (in case of low CPU usage, more otherwise, see monitor_sufficient_delay_since_last_dequeue). This case is typically the case where we have all working thread stuck in long running work items.

Finally we increase the monitor interval from 100ms to 500ms so we guarantee we do not create more than 2 threads per second in the monitor thread. That is the value used by the old threadpool.
2016-02-09 23:00:32 +00:00
Miguel de Icaza 9d35944f55 [Docs] handle code-markdown with dots on the names 2016-02-09 17:05:34 -05:00
Miguel de Icaza 871115c2d8 [Docs] Continue to improve the Mono runtime documentation 2016-02-09 15:52:58 -05:00
Aleksey Kliger (λgeek) 52b80e6c68 Merge pull request #2570 from lambdageek/monoerror-reflection-bubble-2
[reflection] Grab bag of MonoError commits
2016-02-09 15:52:52 -05:00
Ludovic Henry 35c13bfe55 [threadpool] Improve the monitor thread heuristic
Because the ThreadPool heuristic is optimized for short lived work item, it has more difficulty when executing long lived work item. That case can lead to a starvation of the worker threads: they are all doing work, while there is outstanding request, and these requests are not satisfied because we reached the max number of working thread.

To fix that issue, we have the monitor thread, whose sole job is to unstuck this kind of starvation cases. Unfortunately, it only works when all the worker threads are in the ThreadState.WaitSleepJoin state, which excludes the case of calling an IO operation in a Task. That includes the case of FileStream.BeginRead/Write/... which implementation can be simplified as follows: FileStream.BeginRead(...) -> Task.Run(() => FileStream.Read(...)).

The way we implement it in this commit is: every MONITOR_INTERVAL (500ms here), we check if there is any outstanding request, and if so, we assume that we are in the starvation case, and we simply increase the max number of working thread. Also to reduce the number of false positives, we do that only if there has been no completed work item for more than at least MONITOR_INTERVAL (in case of low CPU usage, more otherwise, see monitor_sufficient_delay_since_last_dequeue). This case is typically the case where we have all working thread stuck in long running work items.

Finally we increase the monitor interval from 100ms to 500ms so we guarantee we do not create more than 2 threads per second in the monitor thread. That is the value used by the old threadpool.
2016-02-09 19:55:05 +00:00
Aleksey Kliger adc643c1de [reflection] Fix decl of mono_image_create_token
For the DISABLE_REFLECTION_EMIT case
2016-02-09 13:34:39 -05:00
Aleksey Kliger 8525f17c29 [reflection] Mark mono_custom_attrs_construct external only
The function mono_custom_attrs_construct_by_type is available for the
runtime (though currently static) and uses MonoError for error handling.
2016-02-09 12:15:59 -05:00
Aleksey Kliger d02d6748cd [reflection] Use MonoError in mono_reflection_marshal_as_attribute_from_marshal_spec 2016-02-09 12:15:59 -05:00
Aleksey Kliger e3b6e1a437 [runtime] Use MonoError for mono_event_get_object
Mark mono_event_get_object external only.
Runtime should use mono_event_get_object_checked.
2016-02-09 12:15:58 -05:00
Aleksey Kliger bae91c3476 [runtime] Use MonoError for mono_property_get_object
Mark mono_property_get_object external only.
Runtime should use mono_property_get_object_checked.
2016-02-09 12:15:58 -05:00
Aleksey Kliger 410c12cc8d [reflection] Push MonoError through some static functions 2016-02-09 12:15:57 -05:00
Aleksey Kliger 61803caa3f [debugger] Don't call buffer_add_objid with NULL
Fixup 64778857e4
2016-02-09 12:15:57 -05:00
Aleksey Kliger b8958da981 [runtime] Cleanup MonoError after mono_runtime_try_invoke
If both an exception exc is set and the MonoError is not ok, we could
leak the MonoError memory.  Explicitly cleanup.
2016-02-09 12:15:15 -05:00
Aleksey Kliger caea43b94e [mini] Use catchExcInMonoError to decide if exc should be embedded in MonoError
Do the dyn_runtime_invoke decision the same way as other invokes.

Fixup to 45bd9bb5d5
2016-02-09 12:15:15 -05:00
Aleksey Kliger 407b2d359c [runtime] Don't raise MonoError when unloading appdomain
There's no managed code calling mono_domain_try_unload, so raising was
wrong.  Thread the error out through exc which gets checked by callers.

Fixup for 45bd9bb5d5
2016-02-09 12:15:14 -05:00
Miguel de Icaza 1ea52ba655 [Docs] document one of our most key APIs: mono_add_internal_call 2016-02-09 12:05:24 -05:00
Miguel de Icaza 81b7022800 [Docs] Improved the rendering, added some docs 2016-02-09 11:46:46 -05:00
monojenkins 3cdd142b66 Merge pull request #2579 from ludovic-henry/fix-asyncresult-unhandledexception
[AsyncResult] Fix unhandled exception behaviour in AsyncCallback

The AsyncCallback is called after the BeginInvoke has completed. In all cases, this AsyncCallback is called on the ThreadPool, meaning that an unhandled exception would lead to a process crash.

The correct behaviour, after verification on .NET, is to not swallow the exception, and to properly crash the process.

@monojenkins merge
2016-02-09 12:25:36 +00:00
Ludovic Henry f8d3526a7f [AsyncResult] Fix unhandled exception behaviour in AsyncCallback
The AsyncCallback is called after the BeginInvoke has completed. In all cases, this AsyncCallback is called on the ThreadPool, meaning that an unhandled exception would lead to a process crash.

The correct behaviour, after verification on .NET, is to not swallow the exception, and to properly crash the process.
2016-02-09 10:48:05 +00:00
Marek Safar 7ecd89abdb [corlib] AppContext from reference source 2016-02-09 11:35:09 +01:00
Miguel de Icaza b2b2db1b45 [Docs] Use an external style sheet, prefix the css classes with mapi to isolate, fix various processing problems 2016-02-08 22:00:13 -05:00
Alexander Köplinger 41262dbad6 Merge pull request #2578 from akoeplinger/fix-hardcoded-mono-2.0-path
[metadata] Fix hardcoded mono/2.0 path in assembly.c
2016-02-09 02:31:21 +01:00
Zoltan Varga 7500f5d7a2 [llvmonly] Compile the bitcode files using -O2. 2016-02-08 20:02:04 -05:00
monojenkins 2c18735a5d Merge pull request #2577 from xmcclure/bugzilla-37834
Recognize OS X file "locked" state (fixes #37834)

Quick fix for https://bugzilla.xamarin.com/show_bug.cgi?id=37834

IOLayer is_file_writable/System.IO.File.GetAttributes on posix systems looks only at the unix file permissions and does not consider special OS flags. This leads to an easily end-user-triggered bug on OS X if a mono app (the bug was observed in Xamarin Studio) uses GetAttribute on a file which has been "Locked" using the checkbox in Finder Get Info. This patch recognizes the "uchg" flag for non-writability which Finder uses.
2016-02-09 00:45:26 +00:00
Zoltan Varga 392f09c813 [llvmonly] Add unbox wrappers when invoking vtype instance methods through a delegate. 2016-02-08 19:21:53 -05:00
Miguel de Icaza b2cc4e2aba [Documentation] Fix the nesting of docs 2016-02-08 17:15:17 -05:00
Alexander Köplinger 769037d8b1 [metadata] Fix hardcoded mono/2.0 path in assembly.c
The performance team discovered this on their bots using the Jenkins snapshot packages. Mono would fail to start with a message like:

```
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/opt/mono-2016.02.08+15.25.39/lib/mono/4.5/mscorlib.dll' directory.
```

The one odd thing is that they are using Mono installed in a path which is different from the prefix used during compilation.

It turns out that the runtime has a hardcoded check for lib/mono/2.0 in https://github.com/mono/mono/blob/7d5a7ea7ac324bb4ee63094ddcf8e20ae9ba4322/mono/metadata/assembly.c#L633-L637.
Since we recently stopped shipping 2.0 in the packages (we moved to 2.0-api for the reference assemblies) this directory wasn't there,
so the code in fallback() called into mono_config_get_assemblies_dir() which just returns the MONO_ASSEMBLIES preprocessor symbol.

That preprocessor symbol is defined to the value of --prefix during compilation, so Mono couldn't find corlib there as well since it's installed in another path which ultimately results in the above error message.

The fix is to change the hardcoded value to 4.5, which is what we established as the directory with the "latest" assemblies now.
Ideally we should find a way to stop hardcoding those paths in the runtime.

PS: I grepped through the runtime source to make sure we don't hardcode 2.0/3.5/4.0 elsewhere and only found one instance in a test.
I fixed it there as well, though the test looks suspicious since it hardcodes /usr ...
2016-02-08 21:44:47 +01:00
Miguel de Icaza 7d5a7ea7ac [docs] Improve the rendering of our API binding APIs and runtime API documentation 2016-02-08 15:02:07 -05:00
Andi McClure 9c4cb7ff9d Support OS X "locked" state (fixes #37834)
IOLayer is_file_writable/System.IO.File.GetAttributes on posix systems
looks only at the unix file permissions and does not consider special
OS flags. This leads to an easily end-user-triggered bug on OS X if a
mono app (the bug was observed in Xamarin Studio) uses GetAttribute on
a file which has been "Locked" using the checkbox in Finder Get Info.
This patch recognizes the "uchg" flag for non-writability which Finder
uses.
2016-02-08 15:01:45 -05:00
Aleksey Kliger (λgeek) 79ccd5ed96 Merge pull request #2555 from lambdageek/monoerror-mono_runtime_invoke-2
Use MonoError for mono_runtime_invoke
2016-02-08 14:12:47 -05:00
Alexander Köplinger 1e1c4970c4 [mcs] Use $(PLATFORM_PATH_SEPARATOR) instead of ':' for MONO_PATH to fix Windows tests
./ was added to MONO_PATH in b5c2b5892f, but the Unix path separator ':' doesn't work on Windows.
2016-02-08 19:16:19 +01:00
Alexander Köplinger 0bfc83e5c0 [msvc] Fix Debug build by disabling outdated projects in sln 2016-02-08 19:16:13 +01:00
Aleksey Kliger (λgeek) 96ed839b0b Merge pull request #2571 from lambdageek/monoerror-mono_assembly_get_object
Use MonoError in mono_assembly_get_object
2016-02-08 13:08:28 -05:00
Alexander Köplinger a4f6ac0700 [System.Runtime.Caching] Make TestExpiredGetValues test more reliable
It failed twice on Jenkins over the weekend:

```
Test Case Failures:
1) MonoTests.System.Runtime.Caching.MemoryCacheTest.TestExpiredGetValues :   #EGV4
  Expected: 0
  But was:  9

at MonoTests.System.Runtime.Caching.MemoryCacheTest.TestExpiredGetValues () [0x0012b] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/System.Runtime.Caching/Test/System.Runtime.Caching/MemoryCacheTest.cs:1304
```

We're sleeping just as long as the expiry time of the cache items (1s) which might not be enough.
Bumping the sleep time should fix this.
2016-02-08 17:05:07 +01:00
Alexander Köplinger dc085eacec [readme] Clarify --enable-parallel-mark description
It's Boehm only and not enabled by default on some platforms (e.g. it's disabled on OSX).
2016-02-08 17:05:07 +01:00
Aleksey Kliger 45bd9bb5d5 [runtime] Switch to mono_runtime_invoke_checked and mono_runtime_try_invoke
Mark mono_runtime_invoke external only.
Runtime should use mono_runtime_invoke_checked and mono_runtime_try_invoke.
2016-02-08 10:51:48 -05:00
Ludovic Henry 2ce7cde678 [runtime] Use MonoError for mono_jit_runtime_invoke and mono_llvmonly_runtime_invoke 2016-02-08 10:51:47 -05:00
Aleksey Kliger 64778857e4 [reflection] Use MonoError in mono_assembly_get_object
Mark mono_assembly_get_object external only.
Runtime should use mono_assembly_get_object_checked.

Also propagated MonoError through a few static functions in reflection:
mono_reflection_get_type_internal () and
mono_reflection_get_type_internal_dynamic ()
2016-02-08 10:47:49 -05:00
Rodrigo Kumpera 35c22df6fc Merge pull request #2574 from abrasive/gcc5_fix_gc
libgc: use __builtin_frame_address in GC_approx_sp
2016-02-08 06:30:16 -08:00
Rodrigo Kumpera e9639b0881 Merge pull request #2575 from alexrp/master
[profiler] Fix a rare crash when sending SIGPROF to a starting thread.
2016-02-08 06:27:34 -08:00
Vlad Brezae 69915c0c98 [sgen] Improve memory usage with the concurrent collector
The concurrent collector typically uses more memory because more memory is allocated during the concurrent phase, which also leads to more objects surviving the major collections and higher allowances. We improved the memory situation by forcing synchronous finishing of the concurrent mark if too much memory is allocated during the concurrent mark phase. Still, this doesn't tackle the underlying problem. Even if we have less memory allocated during the CMS phase, some is still allocated and leads to increased overall memory usage. And how much memory growth should we allow in the first place ? The even greater problem is that it appears to force a lot of synchronous finishes, significantly increasing finishing pause times.

This commit attempts to solve this problem by following an ideal mathematical approach. We use the following notations : H - heap size at start of major collection, Gs - heap growth during sync collection, Gc - heap growth during conc collection, s - survival rate of the collection, a - allowance ratio (0.33), Ts - trigger for next major sync, Tc - trigger for next major conc.

Assume we have the heap size H at the start of a major collection. For the two types of majors we would have :
Ts = (H + Gs) * s * (a + 1)
Tc = (H + Gc) * s * (a + 1)

Obviously the problem is that Gc > Gs, which leads to Tc > Ts and higher memory usage. In order to have the two triggers equal we need to find an X that we can subtract from Tc to obtain Ts. Considering Gs = 0 (only a few nursery objects are promoted during a major sync collection) and similar survival rates for the two types of collection, we get X = Gc * s * (a + 1). In order to get equal triggers we would need to subtract this value from the allowance computed after a concurrent collection.

The more the heap grows, the more X grows. If X gets bigger than the available starting allowance ((H + Gc) * s * a), it would mean that we are trying to set a trigger that it is lower than the actual heap size at the end of the collection (which means we already exceeded the target memory usage). In order to avoid this problem we need to enforce Tc - X > (H + Gc) * s. Doing the substitutions we get Gc < a * H. When the heap growth exceeds this value it means we need to force the finish of the concurrent collection.
2016-02-08 16:22:12 +02:00
Vlad Brezae 10130afaf5 [sgen] Drain the gray stack only in finish gray stack
This was also causing, at the statistics level, an increased time spent in scanning pinned objects rather than in finishing the gray stack.
2016-02-08 16:19:01 +02:00
Alex Rønne Petersen 6a8d4f97db [profiler] Fix a rare crash when sending SIGPROF to a starting thread.
When sample profiling is enabled and we send a SIGPROF signal to a thread that
hasn't yet transitioned to a running state (e.g. STATE_RUNNING), the signal can
sometimes be delivered at such an early point that libc has not even finished
initializing TLS for that thread yet. This is problematic because we then go
right on to crash in the SIGPROF signal handler when we try to save errno. We
then further crash in the SIGSEGV handler because we can't access the jit_tls
variable either.

The fix is fairly simple: Only send SIGPROF to threads that have transitioned
to a running state. Technically, TLS is initialized 'much' earlier than when
this state transition happens, but since the worst thing that can happen is
that we miss one sampling event (i.e. ~1sec by default) right at the beginning
of the thread's lifetime, this simple fix is good enough.

This crash seemingly only happened on OS X.
2016-02-08 12:06:35 +01:00
Zoltan Varga d7d12118ea [llvmonly] Disable tail calls as they break stack traces. 2016-02-08 02:28:28 -05:00
Zoltan Varga e530d9da73 [llvm] Make the stack walk code return. 2016-02-08 02:27:33 -05:00
James Laird-Wah cd293cc37a libgc: use __builtin_frame_address in GC_approx_sp
With GCC 5.x, the compiler optimises away the dummy load used to
estimate the stack pointer address in GC_approx_sp; it returns
zero. This leads to segfaults when embedding Mono.

Instead, use __builtin_frame_address, which GCC's libgc uses for
the same purpose.
2016-02-08 10:19:53 +11:00
Zoltan Varga a1d805a7f0 [llvmonly] Compile the bitcode files using -O2 (only in desktop llvmonly mode). 2016-02-06 21:11:10 -05:00
Zoltan Varga f66654814e [llvm] When storing valuetypes received in registers to the stack, store only the value parts of the register, the upper bits might container garbage. 2016-02-06 21:11:10 -05:00
Aleksey Kliger (λgeek) 636c0c95cc Merge pull request #2567 from lambdageek/monoerror-mono_module_file_get_object
[reflection] Use MonoError in mono_module_file_get_object
2016-02-06 11:08:39 -05:00
Zoltan Varga 14fa173b59 [jit] Disable to returning of trampolines from mini_jit_info_table_find () to see whenever that fixes failures on wrench. 2016-02-06 03:09:50 -05:00
Zoltan Varga 8f4576a988 [llvmonly] Remove the mono_llvmonly_get_calling_assembly () workaround since stack walks work in llvmonly mode now. 2016-02-06 01:59:38 -05:00
Aleksey Kliger 8f0ecc7960 [reflection] Use MonoError in mono_module_file_get_object
Mark mono_module_file_get_object external only.
Use mono_module_file_get_object_checked in runtime code.
2016-02-05 16:09:29 -05:00
Zoltan Varga b7b402c897 Fix the build. 2016-02-05 15:22:11 -05:00
Andi McClure a4dbd15840 Merge pull request #2569 from xmcclure/gshared-enable
Miscellaneous minor improvements around amd64 aot
2016-02-05 13:39:58 -05:00
João Matos 3a85d50602 Fixed compiler to wrap paths with embedded spaces when calling external tools.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=34498.
2016-02-05 16:58:19 +00:00
Rolf Bjarne Kvinge dcd84c2014 [corlib] Disable ThreadLocalTests.DisposeOnThreadExit on MonoTouch, it's randomly failing. 2016-02-05 16:46:52 +01:00
Alexander Köplinger 5262fc2862 Merge pull request #2572 from akoeplinger/fix-monodoc-language
[monodoc] Fix literal formatting on systems where decimal separator is not a dot
2016-02-05 16:14:05 +01:00
Zoltan Varga efc6803ce0 [llvmonly] Various small fixes. Make mono_llvm_throw_exception etc. directly callable in static mode. Add support for directly calling pinvoke methods. Fix an assertion during EH. 2016-02-05 02:07:46 -05:00
Miguel de Icaza 4c3a5f8101 [Docs] More API docs 2016-02-04 23:14:06 -05:00
Zoltan Varga 6bca78d1bb [llvmonly] Don't set the invariant.load flag on loads from the GOT, they are initialized by a call to init_method () so they are not completely invariant. 2016-02-04 22:40:44 -05:00
Zoltan Varga c4037092ac Revert "[jit] Don't allocate memory for unused vreg"
This reverts commit 137c0999cc.

Revert this as leads to a memory overwrite on x86:

			defs [ins->dreg + 1] = NULL;
2016-02-04 19:03:20 -05:00
Andi McClure 8a0913da7c Move some amd64 constants out of source into header 2016-02-04 14:11:45 -05:00
Andi McClure 528b7e05ca Clarify trampoline error message in aot-runtime 2016-02-04 13:43:03 -05:00
Aleksey Kliger (λgeek) 7c8c564937 Merge pull request #2566 from lambdageek/monoerror-mono_module_get_object
[reflection] Use MonoError for mono_module_get_object
2016-02-04 10:26:54 -05:00
Aleksey Kliger (λgeek) bb60f239b7 Merge pull request #2535 from lambdageek/monoerror-reflection-bubble
[reflection] Push MonoError through misc methods
2016-02-04 10:26:25 -05:00
Marek Safar 3bab012ec8 [System] Remove explicit sdk target from CSharpCodeCompiler 2016-02-04 16:04:33 +01:00
Ludovic Henry 6632cfeb1b [io-layer] Print from which pipe we just read 2016-02-04 14:30:55 +00:00
Ludovic Henry 47d80e598b [Process] Fix possible double call to Begin(Output|Error)ReadLine
This is not allowed in .NET, as it could lead to unexpected results.
2016-02-04 14:30:25 +00:00
Ludovic Henry 50e93af96f [threads] Remove mono_thread_notify_pending_exc_fn dead code 2016-02-04 13:40:16 +00:00
Ludovic Henry c56f741382 [thread] Remove mono_thread_info_begin_suspend unused parameter 2016-02-04 13:38:51 +00:00
Ludovic Henry cf2366f2c0 [threads] Remove unecessary block/unblock suspend ACK signal
Blocking suspend_ack_signal_mask is only useful if we are notifying the initiator of suspend followed by waiting on the suspend_signal_mask.
2016-02-04 13:38:25 +00:00
Marek Safar 47a835d26f [mcs] Update sdk profile paths after 88b287f065 2016-02-04 14:09:59 +01:00
Alexander Köplinger 6f7aee2d55 [monodoc] Fix literal formatting on systems where decimal separator is not a dot
E.g. on a German language OS the "make check-mdoc-export-html" test fails with this:

```
diff --exclude=.svn -rup Test/en.expected/Mono.DocTest/Widget.xml Test/en.actual/Mono.DocTest/Widget.xml
--- Test/en.expected/Mono.DocTest/Widget.xml	2015-11-18 04:42:11.000000000 +0100
+++ Test/en.actual/Mono.DocTest/Widget.xml	2016-02-04 02:38:09.000000000 +0100
@@ -1061,8 +1061,8 @@
       </Docs>
     </Member>
     <Member MemberName="PI">
-      <MemberSignature Language="C#" Value="protected const double PI = 3.14159;" />
-      <MemberSignature Language="ILAsm" Value=".field familyorassembly static literal float64 PI = (3.14159)" />
+      <MemberSignature Language="C#" Value="protected const double PI = 3,14159;" />
+      <MemberSignature Language="ILAsm" Value=".field familyorassembly static literal float64 PI = (3,14159)" />
       <MemberType>Field</MemberType>
       <AssemblyInfo>
         <AssemblyVersion>0.0.0.0</AssemblyVersion>
@@ -1070,7 +1070,7 @@
       <ReturnValue>
         <ReturnType>System.Double</ReturnType>
       </ReturnValue>
-      <MemberValue>3.14159</MemberValue>
+      <MemberValue>3,14159</MemberValue>
       <Docs>
```

The fix is to always use InvariantCulture for literal formatting.
2016-02-04 02:40:19 +01:00
Zoltan Varga bac71d3d9a [llvm] Zero extend unsigned enum arguments. Fixes #38379. 2016-02-03 18:16:09 -05:00
Andi McClure 9025515fa1 Add --exclude-test option to mono/mini test driver 2016-02-03 17:16:59 -05:00
Andi McClure 2eaf673309 Minor additions to comments around amd64 aot 2016-02-03 17:16:01 -05:00
Andi McClure e6ca0ea07f Changes to gsharedvt amd64 tests
Re-enable tests, add a test for long/float returning gsharedvt->normal
for a static method, add tests for sign extension.
2016-02-03 17:15:27 -05:00
Aleksey Kliger 429502c06d [reflection] Use MonoError for mono_module_get_object
Mark mono_module_get_object external only.
Runtime should use mono_module_get_object_checked.
2016-02-03 17:02:54 -05:00
Aleksey Kliger 979b268228 [reflection] Use MonoError in mono_image_get_{method,ctor}_on_inst_token 2016-02-03 15:32:07 -05:00
Aleksey Kliger be38cc5569 [reflection] Use MonoError for mono_image_get_{method,ctor}builder_token 2016-02-03 15:32:06 -05:00
Aleksey Kliger 813f22c8e7 [reflection] Use MonoError in mono_image_create_pefile 2016-02-03 15:32:06 -05:00
Aleksey Kliger e9a35ddd9e [reflection] Don't raise in mono_image_get_method_info 2016-02-03 15:32:05 -05:00
Aleksey Kliger 4a9e62ed95 [reflection] Don't raise in reflection_methodbuilder_from_{method,ctor}_builder 2016-02-03 15:32:05 -05:00
Aleksey Kliger f8c7f3bdf5 [reflection] Don't raise in mono_type_get_object_checked 2016-02-03 15:32:04 -05:00
Aleksey Kliger d062f8b938 [reflection] Use MonoError for mono_image_create_method_token 2016-02-03 15:32:03 -05:00
Aleksey Kliger 224ec8dd10 [reflection] Use MonoError for mono_image_build_metadata 2016-02-03 15:32:03 -05:00
Aleksey Kliger f2d480265a [reflection] Use MonoError in mono_image_create_token 2016-02-03 15:32:02 -05:00
Aleksey Kliger 15392a5d3f [reflection] Use MonoError in some static functions
Pass a MonoError argument to:
method_encode_code, mono_image_basic_method, mono_image_get_ctor_info
2016-02-03 15:32:02 -05:00
Alexander Köplinger 30490c7641 Merge pull request #2542 from akoeplinger/remove-changelog
Remove ChangeLog files from the repo
2016-02-03 21:09:24 +01:00
Rodrigo Kumpera 411d5d1397 Merge pull request #2554 from ludovic-henry/coop-blocking-interrupt
[coop] Use signals for blocking syscall interrupt
2016-02-03 15:08:35 -05:00
Rodrigo Kumpera 8d8d19ea88 Merge pull request #2559 from lewurm/hazard-pointer-clear
[hazard pointers] add write barrier on clear as well
2016-02-03 14:53:55 -05:00
Alexander Köplinger a44d3c650c [binary-reference-assemblies] Add a symlink from 4.0/mscorlib.dll to 4.0-api/mscorlib.dll
Some programs like NUnit check if a file exists there and break otherwise.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38331
2016-02-03 19:45:25 +01:00
Alexander Köplinger 84d0bbae5d [docs] remove a deleted file from EXTRA_DIST 2016-02-03 19:24:30 +01:00
Alexander Köplinger 62aa412f82 Revert "[rules.make] to support 'make dist' on MacOS"
This reverts commit a234d21471.

It isn't necessary after f1dad87178.
2016-02-03 19:23:21 +01:00
Miguel de Icaza 6cfa9c7d64 [Runtime Documentation] More work on runtime documentation 2016-02-03 13:18:42 -05:00
Bernhard Urban 09cf055584 [hazard pointers] add write barrier on clear as well 2016-02-03 10:09:37 -08:00
Ludovic Henry 9049d5a0f0 [coop] Use signals for blocking syscall interrupt 2016-02-03 16:56:19 +00:00
Miguel de Icaza b8462def3c [Documentation] Document some of Mono's embedding API, improve the style 2016-02-03 10:11:19 -05:00
Miguel de Icaza e0ac73928f Remove stale files 2016-02-03 09:26:40 -05:00
Miguel de Icaza a234d21471 [rules.make] to support 'make dist' on MacOS 2016-02-03 09:24:14 -05:00
Miguel de Icaza a173648983 Document Coop mode in README 2016-02-03 09:24:14 -05:00
Ludovic Henry b9844d2404 [test] Use using TimerTest 2016-02-03 13:51:41 +00:00
Ludovic Henry e83200abaf [tests] Use explicit delegates to get more information from stacktrace 2016-02-03 13:11:04 +00:00
Ludovic Henry ecb8958e29 [proc] Fix potential buffer overflow 2016-02-03 12:42:25 +00:00
monojenkins ac32aa114a Merge pull request #2530 from lambdageek/monoerror-mono_string_new
[runtime] Use MonoError for mono_string_new

We are refraining from changing runtime callers of `mono_string_new` to `mono_string_new_checked` in one commit. String creation is used in several hundred places and threading error handling through all the callers is very intrusive. Additionally, AFAIK the only error condition from mono_string_new is out-of-memory. In a lot of cases there's no way to meaningfully recover.

We should revisit individual callers when it makes sense, but just mechanically updating everywhere doesn't get us a lot of benefit.
2016-02-03 06:45:23 +00:00
Miguel de Icaza fcb3e8d260 Remove from the documentation non-public APIs, or move to files that flag them as internal 2016-02-02 22:32:14 -05:00
monojenkins 50fe4789db Merge pull request #2524 from lambdageek/monoerror-mono_string_new_utf16_checked
[runtime] Use MonoError for mono_string_new_utf16
2016-02-03 03:32:00 +00:00
Miguel de Icaza a33c828c85 Updated the runtime template documentation with all new APIs in Mono 2016-02-02 22:05:29 -05:00
monojenkins 58cc5d1bd1 Merge pull request #2518 from lambdageek/monoerror-mono_method_get_object
[runtime] Use MonoError for mono_method_get_object

Depends on #2532 

Issues:

- [x] ~~depends on #2486~~
- [x] ~~Should use `mono_object_new_checked` #2532~~ 
- [x] ~~Should use `mono_string_new_checked`~~ (`mono_string_new` will assert instead of raising an exception - #2530)
2016-02-03 02:25:22 +00:00
Zoltan Varga f2b539b95e [llvmonly] Implement support for stack walks if _Unwind_Backtrace () is available. 2016-02-02 19:35:26 -05:00
Aleksey Kliger f392080f21 [runtime] Switch to mono_method_get_object_checked
Mark mono_method_get_object external only.
2016-02-02 19:20:08 -05:00
Aleksey Kliger eeabfa9a06 [runtime] Use MonoError for mono_method_get_object 2016-02-02 19:20:08 -05:00
Aleksey Kliger b2697dd062 [reflection] Fix build breakage 2016-02-02 19:13:24 -05:00
monojenkins 477d3962f6 Merge pull request #2558 from lewurm/thread-suspension-race
[threads] avoid race between setting the state flag and suspension

there's a short window where we release the lock and another thread
could modify the state.  That is what we saw on the ARM machines for a
while, e.g. in `subthread-exit.cs` there's a race between
`mono_thread_execute_interruption` and `mono_thread_suspend_all_other_threads`:

> Thread 2 (Thread 0x429ff430 (LWP 5189)):  // SUB THREAD
> #0  0x40398e30 in nanosleep () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1  0x0028c0ac in monoeg_g_usleep (microseconds=86650) at gdate-unix.c:53
> #2  0x0027b1d8 in suspend_sync_nolock (id=1079603792, interrupt_kernel=1) at mono-threads.c:913
> #3  0x0027b2d4 in mono_thread_info_safe_suspend_and_run (id=1079603792, interrupt_kernel=1, callback=0x1ab109 <suspend_thread_critical>, user_data=0x429fe534)
>     at mono-threads.c:935
> #4  0x001ab28a in suspend_thread_internal (thread=0x401c0120, interrupt=1) at threads.c:4807
> #5  0x001a91ec in mono_thread_suspend_all_other_threads () at threads.c:3297
> #6  0x00158d8c in ves_icall_System_Environment_Exit (result=0) at icall.c:6378
> #7  0x400e7d9c in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>
> Thread 1 (Thread 0x40597250 (LWP 5186)):  // MAIN THREAD
> #0  0x4039a5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1  0x4039796e in do_futex_wait () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #2  0x403979da in sem_wait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #3  0x002788d8 in mono_os_sem_wait (sem=0x388248, flags=MONO_SEM_FLAGS_NONE) at ../../mono/utils/mono-os-semaphore.h:163
> #4  0x00279722 in mono_thread_info_wait_for_resume (info=0x388210) at mono-threads.c:144
> #5  0x0027ad5e in mono_thread_info_end_self_suspend () at mono-threads.c:700
> #6  0x001ab2d2 in self_suspend_internal (thread=0x401c0120) at threads.c:4822
> #7  0x001aab0a in mono_thread_execute_interruption () at threads.c:4337
> #8  0x001a6a82 in ves_icall_System_Threading_Thread_Sleep_internal (ms=1200) at threads.c:1217
> #9  0x400da75c in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
2016-02-03 00:00:29 +00:00
João Matos 39cb942254 Merge pull request #2563 from OffBase/master
Fix stream leak when failing to open a zip file
2016-02-03 00:00:02 +00:00
Aleksey Kliger 37630d26dd [runtime] Use MonoError for mono_string_new 2016-02-02 18:56:04 -05:00
Aleksey Kliger 3685b16f95 [runtime] Switch to mono_string_new_utf16_checked 2016-02-02 18:46:30 -05:00
Rodrigo Kumpera f8c90493e6 Merge pull request #2536 from lambdageek/monoerror-mono_field_get_object
[runtime] Use MonoError for mono_field_get_object
2016-02-02 18:37:33 -05:00
Rodrigo Kumpera 8a23cf5c1e Merge pull request #2532 from lambdageek/monoerror-mono_object_new
[runtime] Use MonoError for mono_object_new
2016-02-02 18:35:49 -05:00
Zoltan Varga 53bd4a7a23 [llvmonly] Implement limited support for stack walks so new StackTrace () works. 2016-02-02 17:47:46 -05:00
Matthew Orlando 5d67d566a4 Fix stream leak in all cases 2016-02-02 13:57:42 -08:00
Marek Safar c3a88ff72b [corlib] Fixes Environment version for .net 4.6 2016-02-02 22:30:25 +01:00
Matthew Orlando a9f9e3505e Fix stream leak when failing to open a zip file 2016-02-02 12:58:06 -08:00
Vlad Brezae 68db4c7548 Merge pull request #2556 from BrzVlad/feature-sgen-stats
[sgen] sgen stats
2016-02-02 20:56:11 +00:00
Zoltan Varga 856ddcb285 Fix the build. 2016-02-02 14:52:59 -05:00
Zoltan Varga dd0e1e7591 [llvm] Fix the loaded llvm build broken by 204f2985d7. 2016-02-02 13:52:02 -05:00
monojenkins 635a4cec6f Merge pull request #2557 from ludovic-henry/monoerror-return-macro
[MonoError] Add error checking macro
2016-02-02 16:30:26 +00:00
Ludovic Henry ddc3fcfb41 fixup! [MonoError] Add error checking macro 2016-02-02 15:01:34 +00:00
Bernhard Urban 03f71e6173 [threads] avoid race between setting the state flag and suspension
there's a short window where we release the lock and another thread
could modify the state.  That is what we saw on the ARM machines for a
while, e.g. in `subthread-exit.cs` there's a race between
`mono_thread_execute_interruption` and `mono_thread_suspend_all_other_threads`:

> Thread 2 (Thread 0x429ff430 (LWP 5189)):  // SUB THREAD
> #0  0x40398e30 in nanosleep () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1  0x0028c0ac in monoeg_g_usleep (microseconds=86650) at gdate-unix.c:53
> #2  0x0027b1d8 in suspend_sync_nolock (id=1079603792, interrupt_kernel=1) at mono-threads.c:913
> #3  0x0027b2d4 in mono_thread_info_safe_suspend_and_run (id=1079603792, interrupt_kernel=1, callback=0x1ab109 <suspend_thread_critical>, user_data=0x429fe534)
>     at mono-threads.c:935
> #4  0x001ab28a in suspend_thread_internal (thread=0x401c0120, interrupt=1) at threads.c:4807
> #5  0x001a91ec in mono_thread_suspend_all_other_threads () at threads.c:3297
> #6  0x00158d8c in ves_icall_System_Environment_Exit (result=0) at icall.c:6378
> #7  0x400e7d9c in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>
> Thread 1 (Thread 0x40597250 (LWP 5186)):  // MAIN THREAD
> #0  0x4039a5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1  0x4039796e in do_futex_wait () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #2  0x403979da in sem_wait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #3  0x002788d8 in mono_os_sem_wait (sem=0x388248, flags=MONO_SEM_FLAGS_NONE) at ../../mono/utils/mono-os-semaphore.h:163
> #4  0x00279722 in mono_thread_info_wait_for_resume (info=0x388210) at mono-threads.c:144
> #5  0x0027ad5e in mono_thread_info_end_self_suspend () at mono-threads.c:700
> #6  0x001ab2d2 in self_suspend_internal (thread=0x401c0120) at threads.c:4822
> #7  0x001aab0a in mono_thread_execute_interruption () at threads.c:4337
> #8  0x001a6a82 in ves_icall_System_Threading_Thread_Sleep_internal (ms=1200) at threads.c:1217
> #9  0x400da75c in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
2016-02-02 06:59:27 -08:00
Ludovic Henry 0ba4b9e2df [error] Use error_return_(val_)if_nok at some places 2016-02-02 14:27:45 +00:00
Ludovic Henry ddb2f6734c [MonoError] Add error checking macro 2016-02-02 14:27:44 +00:00
Alexander Köplinger f1dad87178 [binary-reference-assemblies] Make sure only .dll files are included in the wildcard
The wildcard `$(wildcard ../../../external/binary-reference-assemblies/v4.5/*)` would include the directory entry `../../../external/binary-reference-assemblies/v4.5/Facades/` which returns an error during "make dist".

Fixing this by including only the .dll files in the wildcards.
2016-02-02 14:29:46 +01:00
Alexander Köplinger c896d003e5 [binary-reference-assemblies] Include 4.5 Facades in tarball 2016-02-02 13:41:04 +01:00
Martin Baulig 97d5cc968b [Mono.Security.Providers.OldTls]: Don't build on mobile.
(cherry picked from commit f379b7df51)
2016-02-02 02:06:27 +01:00
Vlad Brezae 06157ba4ed [sgen] Add binary protocol entries for evacuation
This way we can detect which collections are doing evacuation, which can be useful both for debugging and performance reasons.
2016-02-02 02:19:56 +02:00
Vlad Brezae 5f06b81c0d [sgen] Remove fixed FIXME comment 2016-02-02 02:19:55 +02:00
Vlad Brezae 66e6ff2b21 [sgen] Add binary protocol entry for worker finish
This will allow us to detect actual concurrent M&S end and whether the concurrent M&S was forced to finish.
2016-02-02 02:19:55 +02:00
Vlad Brezae bcf81a85b0 [sgen] Add binary protocol entries for finishing the gray stack
These entries have a timestamp associated with them, allowing us to gather information about time spent during each collection.
2016-02-02 02:19:55 +02:00
Vlad Brezae daa8ee8d21 [sgen] Add binary protocol entries for cardtable scanning
These entries have a timestamp associated with them, allowing us to gather information about time spent during each collection.
2016-02-02 02:19:55 +02:00
Vlad Brezae 6d980143fe [sgen] Fix HEAVY_STATISTICS build warning 2016-02-02 02:19:55 +02:00
Miguel de Icaza ee65935935 [Makefile] fix make dist on libgc 2016-02-01 17:54:56 -05:00
Zoltan Varga 9a871fa705 [jit] Avoid merging some bblocks which are not after each other when inlining since it can cause the bblock between them to be ignored later. Fixes #38250. 2016-02-01 17:45:01 -05:00
Zoltan Varga 6929f360a4 [amd64] Fix the stack alignment check. 2016-02-01 17:45:01 -05:00
monojenkins 32122271cc Merge pull request #2551 from ludovic-henry/coop-products
[coop] Add support for entering/exiting GC safe/unsafe region for products
2016-02-01 22:35:22 +00:00
Ludovic Henry 738e03cc1e [coop] Add support for entering/exiting GC safe/unsafe region for products 2016-02-01 20:53:03 +00:00
Ludovic Henry 0c0ab39407 [coop] Ensure we exit blocking mode when invoking managed code
mono_runtime_invoke might be called by P/Invoked code, which is in blocking mode. Not switching back to running can lead to a crash when hitting a safepoint.
2016-02-01 20:53:02 +00:00
Zoltan Varga 2b3951446e [arm] Fix a code generation problem when a virtual call is made with a large offset, the offset generation code would overwrite a source register. Fixes #27303. 2016-02-01 14:51:23 -05:00
Zoltan Varga 72dac8baaa [aot] Emit gsharedvt wrappers only in llvmonly mode. 2016-02-01 14:28:40 -05:00
Marek Safar 509c9828d6 [mcs] Filter out nested private types of forwarded types 2016-02-01 16:33:20 +01:00
monojenkins 7dc7782f83 Merge pull request #2538 from ludovic-henry/fix-sgen-38012
[sgen] Fix register scanning on ARM

This bug would trigger a use after sweep in System.Threading.Tasks.Task.FinishContinuations:3621.

The issue would arise on ARM, as `MonoContext` and `ARCH_NUM_REGS` are defined as followed :

```
typedef struct {
  mgreg_t pc;
  mgreg_t regs [16];
  double fregs [16];
  mgreg_t cpsr;
} MonoContext;

\#define ARCH_NUM_REGS 14
```

As you can see, the MonoContext structure is bigger than 14 words, and it does not even covers the last 3 values of `regs`. By using pointer arithmetic, we ensure that we do not miss some parts of the `MonoContext` structure.

The observed behaviour in System.Threading.Tasks.Task.FinishContinuations would be that `continuationObject` would not be marked, and thus freed; `continuationObject` would still contains the pointer to the old location, meaning it wouldn't be null. We would then try to check its type via a call to the `as` operator. This would call the `isinst` IL opcode which would load `continuationObject->vtable->klass->supertypes [...]`, which would trigger a segfault, as `supertypes` would be null.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38012
2016-02-01 13:16:41 +00:00
monojenkins c9717d4807 Merge pull request #2541 from ludovic-henry/fix-coop-hang
[coop] Fix hang in ves_icall_System_Net_Dns_GetHostByName_internal
2016-02-01 12:55:11 +00:00
Marek Safar 22c7ad6237 [binary-reference-assemblies] Install 4.5 api facades 2016-02-01 12:48:23 +01:00
Ludovic Henry 8de9b41c3a [coop] Fix hang in ves_icall_System_Net_Dns_GetHostByName_internal 2016-02-01 09:56:37 +00:00
Zoltan Varga 204f2985d7 [llvm] Make mini-llvm-loader.c simpler by putting all the function pointers into a structure. 2016-02-01 03:09:53 -05:00
Zoltan Varga 61ec3cce68 [amd64] Add support for float arguments/return values to the dyncall code. 2016-02-01 00:03:43 -05:00
Zoltan Varga 36a8195b66 Merge pull request #2547 from ermshiperete/Xamarin-33183
[SWF] Fix behavior when scrollbar values change in TreeView
2016-01-31 23:06:31 -05:00
Zoltan Varga b94fa3be55 [llvm] Remove the goto based error handling code, use explicit error checks and returns instead. 2016-01-31 21:55:06 -05:00
Alexander Köplinger bfa642cd73 [msvc] Update order.xml and csproj files 2016-02-01 02:00:18 +01:00
Alex Rønne Petersen 87a427c8db Merge pull request #2546 from ermshiperete/libtoolize
Check for libtoolize rather than libtool
2016-01-31 16:49:01 +01:00
Marek Safar 993ac43208 [mcs] Stop after fields initializers resolve errors 2016-01-31 08:33:53 +01:00
Zoltan Varga c182d28c71 [runtime] Disable the constant-logical-operand warning. 2016-01-31 00:22:25 -05:00
Zoltan Varga ac76f94e7c [runtime] Make the MONO_CURRENT_ABI_ALIGNOF macros c++ safe. 2016-01-31 00:22:25 -05:00
Zoltan Varga ad7d62eb22 [jit] Remove unused MONO_PATCH_INFO_MONITOR_ENTER/EXIT. 2016-01-31 00:22:25 -05:00
Marek Safar 5d17a86fb8 Merge pull request #2544 from ermshiperete/Xamarin-24641
[corlib] Fix handling of ignorable chars when using ordinal comparison
2016-01-30 20:13:08 +01:00
Neil Mayhew 3bc3da8f4d Check for libtoolize rather than libtool
Current Debian packaging puts libtool in its own package (libtool-bin)
leaving only libtoolize in the main package. The mono build process
uses libtoolize not libtool, so during autogen check for libtoolize
not libtool.
2016-01-30 14:54:52 +01:00
Damien Daspit 500252cbf3 [corlib] Fix handling of ignorable chars when using ordinal comparison
* recognizes ignorable characters when CompareOptions.Ordinal is
  specified
* adds unit tests
* fixes bug 24641

Change-Id: I5102e7392fa54b5671c7f2536cb8778f847e9040
2016-01-30 14:30:40 +01:00
Damien Daspit 9a79413ebf [SWF] Fix behavior when scrollbar values change in TreeView
* only call EndEdit in scrollbar value changed handlers when currently
  editing a node
* fix for bug 33183

Change-Id: I54407e00314f4bfbdc175e883199d3d1ef057911
2016-01-29 23:00:42 +01:00
Damien Daspit fb4bc1b7cd [corlib] Fix exception in __ComObject finalizer during shutdown
* keep a reference to a __ComObject's proxy so it doesn't get garbage
  collected
* don't create __ComObjects unnecessarily
* Fix for bug 24974

Change-Id: Ia09237b7f1af996405134c250bbc29220f81f067
2016-01-29 22:50:10 +01:00
Zoltan Varga d37a42b83b [llvmonly] Fix stack trace calculation. 2016-01-29 16:39:40 -05:00
Eberhard Beilharz f2ac9bf6c3 Don't ignore drives with type "aufs" or "overlay" (Xamarin-31021)
Docker uses aufs or overlayfs to mount the root system in a
container. This change fixes Xamarin-31021 so that the drives
show up properly.

This change is released under the MIT license.

Change-Id: I5150b0e82f26e9dbd07bbcbc50e7ca50d856dde8
2016-01-29 22:33:41 +01:00
Zoltan Varga cdf23315f0 [amd64] Exclude the GSHAREDVT tests as well since they don't work yet. 2016-01-29 16:23:23 -05:00
Zoltan Varga a65739d195 [jit] Disable the DYNCALL tests on amd64 again, not all cases are supported right now. 2016-01-29 16:19:35 -05:00
Alexander Köplinger cb07018bca Remove ChangeLog references from Makefile and .gitattribute 2016-01-29 21:41:48 +01:00
Zoltan Varga 211b145281 [jit] Use mono_method_get_full_name () to print out method names in a few places. 2016-01-29 15:33:34 -05:00
Zoltan Varga faeeab9653 [llvmonly] Fix the fallback to no_gsharedvt_in_wrapper, which was broken by the error handling changes. 2016-01-29 15:32:48 -05:00
Zoltan Varga b3fdafbadb [llvmonly] Catch all exceptions in mono_jit_exec () to avoid terminating the runtime with an unhelpful libc++ assertion. 2016-01-29 15:03:46 -05:00
Marek Safar 8ad1f59aa8 [mcs] Rework naming convention of lifted state machine fields to include scope index. Fixes #32315 (1st part) 2016-01-29 20:24:20 +01:00
Ludovic Henry 32a89437a1 [sgen] Fix register scanning on ARM
This bug would trigger a use after sweep in System.Threading.Tasks.Task.FinishContinuations:3621.

The issue would arise on ARM, as `MonoContext` and `ARCH_NUM_REGS` are defined as followed :

```
typedef struct {
  mgreg_t pc;
  mgreg_t regs [16];
  double fregs [16];
  mgreg_t cpsr;
} MonoContext;

\#define ARCH_NUM_REGS 14
```

As you can see, the MonoContext structure is bigger than 14 words, and it does not even covers the last 3 values of `regs`. By using pointer arithmetic, we ensure that we do not miss some parts of the `MonoContext` structure.

The observed behaviour in System.Threading.Tasks.Task.FinishContinuations would be that `continuationObject` would not be marked, and thus freed; `continuationObject` would still contains the pointer to the old location, meaning it wouldn't be null. We would then try to check its type via a call to the `as` operator. This would call the `isinst` IL opcode which would load `continuationObject->vtable->klass->supertypes [...]`, which would trigger a segfault, as `supertypes` would be null.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38012
2016-01-29 18:37:57 +00:00
Alexander Köplinger b03e606287 Remove ChangeLog files from the repo
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
2016-01-29 19:17:06 +01:00
Ludovic Henry aa5aff7b9d [sgen] Abort with a message on failure to initialize binary protocol 2016-01-29 18:10:10 +00:00
Alexander Köplinger bf5947a0fd [corlib] Improve CancellationTokenSource test
Get rid of the Thread.Sleep calls that are prone to timing issues.
2016-01-29 16:51:02 +01:00
monojenkins 02d4680c09 Merge pull request #2522 from ludovic-henry/test-socketresponder-task
[SocketResponder] Use Task instead of Thread + Use explicit delegate so it appears in stacktraces
2016-01-29 14:50:15 +00:00
Rolf Bjarne Kvinge 5bb760e65f [System.ServiceModel.Internals] Add a missing .sources file for watchOS. Fixes #38145.
https://bugzilla.xamarin.com/show_bug.cgi?id=38145
2016-01-29 12:23:10 +01:00
Vlad Brezae 69fd76078e Merge pull request #2448 from BrzVlad/feature-cprop-opt
[jit] Improve strength reduction handling within cprop
2016-01-29 11:21:17 +00:00
Marcos Henrich d56d046025 Merge pull request #2531 from esdrubal/systemweb
[System.Web] HeadersCollection read only exception
2016-01-29 09:35:27 +00:00
Zoltan Varga 70de6ee108 [llvmonly] Do a stack walk from mono_llvmonly_get_calling_assembly (), the runtime might support stack walks on some platforms. 2016-01-28 23:19:25 -05:00
Zoltan Varga 3d22da0f6e [runtime] Avoid an assert if a runtime compiled without DISABLE_COM is used with an mscorlib from the mobile_static profile. 2016-01-28 23:18:51 -05:00
Aleksey Kliger 350c4ff92b [runtime] mono_reflection_resolve_custom_attribute_data cleanup error handling 2016-01-28 20:45:47 -05:00
Aleksey Kliger fe72b0ed73 [runtime] Use MonoError for mono_field_get_object
Mark mono_field_get_object external only.
Use mono_field_get_object_checked in the runtime.
2016-01-28 20:45:47 -05:00
Zoltan Varga c52c794bcb [llvmonly] Remove bind-to-runtime-version from the aot flag used to compile the assemblies, it makes testing harder. 2016-01-28 20:06:52 -05:00
Zoltan Varga 4b085e7bf7 [llvmonly] Allow any value for MONO_LLVMONLY not just TRUE. 2016-01-28 20:05:40 -05:00
Zoltan Varga 9fd965bf0f Merge pull request #2533 from vargaz/gshared-errors
[jit] Add MonoError support for the generic sharing code.
2016-01-28 18:31:45 -05:00
monojenkins 68f233fc7c Merge pull request #2529 from lambdageek/monoerror-location
[runtime] mono_error_assert_ok() include location
2016-01-28 21:45:15 +00:00
Zoltan Varga 2e1116d02a [jit] Add MonoError support for the generic sharing code. 2016-01-28 15:48:48 -05:00
Aleksey Kliger 4369d53fa5 [runtime] Switch to mono_object_new_checked
Mark mono_object_new external only.
2016-01-28 15:44:46 -05:00
Aleksey Kliger fed0fa8b6c [runtime] Use MonoError for mono_object_new 2016-01-28 15:44:45 -05:00
Zoltan Varga 871eb0554b [jit] Move the raise version of mono_jit_compile_method () to metadata/. 2016-01-28 14:46:44 -05:00
Rodrigo Kumpera a86b5813a4 Merge pull request #2525 from kumpera/embedding-api
[api] Add API kill switch.
2016-01-28 14:22:09 -05:00
Zoltan Varga 5c3d125e79 Merge pull request #2528 from vargaz/jit-errors2
Jit errors2
2016-01-28 13:16:24 -05:00
Marcos Henrich 2002994d0c Merge pull request #2419 from esdrubal/xmlsubclassel
[System.Xml] Fix sub class serialization on lists
2016-01-28 17:57:15 +00:00
Marcos Henrich 1180f64665 [System.Web] HeadersCollection read only exception
In reference source HttpHeaderCollection [1] when Add, Set or Remove is
called and the collection is readonly a PlatformNotSupportedException is
thrown.

Mono HeadersCollection was throwing NotSupportedException and
Microsoft.Owin.Host.SystemWeb.OwinCallContext.RemoveAcceptEncoding was
not catching the exception because it was expecting
PlatformNotSupportedException.

Fixes #33809

[1] http://referencesource.microsoft.com/#System.Web/HttpHeaderCollection.cs,73
2016-01-28 17:21:37 +00:00
Marcos Henrich 861ab4c98d [System.Web] Test HttpRequest.Headers Add/Set/Remove
In .NET while calling Add, Set or Remove of a HttpRequest read only
collection a PlatformNotSupportedException is thrown.

Covers #33809
2016-01-28 17:17:27 +00:00
Aleksey Kliger 5297427fdf [runtime] mono_error_assert_ok() include location 2016-01-28 11:31:30 -05:00
Alexander Köplinger 205d9e09f0 [metadata] Fix duplicate variable declaration in coree.c that breaks msvc
A new 'error' variable was added in d790857278 that clashes with the existing one.
2016-01-28 16:13:44 +01:00
Rolf Bjarne Kvinge 3bc96e9c02 [mono-api-html] New interface members are only breaking if the interface existed. 2016-01-28 15:55:58 +01:00
Rolf Bjarne Kvinge 4d1c0d517c [mono-api-html] Fix compiler warning. 2016-01-28 15:33:53 +01:00
Rolf Bjarne Kvinge a8c6b0d380 [mono-api-html] Make it possible to hide/show non-breaking changes in the html output.
We now add data-is-[non-]breaking attributes to the generated
html elements, and then use some javascript logic to show/hide
non-breaking elements (and the javascript also looks in the
container elements show/hide containers that have only
non-breaking descendants).

Also use css classes/styles to colorize.
2016-01-28 15:32:56 +01:00
Rolf Bjarne Kvinge 4279991d27 [mono-api-info] Add an is-override attribute to determine if a method is overriding another method. 2016-01-28 15:32:52 +01:00
Alexander Köplinger 88b287f065 [xbuild] Use -api folder for 2.0/3.5/4.0 profiles as well
Similar to e2a79ed888. Those profiles are only contract/reference assemblies since Mono 4.0.
2016-01-28 15:18:18 +01:00
Rolf Bjarne Kvinge 81d2d4cfe8 Merge branch 'mono-api-info-improvements' 2016-01-28 14:49:29 +01:00
Rolf Bjarne Kvinge c918366bb9 [mono-api-info] CreateAttributeMapping: don't create dictionaries unless there is something to put in them. 2016-01-28 14:49:17 +01:00
Rolf Bjarne Kvinge f4ce19132a [mono-api-info] Rework AttributeData to use a static method instead of creating an instance every time. 2016-01-28 14:49:13 +01:00
Rolf Bjarne Kvinge f4f993f4bf [mono-api-info] Improve CleanupTypeName to not create 3 strings every time somethings needs to change. 2016-01-28 14:49:11 +01:00
Rolf Bjarne Kvinge 0f83276b64 [mono-api-info] First filter, then order, and use ordinal comparison. 2016-01-28 14:49:08 +01:00
Rolf Bjarne Kvinge 035c546b81 [mono-api-info] Rework SkipAttribute to use ordinal string comparison, and no string comparison unless needed. 2016-01-28 14:49:06 +01:00
Rolf Bjarne Kvinge f12fdef548 [mono-api-info] Use ordinal string comparison. It's much faster. 2016-01-28 14:49:03 +01:00
Rolf Bjarne Kvinge 4350e463b4 [mono-api-info] Remove unused method. 2016-01-28 14:49:00 +01:00
Rolf Bjarne Kvinge d21bbefe55 [mono-api-info] Use XmlWriter instead of XmlDocument to make this faster.
Generating all the API references (in parallel) for Xamarin.iOS goes from
5.5s to 4.5s.
2016-01-28 14:48:57 +01:00
Marek Safar e2a79ed888 [xbuild] Set .net 4.5 target to 4.5 restricted api 2016-01-28 14:19:18 +01:00
Marek Safar 62b4991bcd [system] Add DeliveryFormat to SmtpSection. Fixes #37891 2016-01-28 13:40:45 +01:00
Rolf Bjarne Kvinge 6cf7b10c54 [mono-api-info] Add support for writing output to a file specified using a command line argument. 2016-01-28 13:19:16 +01:00
Marek Safar 85490058c8 [mcs] Implements null operator for dynamic expressions. Fixes #37801, #37824 2016-01-28 13:09:43 +01:00
Ludovic Henry 08aa9adece [SocketResponder] Use Task instead of Thread
This allow us catching and rethrowing the exception on the main thread, as well as making sure we wait for the Listen thread to finish in a timely manner.
2016-01-28 11:10:53 +00:00
Ludovic Henry 83c7edc70e [SocketResponder] Start in constructor and Stop on Dispose
In conjuction with `using` we ensure that we Start and Stop the SocketResponder correctly, and everytime
2016-01-28 11:10:53 +00:00
Ludovic Henry 7f0b7cf022 [Tests] Use explicit delegate so it appears in stacktraces
In case of exception in this callback, the name of the test method will appear in the stacktrace, making debugging way easier.
2016-01-28 11:10:53 +00:00
Zoltan Varga 27f20bf400 Merge pull request #2497 from ludovic-henry/monoerror-mono_gsharedvt_constrained_call
[runtime] Use MonoError for mono_gsharedvt_constrained_call
2016-01-28 03:03:35 -05:00
Sebastien Pouliot 789f4b7651 [System] Move HttpListenerResponse.GetStatusDescription to ease linking
The use of HttpResponseMessage.ReasonPhrase means:

* marking the HttpListenerResponse.GetStatusDescription method;
* marking the HttpListenerResponse type;
* which implements IDisposable, so it's Dispose method is marked
* marking the Close method...

from there a metric ton of code gets recursively marked to the point
where the whole SSL/TLS server code gets inside the app.

To avoid this we move the GetStatusDescription to a different
type that won't bring the end of the civilized world so fast.
2016-01-27 22:12:13 -05:00
Zoltan Varga 2af945bb5d [runtime] Use MonoError in mono_jit_runtime_invoke () to return errors, the 'exc' parameter is still used to return the possible exception from the invoke call. 2016-01-27 22:06:47 -05:00
Alexander Köplinger cdd384ac72 [System.Web] Fix another wrong test assembly name
Didn't catch that one in 180e745cce as it hides itself pretty well :)
2016-01-28 03:56:59 +01:00
Zoltan Varga e24eee43ea Merge pull request #2527 from vargaz/jit-errors
[jit] Convert some of the error handling to use cfg->error instead of…
2016-01-27 21:33:53 -05:00
Zoltan Varga 5ff7c08a10 [jit] Use mono_error_set_pending_exception () to throw exceptions from the trampoline code. This only works if the generic trampoline code checks for exceptions after the call to the C function. 2016-01-27 20:15:14 -05:00
Zoltan Varga 82b5d81363 [jit] Use MonoError in mono_jit_compile_method () and the trampoline code. 2016-01-27 19:55:48 -05:00
Rodrigo Kumpera 1dfaf5d373 [api] GCC is much better at enforcing MONO_RT_EXTERNAL_ONLY. 2016-01-27 18:11:59 -05:00
Alexander Köplinger 41db6a54d3 Merge pull request #2526 from alexanderkyte/llvmonly_mobile_static_fixups
[mobile_static] Requested NunitLite comment and llvmonly configuration changes
2016-01-28 00:08:20 +01:00
Zoltan Varga 1630549e55 [jit] Pass a MonoError* instead of a MonoException** to mono_jit_compile_method_inner (). 2016-01-27 17:48:28 -05:00
Zoltan Varga 1c04cbffdf [runtime] Initialize the error fields in mono_error_set_exception_instance (). 2016-01-27 17:47:38 -05:00
Alexander Köplinger 180e745cce [bcl] Fix dll names and InternalsVisibleTo for test assemblies
The format of the test assembly name changed in 860334ff45
from System.Web_test_net_4_x.dll to net_4_x_System.Web_test.dll.

This fixes all the places where the old name was used.
2016-01-27 23:39:00 +01:00
Zoltan Varga 1a784475c0 [jit] Reduce the usage of the loader error more by converting it to a MonoError where it was detected. 2016-01-27 17:13:27 -05:00
Alexander Köplinger 2b2ca2dbf8 Merge pull request #2523 from akoeplinger/fix-profiler-test-reporting
[profiler] Fix test reporting success even though a test failed
2016-01-27 22:21:49 +01:00
Zoltan Varga bb015846ad [jit] Convert some of the error handling to use cfg->error instead of cfg->exception_type. 2016-01-27 16:01:41 -05:00
Neale Ferguson ef8c67a1d7 Use S390_SET to get addresses rather than the previous more convoluted method
[jit] Add a new jit icall mono_interruption_checkpoint_from_trampoline () and use that instead of mono_thread_force_interruption_checkpoint () so the latter can go away eventually.
2016-01-27 15:48:56 -05:00
Alexander Kyte c2ac146ca4 [mobile_static] Don't use gsharedvt with llvmonly 2016-01-27 15:48:25 -05:00
Aleksey Kliger 5fc9695003 [runtime] Use MonoError for mono_string_new_utf16 2016-01-27 15:35:09 -05:00
Ludovic Henry 97c02fbb45 [MonoError] Add ArgumentNull error case 2016-01-27 15:35:08 -05:00
Alexander Kyte 018d664cab [nunitlite] Documented console .config usage 2016-01-27 15:28:05 -05:00
Alexander Kyte 1a1864545a Merge pull request #2432 from alexanderkyte/compile_corlib_with_aot
[aot/bcl] Compile the BCL with AOT
2016-01-27 15:10:56 -05:00
Alexander Kyte f7010e65a9 [aot/bcl] Add Makefile configuration to build the bcl with aot, use it in mobile_static. 2016-01-27 15:10:18 -05:00
Alexander Kyte 1f5d985270 Merge pull request #2431 from alexanderkyte/tests_with_excludes
[mcs] Fix .sources/.excludes for tests, exclude corlib monotouch-excluded tests on mobile_static
2016-01-27 15:09:29 -05:00
Rodrigo Kumpera b118d2593e [api] Mark external Only: mono_get_method, mono_get_method_full and mono_get_method_constrained. 2016-01-27 15:03:26 -05:00
Rodrigo Kumpera afa75917e7 [build] Add MONO_RT_EXTERNAL_ONLY macro to the public API.
This macro should be used to decorate functions that are part of the public API but the runtime is
not supposed to call.

This is to allow us to keep them around but not go crazy with commit reintroducing their usage.
2016-01-27 14:55:47 -05:00
Alexander Köplinger 93ed825dcb [profiler] Fix test reporting success even though a test failed
I noticed this in https://jenkins.mono-project.com/job/test-mono-pull-request-armhf/1715/ which reported success in the "profiler" test step,
even though the step actually reported errors:

```
MONO_PATH=/media/ssd/jenkins/workspace/test-mono-pull-request-armhf/mcs/class/lib/net_4_x perl ./ptestrunner.pl ../..
Checking test-alloc.exe with report ...
Checking test-busy.exe with report ...
Checking test-busy.exe with report,sample ...
Error: Missing thread Finalizer.
Error: Missing thread Main.
Error: Wrong loaded images 2.
Error: Not enough compiled method.
Error: Not enough compiled code.
Error: Missing thread BusyHelper.
Total errors: 6
Checking test-monitor.exe with report ...
Checking test-excleave.exe with report ...
Checking test-heapshot.exe with report,heapshot ...
Checking test-heapshot.exe with heapshot,output=-traces.mlpd ...
Checking test-traces.exe with output=-traces.mlpd ...
Checking test-traces.exe with nocalls,output=-traces.mlpd ...
make[1]: Leaving directory `/media/ssd/jenkins/workspace/test-mono-pull-request-armhf/mono/profiler'
make: Leaving directory `/media/ssd/jenkins/workspace/test-mono-pull-request-armhf/mono/profiler'
++ bc
+++ date +%s
++ echo 1453874768 - 1453874741
+ echo -e '*** end(27): profiler: \e[42mPassed\e[0m'
*** end(27): profiler: Passed
```

The culprit is that ptestrunner.pl checks whether $total_errors is non-zero to determin the process exit code.
This is wrong, as $total_errors is cleared before each test so unless the last test fails the exit code would always be zero.

Introduced a new $global_errors variable which is only incremented and never cleared to fix this.
2016-01-27 20:17:18 +01:00
Zoltan Varga 7ee763525e Revert "[runtime] Use explicit loop checking to remove depth limitation of sequence point search."
This reverts commit 23ce21ede0.

Revert this as it is non-linear and can take a lot of time for complicated cfg structures.
2016-01-27 13:47:37 -05:00
Rodrigo Kumpera 6a724e9a6e Merge pull request #2520 from kumpera/loader-error-cleanup5
[mono-error] Another round of loader-error
2016-01-27 13:38:13 -05:00
monojenkins 97122fe004 Merge pull request #2521 from akoeplinger/fix-sockettest-endconnect-error
[System] Fix error in new BeginConnectToIPV4EndPointUsingDualModelSocket test

It was added with 78c758494a. The test fails on Jenkins:

```
Test Case Failures:
1) MonoTests.System.Net.Sockets.SocketTest.BeginConnectToIPV4EndPointUsingDualModelSocket : System.InvalidOperationException : EndConnect can only be called once per asynchronous operation
at System.Net.Sockets.Socket.ValidateEndIAsyncResult (IAsyncResult ares, System.String methodName, System.String argName) [0x0004a] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/System.Net.Sockets/Socket.cs:3412
at System.Net.Sockets.Socket.EndConnect (IAsyncResult result) [0x00006] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/System.Net.Sockets/Socket.cs:1584
at MonoTests.System.Net.Sockets.SocketTest.BeginConnectToIPV4EndPointUsingDualModelSocket () [0x0005d] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs:4365
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```

The reason is that BCCallback already calls EndConnect() so we need to remove it and just wait for the callback in the test itself.

@monojenkins merge
2016-01-27 16:15:23 +00:00
Marek Safar a8f7af783e [mcs] Reset null operator barrier in parenthesis expression 2016-01-27 17:00:24 +01:00
Chris Hamons 8aa899c20d Fix serialization under XM 4.5 Target Framework
- System.Configuration.ConfigurationErrorsException: Failed to load configuration section for dataContractSerializer
- Fixes #36401 #38064
2016-01-27 08:54:10 -06:00
Alexander Köplinger c386c7131d [System] Fix error in new BeginConnectToIPV4EndPointUsingDualModelSocket test
It was added with 78c758494a. The test fails on Jenkins:

```
Test Case Failures:
1) MonoTests.System.Net.Sockets.SocketTest.BeginConnectToIPV4EndPointUsingDualModelSocket : System.InvalidOperationException : EndConnect can only be called once per asynchronous operation
at System.Net.Sockets.Socket.ValidateEndIAsyncResult (IAsyncResult ares, System.String methodName, System.String argName) [0x0004a] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/System.Net.Sockets/Socket.cs:3412
at System.Net.Sockets.Socket.EndConnect (IAsyncResult result) [0x00006] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/System.Net.Sockets/Socket.cs:1584
at MonoTests.System.Net.Sockets.SocketTest.BeginConnectToIPV4EndPointUsingDualModelSocket () [0x0005d] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs:4365
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```

The reason is that BCCallback already calls EndConnect() so we need to remove it and just wait for the callback in the test itself.
2016-01-27 15:41:54 +01:00
Alexander Köplinger 39d172e190 [System.Runtime.Caching] Bump timeout in tests to make them more reliable
Failed on Jenkins on ARM today:

```
Tests run: 38, Failures: 1, Not run: 0, Time: 32.132 seconds

Test Case Failures:
1) MonoTests.System.Runtime.Caching.MemoryCacheTest.TimedExpiration :   #A4-4
  Expected: not null
  But was:  null

at MonoTests.System.Runtime.Caching.MemoryCacheTest.TimedExpiration () [0x002b6] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/System.Runtime.Caching/Test/System.Runtime.Caching/MemoryCacheTest.cs:902
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```

100ms could be too short, bumping the timeout should make it more reliable on the slower ARM machines.
2016-01-27 12:29:45 +01:00
Ludovic Henry 78c758494a Merge pull request #2420 from stefansedich/master
Handle automatically mapping IPv4 addresses to IPV6 for dual mode sockets, fixes #36192
2016-01-27 09:51:42 +00:00
Zoltan Varga 7c9e71be5e [runtime] Use mono_error_set_pending_exception () instead of mono_error_raise_exception () in icall.c. 2016-01-27 01:05:38 -05:00
monojenkins eb4fdbd818 Merge pull request #2486 from ludovic-henry/monoerror-mono_type_get_object
[runtime] Use MonoError for mono_type_get_object
2016-01-27 04:45:23 +00:00
monojenkins df3efdc131 Merge pull request #2519 from ludovic-henry/fix-array-jiticalls
[array] Replace raise exception by pending exception in jit-icalls

The convention for jit-icalls is to set the pending exception, instead of raising it from native.
2016-01-27 04:05:23 +00:00
Rodrigo Kumpera a997c1c404 [mono-error] The reflection code still festered with hidden deps for loader-error. 2016-01-26 21:27:05 -05:00
Zoltan Varga 471b3ccf42 [x86] Change the way exceptions are thrown from trampolines: instead of calling mono_thread_force_interruption_checkpoint (), which would throw the exception using mono_raise_exception (), obtain the exception, unwind to the parent frame, and throw the exception normally there by calling the throw exception trampoline. 2016-01-26 20:31:08 -05:00
Rodrigo Kumpera 68795e4081 [jit] Fix error propagation when loading methods. Move more checks to rely on cfg->error. 2016-01-26 20:12:18 -05:00
Zoltan Varga 184e52daf9 Fix the build. 2016-01-26 19:43:20 -05:00
Zoltan Varga 343d46b2da [jit] Use mono_set_pending_exception () in one jit icall. 2016-01-26 19:40:39 -05:00
Ludovic Henry 727778565f [array] Replace raise exception by pending exception in jit-icalls
The convention for jit-icalls is to set the pending exception, instead of raising it from native.
2016-01-27 00:35:52 +00:00
Ludovic Henry 89ea5fa447 [runtime] Use MonoError for mono_gsharedvt_constrained_call 2016-01-27 00:08:09 +00:00
Ludovic Henry 2cd2f4a184 [runtime] Use MonoError for mono_type_get_object 2016-01-26 23:56:41 +00:00
Zoltan Varga 414fccaa21 [runtime] Get rid of mono_thread_force_interruption_checkpoint (), its not used anymore. 2016-01-26 17:53:23 -05:00
Zoltan Varga 2b20305876 [jit] Add a new jit icall mono_interruption_checkpoint_from_trampoline () and use that instead of mono_thread_force_interruption_checkpoint () so the latter can go away eventually. 2016-01-26 17:49:01 -05:00
Zoltan Varga 1df9e44ea8 [amd64] Change the way exceptions are thrown from trampolines: instead of calling mono_thread_force_interruption_checkpoint (), which would throw the exception using mono_raise_exception (), obtain the exception, unwind to the parent frame, and throw the exception normally there by calling the throw exception trampoline. 2016-01-26 17:33:44 -05:00
Rodrigo Kumpera d790857278 [mono-error] Replace legacy calls to mono_get_method(_full) with _checked variant. 2016-01-26 16:23:34 -05:00
Rodrigo Kumpera f100c2f5ff [mono-error] Remove usage of a couple of legacy functions from monodis. 2016-01-26 16:23:25 -05:00
Rodrigo Kumpera 36a9877998 [mono-error] Remove loader-error conversion for 3 functions that are not longer called by the runtime.
The following legacy functions are no longer used by the runtime and don't need loader-error conversion:
mono_method_get_signature_full
mono_method_get_signature
mono_field_from_token

May all that is unholy smite upon those attempting to use those functions again.
2016-01-26 16:07:39 -05:00
Alexander Köplinger 229f153294 Merge pull request #2517 from steffen-kiess/posix-socket-osx-test
[Mono.Posix] Fix the SocketTest.ControlMsg() test on OSX
2016-01-26 22:06:56 +01:00
Rodrigo Kumpera a8b276ed8c Merge pull request #2500 from ludovic-henry/monoerror-mono_string_alloc
[runtime] Use MonoError for mono_string_alloc
2016-01-26 15:15:12 -05:00
Zoltan Varga a3c7b19679 [runtime] Fix the computation of StackFrame.native_offset for managed-to-native wrappers. 2016-01-26 15:06:40 -05:00
Alexis Christoforides e978bcdc36 [mkbundle] More Windows linking fixes, added "--custom-main" option 2016-01-26 14:48:14 -05:00
Rodrigo Kumpera 040d26ee91 Merge pull request #2513 from lambdageek/monoerror-RESOLVE_TYPE
[runtime] Use MonoError for RESOLVE_TYPE
2016-01-26 14:42:49 -05:00
Rodrigo Kumpera a54eb57de5 Merge pull request #2508 from lambdageek/monoerror-check_array_for_usertypes
[runtime] Use MonoError for check_array_for_usertypes
2016-01-26 14:42:03 -05:00
Rodrigo Kumpera fb89d6495e Merge pull request #2506 from lambdageek/monoerror-mono_reflection_type_resolve_user_types
[runtime] Use MonoError for mono_reflection_type_resolve_user_types
2016-01-26 14:39:48 -05:00
monojenkins 0658b3879a Merge pull request #2516 from lambdageek/monoerror-exception_instance
[runtime] Add MONO_ERROR_EXCEPTION_INSTANCE MonoError

This kind of MonoError can encapsulate a managed MonoException
object.  (For example as a result of mono_runtime_invoke ()).

Issues:

- [x] Memory leak correctness.
    `MonoError` already leaks memory if you simply swallow it without calling `mono_error_cleanup` or some function that calls it (for example `mono_error_raise_exception` or `mono_error_convert_to_exception`).
    Now if we have an encapsulated exception, we'll leak a GC handle unless cleanup happens.
2016-01-26 19:15:17 +00:00
Steffen Kieß 343fc2253d [Mono.Posix] Fix the SocketTest.ControlMsg() test on OSX
Unlike Linux, OSX does not allow multiple SCM_RIGHTS control messages in
sendmsg().
The SocketTest.ControlMsg() test is split into two tests, one which sends
only a single control message (containing two FDs), and another one which
sends two control messages (each containing one FD). The second test is not
executed on OSX.
2016-01-26 19:46:38 +01:00
Sebastien Pouliot 1a2b21803c [System] Make SmtpClient fallback to it's old behaviour if the hostname cannot be resolved. Fix #37246
Warning: System.Net.Mail is broken by design and sends incorrect emails.

This is not to fix SmtpClient itself but to ensure it remains compatible
(even if incorrect/broken) with older Mono releases.

The commit associated with bug# 33551 [1] can cause issues on computer
and devices that cannot resolve their hostname using the Dns API (which
have their own issues).

This commit catch the exception that occurs when resolution fails and
continue to send an email without a fully qualified domain name - just
like earlier Mono versions did in the past.

This solve bug #32746 [2] where some, but not all, AppleTV devices fails
to execute some of the System.dll unit tests.

Note: Whenever possible stay clear of SmtpClient (and friends) and use
something else like MimeKit/MailKit for your email needs

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=33551
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=37246
2016-01-26 13:11:46 -05:00
Rodrigo Kumpera a87f458b48 Merge pull request #2490 from ludovic-henry/monoerror-mono_string_builder_to_
[runtime] Use MonoError for mono_string_builder_to_utf8 and mono_string_builder_to_utf16
2016-01-26 12:50:31 -05:00
Rodrigo Kumpera 5aecb24584 Merge pull request #2463 from ludovic-henry/monoerror-mono_object_new_pinned
[runtime] Use MonoError for mono_object_new_pinned
2016-01-26 12:41:56 -05:00
Jonathan Pryor 558f90e96d Merge pull request #2510 from jonpryor/jonp-MonoThread-accessors
[runtime] Allow getting thread name, managed id from embedding API
2016-01-26 12:30:27 -05:00
Rodrigo Kumpera 02d129eecc Merge pull request #2512 from ludovic-henry/fix-coop-test-runtime
[coop] Use mono_thread_info_usleep which transition to BLOCKING state
2016-01-26 12:20:29 -05:00
Aleksey Kliger 305bfbae4c [runtime] Add MONO_ERROR_EXCEPTION_INSTANCE MonoError
This kind of MonoError can encapsulate a managed MonoException
object.  (For example as a result of mono_runtime_invoke ()).
2016-01-26 11:42:17 -05:00
monojenkins 19f5033b7d Merge pull request #2449 from lambdageek/dev/no-chunks
[handle] Remove chunk_last field from MonoHandleArena

Remove the `chunk_last` field.  This changes MonoHandleArena from a queue of chunks to a stack of chunks.  More importantly, the MonoHandleArena has an initial chunk that is allocated on the stack together with the arena.  Previously that chunk was at the front of the list of chunks, but now it is at the end.
2016-01-26 14:50:17 +00:00
Alexander Köplinger 8fa2e19e2d Merge pull request #2514 from akoeplinger/disable-monoposix-test
[Mono.Posix] Disable new ControlMsg() test that fails on OSX for now
2016-01-26 13:13:10 +01:00
Ludovic Henry 3f262f6554 [runtime] Use MonoError for mono_string_builder_to_utf8 and mono_string_builder_to_utf16 2016-01-26 10:45:01 +00:00
monojenkins 6b8c3774c7 Merge pull request #2511 from ludovic-henry/fix-coop-debugger
[coop] Fix debugger BLOCKING transitions
2016-01-26 08:20:42 +00:00
Alexander Köplinger 770a4f217a [Mono.Posix] Disable new ControlMsg() test that fails on OSX for now
Added with https://github.com/mono/mono/pull/2097. Fails on Jenkins:

```
Test Case Failures:
1) MonoTests.Mono.Unix.Native.SocketTest.ControlMsg : System.ArgumentException : Invalid argument
  ----> Mono.Unix.UnixIOException : Invalid argument [EINVAL].
at Mono.Unix.UnixMarshal.ThrowExceptionForLastError () [0x00000] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs:460
at MonoTests.Mono.Unix.Native.SocketTest+<ControlMsg>c__AnonStorey2.<>m__0 (Int32 so1, Int32 so2) [0x0018f] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs:778
at MonoTests.Mono.Unix.Native.SocketTest.WithSocketPair (System.Action`2 f) [0x00025] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs:68
at MonoTests.Mono.Unix.Native.SocketTest.<ControlMsg>m__9 (Int32 inner_so1, Int32 inner_so2) [0x00014] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs:739
at MonoTests.Mono.Unix.Native.SocketTest.WithSocketPair (System.Action`2 f) [0x00025] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs:68
at MonoTests.Mono.Unix.Native.SocketTest.ControlMsg () [0x00000] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs:738
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
--UnixIOException
```
2016-01-26 02:12:18 +01:00
Zoltan Varga f0524aa471 [llvmonly] Call 'opt' when running with --aot=asmonly too. No optimizations enabled yet. 2016-01-25 19:37:40 -05:00
Zoltan Varga b382b97e67 [llvm] Add another missing opcode. 2016-01-25 19:14:03 -05:00
Rodrigo Kumpera 1684cfd594 Merge pull request #2483 from ludovic-henry/monoerror-mono_string_new_size
[runtime] Use MonoError for mono_string_new_size
2016-01-25 19:07:23 -05:00
Rodrigo Kumpera 6f9822ed9d Merge pull request #2493 from ludovic-henry/monoerror-mono_thread_attach_full
[runtime] Use MonoError for mono_thread_attach_full
2016-01-25 18:54:22 -05:00
Rodrigo Kumpera 744cfa4e71 Merge pull request #2489 from ludovic-henry/monoerror-mono_array_new_specific
[runtime] Use MonoError for mono_array_new_specific
2016-01-25 17:42:33 -05:00
Rodrigo Kumpera fcf31f59c8 Merge pull request #2481 from ludovic-henry/monoerror-mono_array_new_full
[runtime] Use MonoError for mono_array_new_full
2016-01-25 17:38:41 -05:00
Zoltan Varga 71ddc3f35b [llvmonly] Reenable running 'opt', it was disabled by mistake. 2016-01-25 16:56:41 -05:00
Zoltan Varga 8b6e622639 [llvmonly] Avoid inlining the original method into unbox trampolines. 2016-01-25 16:56:41 -05:00
Ludovic Henry 2e60eebcef [coop] Use mono_thread_info_usleep which transition to BLOCKING state
Because we could sleep for too long, while being in RUNNING state, the cooperative suspend would not finish in a timely manner. That would lead to the abort in `mono_threads_wait_pending_operations`.
2016-01-25 21:50:02 +00:00
Ludovic Henry bea61abd81 [coop] Fix debugger BLOCKING transitions
Make the transition as close as possible to the syscall, so we don't nest these BLOCKING transition, as they leads to a crash.
2016-01-25 21:08:37 +00:00
Ludovic Henry d37152e8e1 [runtime] Use MonoError for mono_object_new_pinned 2016-01-25 20:37:24 +00:00
Aleksey Kliger 1419a6775f [runtime] Use MonoError for RESOLVE_TYPE 2016-01-25 15:30:40 -05:00
Jonathan Pryor 44e2c53f8d Merge pull request #2097 from steffen-kiess/posix-sockets-3
[Mono.Posix] Add support for sending and receiving socket control messages
2016-01-25 15:03:53 -05:00
Aleksey Kliger 0f585640ff [runtime] Use MonoError for check_array_for_usertypes 2016-01-25 14:57:34 -05:00
Jonathan Pryor bbe1010ef4 [runtime] Allow getting thread name, managed id from embedding API
When tracing multi-threaded program execution, it is useful to have a
way of separating which events happen on which thread. The
System.Threading.Thread.Name and Thread.ManagedThreadId properties are
useful proxies for tracking program execution.

However, if program execution spans both managed and embedded mono
native code, there is no existing mechanism to read the Thread.Name or
Thread.ManagedThreadId properties from native code without using
delegates, and delegates may not be usable in all circumstances (e.g.
within a mono_gc_register_bridge_callbacks() callback).

Add the following APIs to the embedding API to permit reading the
Thread.Name and Thread.ManagedThreadId properties:

	char   *mono_thread_get_name_utf8 (MonoThread *thread);
	gint32  mono_thread_get_managed_id (MonoThread *thread);

mono_thread_get_name_utf8() returns the Thread.Name value as a UTF-8
string in newly allocated memory; the caller must g_free() this value.

mono_thread_get_managed_id() returns the Thread.ManagedThreadId value.
2016-01-25 14:29:00 -05:00
Zoltan Varga 7fae2542c5 [llvmonly] Rename MonoDelegate.rgctx to 'extra_arg' to better reflect its purpose. 2016-01-25 14:18:59 -05:00
Zoltan Varga 96c006b637 Merge pull request #2429 from alexanderkyte/nunit_lite_integration
[nunit-lite] Add nunit-lite runner to build system
2016-01-25 13:45:37 -05:00
Sebastien Pouliot 8d275a6388 [tests][System][ios] Avoid reflection usage when testing for Xamarin.iOS. Fixes #34133
When the linker is enabled (default for device builds) unused methods
are removed and cannot be reflected.

In this case we do not need reflection as the answer to port reuse is
always true.

https://bugzilla.xamarin.com/show_bug.cgi?id=34133
2016-01-25 13:45:11 -05:00
Aleksey Kliger 73ab563517 [runtime] Use MonoError for mono_reflection_type_resolve_user_types 2016-01-25 12:50:34 -05:00
Zoltan Varga 79870dabf8 [amd64] Fix d786f235eb. 2016-01-25 12:37:09 -05:00
monojenkins c5b1a68cba Merge pull request #2504 from ludovic-henry/fix-console-error
[Console] Fix Console.Error to terminal (tty)
2016-01-25 16:45:18 +00:00
Ludovic Henry a682d94799 [Console] Cleanup console setup 2016-01-25 15:07:55 +00:00
Ludovic Henry 15cc0d6be2 [Console] Fix Console.Error to terminal (tty)
We would previously open the standard output for the Console.Error StreamWriter. This behavior has never surfaced so far, because if you try to redirect the process standard output through a pipe or to a file, then the condition ConsoleDriver.IsConsole does not apply, and the other path does not have the same bug.

The only way to reproduce it is to redirect the standard error to another file, and observe that you would still have the Console.Error content. For example, with mono/tests/console-output.exe:

Expected output:

$> MONO_PATH=mcs/class/lib/net_4_x mono/mini/mono mono/tests/console-output.exe 2>/dev/null
Out

Actual output:

$> MONO_PATH=mcs/class/lib/net_4_x mono/mini/mono mono/tests/console-output.exe 2>/dev/null
Out
Error

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=36988
2016-01-25 15:07:33 +00:00
Marcos Henrich 80eb29884c [System.Xml] Fix sub class serialization on lists
Fixes failure, where XmlSerializer would crash while serializing
a list with multiple XmlElement when a sub class of the XmlElement is
used.

Fixes #36829.
2016-01-25 12:44:25 +00:00
Zoltan Varga 6b464858ad Remove libgc/depcomp and libgc/missing, newer automake versions seem to overwrite them. 2016-01-24 20:46:01 -05:00
Zoltan Varga 2de2730abf [llvm] Fix 32 bit platform support which got broken after c678533842. 2016-01-24 20:40:21 -05:00
Zoltan Varga d786f235eb [amd64] Add some more unwind info for generic trampolines. 2016-01-24 20:16:28 -05:00
Zoltan Varga e44a09a704 [llvmonly] Optimize delegate invocation. 2016-01-24 18:09:27 -05:00
Ludovic Henry 13c1a05d19 [runtime] Use MonoError for mono_string_alloc 2016-01-24 17:57:37 +00:00
Zoltan Varga 55df1b0b94 Merge pull request #2487 from alexanderkyte/wrapper_type_mismatch
[runtime] Fix type mismatch between runtime invoke and aot compiler
2016-01-23 22:29:30 -05:00
Zoltan Varga 54f7062bf7 [llvmonly] Fix the invocation of generic array helpers, they need an rgctx arg. 2016-01-23 22:09:40 -05:00
monojenkins 3d1cf80712 Merge pull request #2499 from alexrp/signal-sa-restart
[runtime] Add SA_RESTART to SIG{CONT,INT,PROF,QUIT,USR2,WINCH}.

We need this as these signals can be delivered at any point and can interrupt system calls that external (non-Mono) code is executing, which such code may not be written to handle gracefully.
2016-01-23 18:45:14 +00:00
Rodrigo Kumpera 3cc7093034 Merge pull request #2453 from kumpera/fix_ji_free
[runtime] Avoid a read-after-free in JI table that frees tomstones. Fixes some of the crashes in #36851.
2016-01-23 00:10:59 -05:00
Rolf Bjarne Kvinge 8bab3f81f2 [linker] Add API to notify subclasses of removed attributes. 2016-01-23 03:11:07 +01:00
Zoltan Varga 048a9be186 [arm] Emit more complete unwind info for generic trampolines. 2016-01-22 18:20:38 -05:00
Alexander Kyte c6e9e79a17 [mobile_static] Fixed AES class usage for mobile_static profile 2016-01-22 16:28:10 -05:00
Alexander Kyte 6f91fba64e [bcl/build] Move the config include before setting platform if it is missing, otherwise wrong platform file included 2016-01-22 16:28:10 -05:00
Alexander Kyte 5caddab1b7 [mobile_static] Work around a test that breaks with aot loading 2016-01-22 16:28:10 -05:00
Alexander Kyte 201f649750 [mobile_static] Fix test by replicating monotouch behavior 2016-01-22 16:28:10 -05:00
Alexander Kyte eddf4b4439 [mobile_static] Disable task test described to fail on Touch.Unit and clearly on mobile_static 2016-01-22 16:28:09 -05:00
Alexander Kyte 357046f340 [bcl] Mark finalizer-dependent test as not working because finalizers are not guaranteed, too flaky for bcl test suite 2016-01-22 16:28:09 -05:00
Alexander Kyte b5c2b5892f [bcl] Add current directory to reflection lookup path to fix nunit-lite tests. 2016-01-22 16:28:09 -05:00
Alexander Kyte 32f9d52b36 [mobile_static] Fixed test that needed test .dlls explicitly named 2016-01-22 16:28:08 -05:00
Alexander Kyte d1e3696e02 [mobile_static] Added missing mobile_static blacklists 2016-01-22 16:28:08 -05:00
Alexander Kyte 5796ab1122 [bcl] Remove trailing whitespace from corlib_test.dll.sources 2016-01-22 16:28:08 -05:00
Alexander Kyte d715c9e301 [mobile_static] Don't run vts tests on mobile_static 2016-01-22 16:28:08 -05:00
Alexander Kyte 6ce42c1b1e [mobile_static] Exclude the MobileNotWorking category on mobile_static 2016-01-22 16:28:07 -05:00
Alexander Kyte 48f75ebd8a [bcl/mobile] Fixed TimeZoneTest on non-xammac/non-monotouch mobile profiles 2016-01-22 16:28:07 -05:00
Alexander Kyte 4cf9303189 [bcl] Exclude tests for mobile_static excluded on monotouch 2016-01-22 16:28:07 -05:00
Alexander Kyte a5018ac8b4 [bcl] Add mobile_static sources/excludes based on monotouch excluded tests 2016-01-22 16:28:06 -05:00
Alexander Kyte 9dca28b44c [mobile_static] Remove include of Mono.Posix.dll on mobile static, which isn't build 2016-01-22 16:28:06 -05:00
Alexander Kyte 860334ff45 [bcl] Make the bcl build system respect .excludes for test suites 2016-01-22 16:28:06 -05:00
Alexander Kyte 8c2a325a97 [bcl] Fix gensources undesired behavior, see full message
So we were previously taking the set symmetric difference of the
.sources and the .excludes files. This is semantically wrong, and the
change makes us take the difference. What we were doing is concatenating
the two files and taking any lines that are only seen once. If a file is
in excludes and not in sources, then we will include it. This is wrong.
This change always duplicates excludes, so anything present in excludes
is seen at least twice. This has the effect of making sure that only
things in .sources but not in .excludes are in the output file.
2016-01-22 16:28:06 -05:00
Alexander Kyte 42e6da0861 [nunit-lite] Use nunit-lite in the build system if variable set, set for mobile_static 2016-01-22 16:28:05 -05:00
Alexander Kyte eb47d2ad19 [nunit-lite] Add NUnitLite fork as submodule and build through makefiles
in /mcs/tools/nunit-lite
2016-01-22 16:28:05 -05:00
Alex Rønne Petersen 6a9f742ef0 [runtime] Add SA_RESTART to SIG{CONT,INT,PROF,QUIT,USR2,WINCH}.
We need this as these signals can be delivered at any point and can interrupt
system calls that external (non-Mono) code is executing, which such code may
not be written to handle gracefully.
2016-01-22 21:22:28 +01:00
Sebastien Pouliot b901571647 [system] Avoid reflection use to create NtlmSession. Fixes #37732
commit d2325f1483 (only since 4.3.2, not
4.3.1) caused the failure when an application is linked.

The use of `GetOrCreateValue` uses reflection to create an `NtlmSession`
instance so the linker won't see it as used anymore (and removes it).

Fixed by avoiding reflection (which will also perform better).

https://bugzilla.xamarin.com/show_bug.cgi?id=37732
2016-01-22 14:19:46 -05:00
Ludovic Henry b1eb334287 [runtime] Fix warning 2016-01-22 18:25:38 +00:00
Marek Safar 65dfcdc853 [mcs] String interpolating of dynamic arguments does not behave like normal dynamic operation but assumes all arguments are object only (not dynamic). Fixes #37886 2016-01-22 18:23:14 +01:00
Zoltan Varga db4b457433 [amd64] Fix setting ainfo->pair_size[1] to 1 instead of 0 if the argument is only passed in one reg. 2016-01-22 11:27:51 -05:00
Alexander Köplinger 71a04c0cb7 Merge pull request #2494 from nealef/master
Adjust last fix to bypass another compiler failing
2016-01-22 16:40:41 +01:00
Neale 324c33e4a6 Adjust last fix to bypass another compiler failing 2016-01-22 10:36:28 -05:00
Ludovic Henry be14926028 [runtime] Use MonoError for mono_thread_attach_full 2016-01-22 14:39:51 +00:00
Ludovic Henry 174da030a7 [runtime] Use MonoError for new_thread_with_internal 2016-01-22 14:33:04 +00:00
Alexander Köplinger 0d787e165d Merge pull request #2476 from ludovic-henry/fix-process-readbuffer-nullref
[Process] Fix NullReferenceException in AsyncStreamReader.ReadBuffer after disposing the Process
2016-01-22 15:02:39 +01:00
Ludovic Henry 0a53cf8c92 [Process] Fix NullReferenceException in AsyncStreamReader.ReadBuffer after disposing the Process
The following exception would arise if we dispose the Process before making sure the AsyncStreamReader finished its work:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at System.Diagnostics.AsyncStreamReader.ReadBuffer (IAsyncResult ar) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/System/services/monitoring/system/diagnosticts/AsyncStreamReader.cs:158
  at System.IO.Stream+ReadWriteTask.InvokeAsyncCallback (System.Object completedTask) [0x00015] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/io/stream.cs:670
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x0008d] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/executioncontext.cs:957
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/executioncontext.cs:904
  at System.IO.Stream+ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke (System.Threading.Tasks.Task completingTask) [0x0005e] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/io/stream.cs:696
  at System.Threading.Tasks.Task.FinishContinuations () [0x0009a] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:3633
  at System.Threading.Tasks.Task.FinishStageThree () [0x00045] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2366
  at System.Threading.Tasks.Task.FinishStageTwo () [0x000f8] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2339
  at System.Threading.Tasks.Task.Finish (Boolean bUserDelegateExecuted) [0x00049] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2239
  at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task& currentTaskSlot) [0x00079] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2834
  at System.Threading.Tasks.Task.ExecuteEntry (Boolean bPreventDoubleExecution) [0x0006f] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2760
  at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2707
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/threadpool.cs:857
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/threadpool.cs:1212

This would arise in test-runner.cs when one of the test would timeout, leading to the Process being disposed. This would then dispose the AsyncStreamReader, setting its `stream` value to null. The callback to ReadBuffer would then try to access `stream`, but would throw a NullReferenceException. By not disposing the AsyncStreamReader explicitely, we close the stream first, which will trigger a call to ReadBuffer, thus not triggering the NullReferenceException.
2016-01-22 13:57:05 +00:00
Alexander Köplinger 497c6b9340 Merge pull request #2482 from akoeplinger/mono-posix-test-fix
[Mono.Posix] Make UnixSignalTest.TestRaiseStorm() more reliable
2016-01-22 14:38:16 +01:00
Ludovic Henry 71c1a8ad9b [runtime] Use MonoError for create_thread_object and create_internal_thread 2016-01-22 12:57:38 +00:00
Ludovic Henry 1ae4775fe3 [runtime] Use MonoError for mono_array_new_specific 2016-01-22 12:12:37 +00:00
Ludovic Henry 29830a7805 [runtime] Use MonoError for mono_array_new_full 2016-01-22 11:26:35 +00:00
Ludovic Henry 7a2f9e9ef9 Merge pull request #2477 from ludovic-henry/monoerror-mono_object_new_alloc_specific
[runtime] Use MonoError for mono_object_new_alloc_specific
2016-01-22 11:13:58 +00:00
Zoltan Varga 05d02a659f Merge pull request #2488 from nealef/master
…
2016-01-21 22:28:16 -05:00
Neale b205c72172 To get around a problem with gcc 4.4.7 on s390x, the SWAP macro is reworked so that it correctly processes all elements 2016-01-21 21:41:44 -05:00
Ludovic Henry 766a72b2c1 [runtime] Use MonoError for mono_string_new_size 2016-01-22 01:21:32 +00:00
Ludovic Henry 80fbe18d65 [runtime] Use MonoError for mono_object_new_alloc_specific 2016-01-22 01:13:22 +00:00
Rodrigo Kumpera 6af870bde0 Merge pull request #2485 from ludovic-henry/monoerror-mono_marshal_alloc
[runtime] Use MonoError for mono_marshal_alloc
2016-01-21 19:55:39 -05:00
Rodrigo Kumpera 33cc441b9b Merge pull request #2484 from ludovic-henry/monoerror-mono_string_get_pinned
[runtime] Use MonoError for mono_string_get_pinned
2016-01-21 19:54:37 -05:00
Rodrigo Kumpera f22404e2f2 Merge pull request #2480 from ludovic-henry/monoerror-mono_object_clone
[runtime] Use MonoError for mono_object_clone
2016-01-21 19:41:07 -05:00
Rodrigo Kumpera e7d47527e5 Merge pull request #2479 from ludovic-henry/monoerror-mono_object_new_mature
[runtime] Use MonoError for mono_object_new_mature
2016-01-21 19:39:45 -05:00
Rodrigo Kumpera 7eb4bdafff Merge pull request #2478 from ludovic-henry/monoerror-mono_object_new_fast
[runtime] Use MonoError for mono_object_new_fast
2016-01-21 19:39:13 -05:00
Rodrigo Kumpera 31ad052f43 Merge pull request #2462 from ludovic-henry/monoerror-mono_object_new_specific
[runtime] Use MonoError for mono_object_new_specific
2016-01-21 19:33:58 -05:00
Rodrigo Kumpera 08eb798c43 Merge pull request #2458 from ludovic-henry/monoerror-mono_domain_create_appdomain_internal
[runtime] Use MonoError for mono_domain_create_appdomain_internal
2016-01-21 18:47:35 -05:00
Rodrigo Kumpera c8536eb291 Merge pull request #2457 from ludovic-henry/monoerror-mono_make_shadow_copy
[runtime] Use MonoError for mono_make_shadow_copy
2016-01-21 18:46:22 -05:00
Alexander Kyte 883dda52ce [nunit-lite] Use nunit-lite in the build system if variable set, set for mobile_static 2016-01-21 18:20:55 -05:00
Alexander Kyte 1564b8fa1d [nunit-lite] Add NUnitLite fork as submodule and build through makefiles
in /mcs/tools/nunit-lite
2016-01-21 17:25:15 -05:00
Zoltan Varga 3556a48318 [bcl] Fix a System.Core test failure caused by a method linked away. 2016-01-21 17:23:53 -05:00
Alexander Kyte 748d01ce2a [runtime] Fix type mismatch between runtime invoke and aot compiler
We were using get_runtime_invoke_type () to reduce the number of
wrappers we were using by sharing the wrappers that have MONO_TYPE_I
with that of MONO_TYPE_PTR. They have the same size, but these are not
valid types to share because they have different levels of indirection,
so runtime wrappers that have been aot'ed for the MONO_TYPE_I will be
used for MONO_TYPE_PTR and will dereference the value in the first word
of the pointer. In the case that this is null, we observed a segfault.

Specifically, the wrapper code in marshal.c looks like so:

```
		case MONO_TYPE_I:
		case MONO_TYPE_U:
		case MONO_TYPE_I4:
		case MONO_TYPE_U4:
		case MONO_TYPE_R4:
		case MONO_TYPE_R8:
		case MONO_TYPE_I8:
		case MONO_TYPE_U8:
			mono_mb_emit_byte (mb, CEE_LDIND_I);
			mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i]));
			break;
		case MONO_TYPE_STRING:
		case MONO_TYPE_CLASS:
		case MONO_TYPE_ARRAY:
		case MONO_TYPE_PTR:
		case MONO_TYPE_SZARRAY:
		case MONO_TYPE_OBJECT:
			mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i]));
			break;
```

showing that the two types are not equivalent.
2016-01-21 16:37:26 -05:00
Zoltan Varga 9de58e5f75 [llvmonly] Fix the addition of gsharedvt out wrappers on calls from gsharedvt to normal code. 2016-01-21 16:29:57 -05:00
Rodrigo Kumpera 92d212ed3e Merge pull request #2474 from kumpera/compact_mono_error
[MonoError] Introduce fast (and short) macros for initing and checking MonoError. Optimize its size.
2016-01-21 16:19:31 -05:00
Rodrigo Kumpera a40063e0c1 [MonoError] Fix the definition of init_error. 2016-01-21 16:13:21 -05:00
Martin Baulig 10853876d0 [Mono.Security]: Add 'MonoTlsSettings.EnabledCiphers'.
(cherry picked from commit 79c7c38cc6)
2016-01-21 21:47:48 +01:00
Zoltan Varga 7003343902 [jit] Fix the reference type detection for Volatile:Read/Write (). Fixes part of #37846. 2016-01-21 14:31:02 -05:00
Ludovic Henry a81f0942b3 [marshal] Inline mono_gc_out_of_memory to explicitly raise an exception 2016-01-21 17:41:13 +00:00
Mark Probst 2c0682c70f Merge pull request #2387 from BrzVlad/feature-concurrent-scanfunc
[sgen] Use separate object ops when not evacuating in the concurrent case
2016-01-21 09:40:48 -08:00
Mark Probst 849623f0ae Merge pull request #2388 from BrzVlad/feature-los-caching
[sgen] Improve caching of los objects
2016-01-21 09:39:37 -08:00
Ludovic Henry 8b4240cd17 [runtime] Use MonoError for mono_marshal_alloc 2016-01-21 17:37:32 +00:00
Ludovic Henry 60b1e56ae4 [runtime] Use MonoError for mono_string_get_pinned 2016-01-21 17:01:01 +00:00
Ludovic Henry d0084b84dd [runtime] Use MonoError for mono_object_clone 2016-01-21 16:59:42 +00:00
Ludovic Henry 03f07a6d8c [runtime] Use MonoError for mono_object_new_mature 2016-01-21 16:59:11 +00:00
Ludovic Henry 20f411f317 [runtime] Use MonoError for mono_object_new_fast 2016-01-21 16:58:45 +00:00
Ludovic Henry 200d2e0e53 [runtime] Use MonoError for mono_object_new_specific 2016-01-21 16:56:47 +00:00
Rodrigo Kumpera b762ef0fa3 Merge pull request #2472 from kumpera/gc_api_fixes
[gc] Change the GC interface to be friendlier to coop and misc cleanups.
2016-01-21 11:54:02 -05:00
Alexander Köplinger 4f6d638a3f [Mono.Posix] Make UnixSignalTest.TestRaiseStorm() more reliable
The test was reenabled in 3f3df26945 and we were seeing it randomly fail
on Jenkins on OSX like that:

```
[...]
***** MonoTests.Mono.Unix.UnixSignalTest.TestNoEmitAny
***** MonoTests.Mono.Unix.UnixSignalTest.TestRaise
***** MonoTests.Mono.Unix.UnixSignalTest.TestRaiseAny
***** MonoTests.Mono.Unix.UnixSignalTest.TestRaiseStorm
/bin/sh: line 1: 40164 Hangup: 1               PATH="/Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/runtime/_tmpinst/bin:/opt/mono/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" MONO_REGISTRY_PATH="/Users/builder/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" MONO_PATH="./../../class/lib/net_4_x::$MONO_PATH" /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/runtime/mono-wrapper --debug ./../../class/lib/net_4_x/nunit-console.exe Mono.Posix_test_net_4_x.dll -noshadow -labels -exclude=NotOnMac,NotWorking,ValueAdd,CAS,InetAccess -labels -xml=TestResult-net_4_x.xml
make[1]: *** [run-test-lib] Error 1
make[1]: Leaving directory `/Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/Mono.Posix'
make: *** [do-run-test] Error 1
```

The problem is that (especially on OSX it seems) the signals raised by the threads in the test can be
delivered after we closed the UnixSignal, which means the default behavior of terminating the program kicks in.

The simplest fix is to just sleep for some time to make sure the signal is delivered and ignored before closing.
2016-01-21 17:11:18 +01:00
monojenkins 40b11bae27 Merge pull request #2471 from ludovic-henry/checkedbuild-disable-mempool
[checked-build] Add compile flag to disable checked-build tests selectively
2016-01-21 15:05:16 +00:00
Ludovic Henry 50322c1c84 [checked-build] Add compile flag to disable checked-build tests selectively 2016-01-21 11:37:55 +00:00
Marek Safar 2c4cb3db15 Merge pull request #2475 from sandyarmstrong/getcultureinfo-37848
[corlib] Throw correct exception for GetCultureInfo(0)
2016-01-21 09:32:25 +01:00
Sandy Armstrong e0ab3c92d1 [corlib] Throw correct exception for GetCultureInfo(0)
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=37848
2016-01-20 19:45:03 -08:00
Rodrigo Kumpera 48508e1f9e Add mono-error macros for init and check. 2016-01-20 20:34:10 -05:00
Rodrigo Kumpera 4df79f9383 [MonoError] Don't use type_name for the argument name, it will produce weird results with mono_error_get_message. 2016-01-20 20:32:25 -05:00
Rodrigo Kumpera 3779239a7c [MonoError] Reduce the size of MonoError to conserve stack space.
This eliminates the builtin 128 bytes char array in MonoError and forces the error message to be always malloc'd.

It makes the code simpler and sacrifices a bit in terms of what we can handle in the case of a malloc OOM.

Malloc OOM is not a solvable problem for a few reasons.
1) Overcommit and virtual memory makes relying on malloc returning zero not an useful thing.
2) Everything goes south when malloc starts to fail. There's nothing much the runtime can do beyond
give up.

OTOH, saving stack space is pretty nice for its own reasons.

1) Clang now generates stack guards by default for frames larger than 120 bytes on amd64. This
means that MonoError has a much bigger overhead than needed.

2) We conservatively scan the stack and, with this change, those are 128 bytes less for the gc to figure out.

On ABI compatibility. We promise backward but not forward compatibility. Meaning someone compiling against 4.4
can't expect it to works against 4.2, but vice versa is fine.

We can handle old users because the struct is now smaller and has always being opaque, meaning callers just
a bit of waste space and that's it.
2016-01-20 20:22:34 -05:00
Rodrigo Kumpera 41599512c9 [boehm] Fix the usage of G_UNLIKELY. 2016-01-20 19:44:20 -05:00
Zoltan Varga 1c6d79067a [llvmonly] Make sure the signature of unbox trampolines matches the method they are calling. 2016-01-20 17:23:56 -05:00
Rodrigo Kumpera c77c37c468 [gc] Simplify mono_object_new_pinned.
Remove #ifdef around that function and make it register objects for finalization as other alloc functions do.
2016-01-20 16:42:25 -05:00
Rodrigo Kumpera a7a3da0dd3 [gc] Introduce mono_object_new_mature in the same fashion as the other alloc functions.
This means the following:
mono_object_new_mature handles OOM and finalization.
GC glue code returns NULL on failure and doesn't deal with finalization.

Finally, correctly implement mono_gc_alloc_mature in boehm and null-gc instead of the
semantically different implementation we had before.
2016-01-20 16:42:25 -05:00
Rodrigo Kumpera 42ef42fcee [gc] Move OOM handling into the runtime from the GC.
The current gc interface requires the GC to call mono_gc_out_of_memory on allocation failure.

It won't work if we move away from implementing it with mono_raise_exception as we need to manually bubble
the OOM all the up to the m2n border.

The good thing is that this simplified the gc interface and actually fixes a corner case bug in sgen where
it did not call mono_gc_out_of_memory on alloc failure.
2016-01-20 16:42:25 -05:00
Zoltan Varga b10fa95c34 [llvmonly] Fix runtime invoke calls to gsharedvt methods without variable signatures. Add gsharedvt out wrappers and in wrappers for delegate invoke wrappers. 2016-01-20 15:47:30 -05:00
Zoltan Varga e555546568 [runtime] Add a new helper function mono_method_get_full_name (), which is similar to mono_method_full_name (), but the result includes the return type as well. 2016-01-20 15:33:49 -05:00
Zoltan Varga 3887f9efb5 Merge pull request #2465 from alexanderkyte/remoting_debugger_ifdef_fix
[runtime] ifdef out remoting function call in debugger
2016-01-20 11:28:38 -05:00
Alexander Kyte e20470b314 [runtime] ifdef out remoting function call in debugger 2016-01-20 11:13:38 -05:00
Ludovic Henry bd033e64e4 [runtime] Use MonoError for mono_domain_create_appdomain_internal 2016-01-20 15:30:20 +00:00
Ludovic Henry 147409d5a7 [runtime] Use MonoError for mono_make_shadow_copy 2016-01-20 12:57:26 +00:00
Zoltan Varga 4352e78759 [llvmonly] Fix the type of the vret_addr argument. 2016-01-19 21:40:50 -05:00
Martin Baulig 8a38b0f7fa [System]: Change namespace for some internal classes.
(cherry picked from commit 997513da02)
2016-01-20 01:52:02 +01:00
Martin Baulig 7cd40b8100 [System]: Remove unpredictable pluggable setup and cleanup APIs.
(cherry picked from commit 2d945d75bb)
2016-01-20 01:03:06 +01:00
Zoltan Varga ff2a0b83b9 [aot] Enable -O=gsharedvt by default when its supported on the platform. 2016-01-19 17:56:05 -05:00
Zoltan Varga cbf8bf588b [aot] Small refactoring for gsharedvt method lookup. 2016-01-19 17:49:49 -05:00
Zoltan Varga 688e12f498 [llvmonly] Set the del->rgctx field for delegates created using reflection as well. 2016-01-19 15:57:37 -05:00
Rodrigo Kumpera 9122de4503 [runtime] Avoid a read-after-free in JI table that frees tomstones. Fixes some of the crashes in #36851.
Due to how JI table search works, tombstones must be malloc'd as they must have the same address range
of the JI they are replacing.

Since tombstones are heap allocated, they must be freed together with the chunks they belong to.

The current code free tombstones when the chunk refcount goes to zero. The freeing code identify
tombstones by looping through the chunk entries.

The problem is that, under heavy contention, a domain can have multiple tables live at the same time.
It happens there's another thread using the old table while the first creates the new one.

During that period of multiple live tables, we don't free JIs straight away, we queue them to be
freed together with the next table to go through it.

So far so good. Here's the problematic scenario:

1) We expand the JI table, there's contention and the old old is delay freed.
While doing it, chunk X is split. Meaning its refcount will remain 1.

2) JI Y that belongs to chunk X is freed, the tombstone is installed in a chunk of the new table.
That chunk *is not* X.
Since there was contention in (1), Y is put in jit_info_free_queue.

3) We run mono_jit_info_table_free for the old table.

3.a) We free all delayed JIs. Y is freed.
3.b) The old table is freed, chunk X will be freed too, since its refcount dropped to zero.
We walk X looking for tombstones, which includes a pointer to Y, which is freed memory at this point.

I found this issue to be possible with delegates being marshaled to function pointers.
Part (1) just requires a process with high activity, like XS.
Part 2 & 3 requires really bad scheduling in that once sgen restarts the world, the finalizer thread
runs before mono_thread_hazardous_try_free_some (done right after dropping the GC lock).
An alternate to bad scheduling is that the finalizer thread was suspended holding the domain lock and
now after restart, it forces the GC initiator to deschedule when it tries to get that lock.

It goes without saying that this bug is EXTREMELY hard to reproduce. It required me to change the runtime
to force all the above conditions to happen. Let me mention them in case someone needs it:

- In mono_thread_hazardous_free_or_queue, I commented the calls to try_free_delayed_free_item to avoid
freeing the old table too early. I changed the conditional so free_func is never called straight away.

- In mono_thread_hazardous_try_free_some I added a sleep of 100ms, this gave the finalizer thread enough
time to free some JIs.

Finally, the fix itself, the solution is pretty straightforward. Stop scanning chunks and store a singly
linked list of tombstones installed in a given chunk. We build that list by coopting next_jit_code_hash
for this use.

This is safe because chunks are ref counted so we know nothing else could point to those tombstones and
when we copy a chunk into a new one we remove all tombstones.
2016-01-19 15:47:35 -05:00
Steffen Kieß 2225b6a260 [Mono.Posix] Add support for sending and receiving socket control messages
Add wrappers for struct cmsghdr, the macros for manipulating control
messages (CMSG_*) and recvmsg() and sendmsg().
2016-01-19 20:43:07 +01:00
Ludovic Henry 12bb0d6f11 [tests] Output more debug information in case of test-runner.exe crash 2016-01-19 18:46:37 +00:00
Alexander Köplinger 5436bc0e5c [io-layer] Fix tarball broken by 39393f118d
A new file io-trace.h was added but not listed in any Makefile sources anywhere so it didn't end up in the tarball.
2016-01-19 15:25:02 +01:00
Alex Rønne Petersen fb197673ce Merge pull request #2433 from alexrp/thread-volatile-semantics
[runtime] Make VolatileRead/VolatileWrite semantics compatible with MS.NET.
2016-01-19 14:02:51 +01:00
Zoltan Varga e9efdb6b4c Merge pull request #2399 from alexanderkyte/seq_point_nostop
[runtime] Use explicit loop checking to remove depth limitation of sequence point search.
2016-01-19 04:40:24 -05:00
Zoltan Varga 58fde58a62 Merge pull request #2397 from alexanderkyte/debugger_appdomain
[runtime] Read fields out of TransparentProxies correctly in debugger agent FIXES 36823
2016-01-19 04:39:54 -05:00
Marek Habersack cc986c39d6 Merge pull request #2450 from grendello/io-layer-trace
Replace the old DEBUG messages with calls to mono_trace.
2016-01-19 08:49:42 +01:00
monojenkins df739906a1 Merge pull request #2451 from akoeplinger/fix-osx
[Mono.Posix] Fix OSX build break by checking if accept4() is available

It's a Linux-specific extension and not available on OSX or Linux <2.6.28

/cc @steffen-kiess @jonpryor 

@monojenkins merge
2016-01-19 06:45:15 +00:00
Alexander Köplinger d243b9168c [Mono.Posix] Fix OSX build break by checking if accept4() is available
It's a Linux-specific extension and not available on OSX or Linux <2.6.28
2016-01-19 03:58:25 +01:00
monojenkins b1945bc0a6 Merge pull request #2447 from kumpera/amd64_gsharedvt
[amd64] First pass at fixing issues related to gsharedvt.
2016-01-19 00:30:57 +00:00
Zoltan Varga b5d8d7f9d0 [llvmonly] Avoid inlining methods which call MethodBase:GetCurrentMethod (). 2016-01-18 19:15:30 -05:00
Zoltan Varga fd4d07258f [llvmonly] Fix the passing of byref arguments in runtime invoke. 2016-01-18 18:41:18 -05:00
Marek Habersack 39393f118d Replace DEBUG messages with calls to mono_trace
The messages contain useful debugging information which is unavailable
unless the mono runtime is recompiled. The debugging information is
particularly useful on mobile platforms and in test runs on bots.

The I/O layer trace messages can be disabled on compile time by
defining the DISABLE_IO_LAYER_TRACE preprocessor symbol.
2016-01-19 00:35:03 +01:00
Marek Habersack 70c675baca Move mono_trace to header file
This commit moves mono_trace to a header file so that all the
calls are inlined, avoiding one function call at the small expense
of binary size.
2016-01-19 00:35:03 +01:00
Zoltan Varga ac3d005aa3 [llvmonly] Fix the MethodBase.GetCurrentMethod () intrinsic so it works with generic methods. 2016-01-18 18:25:53 -05:00
Jonathan Pryor 66321daeda Merge pull request #2006 from steffen-kiess/posix-sockets-2
[Mono.Posix] Add wrappers for struct sockaddr_*
2016-01-18 17:38:38 -05:00
Rodrigo Kumpera 002c8c8cea Merge pull request #2 from xmcclure/rodrigo-fix-build
Additional stubs to fix standard build following [amd64] changes
2016-01-18 17:35:20 -05:00
Andi McClure 511440c86b Additional stubs to fix standard build following [amd64] changes 2016-01-18 17:31:36 -05:00
Zoltan Varga 56c011a929 [llvm] Fix some type imcompatibility problems which happen when a vreg holding an objref is made global and stored into its location which has a different type (IntPtrType () vs ObjRefType ()). 2016-01-18 16:29:07 -05:00
Rodrigo Kumpera 830f44066c Merge pull request #2435 from xmcclure/x-refresh
Improve support for Xamarin platform extensions
2016-01-18 14:38:53 -05:00
Zoltan Varga 1c87be5961 [llvmonly] Fix the catching of exceptions of open types in shared methods by passing mrgctx/this to the mono_llvm_match_exception () function. 2016-01-18 14:02:29 -05:00
Aleksey Kliger e0a5b8b98f [handle] Remove MonoHandleArena chunk_last field.
This changes MonoHandleArena from a queue of chunks to a stack of
chunks.  More importantly, the MonoHandleArena has an initial chunk that
is allocated on the stack together with the arena.  Previously that
initial chunk was at the front of the list of chunks, but now it is at
the end.
2016-01-18 13:34:51 -05:00
Vlad Brezae a7c76b8fc8 [sgen] Don't get the BlockInfo before checking that the object is small
The object could be large and therefore not in a block.
2016-01-18 09:50:41 -08:00
Zoltan Varga 155fc2e401 [llvm] Add some missing opcodes. 2016-01-18 12:02:22 -05:00
Zoltan Varga 33104f6a78 [runtime] Fix native-to-managed calls to delegates which wrap a virtual method. Fixes #37695. 2016-01-18 11:43:07 -05:00
Radek Doulik eb839a4147 [linker] improve method dependencies dumping 2016-01-18 12:33:20 +01:00
Steffen Kieß ac52b7f458 [Mono.Posix] Add wrappers for struct sockaddr_*
Add wrappers for the sockaddr_* structures and add the syscalls using these
structures (bind(), accept(), ...).
2016-01-18 10:04:09 +01:00
Zoltan Varga 8132f83eb9 [llvmonly] Add an instrinsics for MethodBase.GetCurrentMethod () so it works on platforms without stack walks. 2016-01-17 18:25:17 -05:00
Marek Safar ce38fb23c5 [corlib] Improve CancellationTokenSource test 2016-01-16 07:59:33 +01:00
Vlad Brezae dbd9b34fe3 [jit] Move optimization to cprop in order to handle more cases
Cprop can convert more binops to their _IMM counterpart, which would otherwise not be detected at method_to_ir time, allowing us to do strength reduction.
2016-01-15 17:23:07 -08:00
Vlad Brezae f60b11a873 [jit] Simplify strength reduction code emitting when running cprop
We allocate a temporary bb where we can emit the optimization of an instruction. After doing strength reduction, we verify if the bb has instructions, in which case we need to replace the original instruction with the optimized code.
2016-01-15 17:19:27 -08:00
Vlad Brezae da562c22e2 [jit] We don't need to restart cprop if optimizations allocate new vregs
Definitions for these new vregs cannot exist yet since we just created the instructions and they will be scanned next. Just resize the def arrays.
2016-01-15 17:15:50 -08:00
Vlad Brezae 137c0999cc [jit] Don't allocate memory for unused vreg
cfg->next_vreg is not an allocated vreg
2016-01-15 17:13:00 -08:00
Alexander Köplinger 03dca8d1d4 [msvc] Fix Windows build
handle.c/h were missing from the projects.
2016-01-16 00:30:58 +01:00
Zoltan Varga d357db6336 [llvmonly] Share more wrapper types. Avoid adding out wrappers for calls from gsharedvt code to gsharedvt code with a normal signature. Fix the handling of pointer types in runtime invoke. Fix the passing of the same fixed gsharedvt argument in multiple calls. 2016-01-15 18:02:56 -05:00
Zoltan Varga 160798d82e [llvmonly] Avoid a crash in ves_icall_GetCurrentMethod () if the stack walk fails. 2016-01-15 18:02:56 -05:00
Vlad Brezae 9d3604e57b [jit] Refactor strength reduction handling within mono_local_cprop 2016-01-15 14:37:47 -08:00
Rodrigo Kumpera e23f76ad1e [amd64] Fix setting of MonoCompile:ret:dreg in mono_arch_allocate_vars.
The code in mono_arch_allocate_vars would set cfg->ret->dreg to cfg->ret->inst_c0
regardless. This is ok in some cases, but bad in others.

For OP_REGVAR this would do the right thing, dreg should be register that holds
that argument.

For when vret_addr is used, it would modify a var that is not used, so harmless.

For OP_REGOFFSET, inst_c0 alias with inst_offset, which is set to the offset from
RBP to read the var from. So we'd have a dreg set to, sometimes, a negative number.

This was not a problem as after mono_arch_allocate_vars only mono_spill_global_vars
is called and it only checks the dreg in the case of gsharedvt.

The fix is pretty simple, move setting from happening in all cases to only for OP_REGVAR.
2016-01-15 16:26:02 -05:00
Rodrigo Kumpera 1a61f46732 [amd64] Add arg_size field to ArgInfo and update it when storage is ArgOnStack 2016-01-15 16:26:02 -05:00
Rodrigo Kumpera 1af005e7bc [amd64] Properly emit loads to gsharedvt stack args. 2016-01-15 16:26:02 -05:00
Rodrigo Kumpera cafed8cc99 [amd64] Add is_gsharedvt_return_value to ArgInfo. Save to the stack ArgGSharedVtInReg args.
The usage of is_gsharedvt_return_value is easier than having a separate storage as supporting
it would require changing all usage sites and this is only needed by start_call.

All incoming arguments in registers must be saved on the stack as the rest of the JIT
expects to be able to load them from their well known places. Without this change, it would
load a random value instead.
2016-01-15 16:26:01 -05:00
Rodrigo Kumpera 670879e7ca [amd64] Add definition of GSharedVtCallInfo to mini-amd64.h
The GSharedVtCallInfo structure used is the same to the one used by
other targets.
2016-01-15 16:26:01 -05:00
Rodrigo Kumpera 75800eeb5a [amd64] Add some of the missing bits of gsharedvt.
This was enough to get mscorlib to FullAOT with gsharedvt enabled.

Makefile.am.in:
	Don't exclude GSHAREDVT from the tests.
	Removed DYNCALL too, as it's supported too.

mini-amd64.c (mono_arch_init):
	Register mono_amd64_start_gsharedvt_call jit icall.

mini-amd64.c:
	Fix a typo in the ifdef guarding inclusion of the gsharedvt extension.

mini-amd64.c (mono_arch_emit_outarg_vt):
	Implement decomposing of ArgGSharedVtOnStack to a simple store on the stack.

mini-amd64.h:
	define MONO_ARCH_GSHAREDVT_SUPPORTED
	Export mono_amd64_start_gsharedvt_call

tramp-amd64.c (mono_arch_create_sdb_trampoline):
	Add missing mono_profiler_code_buffer_new call.
	Add a couple of functions to !ENABLE_GSHAREDVT

aot-compiler.c (arch_emit_gsharedvt_arg_trampoline):
	Implement it for amd64 as a pair of GOT loads (same for other archs).
2016-01-15 16:26:01 -05:00
monojenkins 4a3addecd1 Merge pull request #2446 from akoeplinger/remove-leftover-file
[corlib] Remove left-over files from long ago (System.PAL/Linux)

They are no longer in use and cause confusion as they show up in search results.

@monojenkins merge
2016-01-15 20:15:17 +00:00
Andi McClure 4d8c202a6e Fix incorrect comment on mono_jit_init_version 2016-01-15 14:31:42 -05:00
Andi McClure a4e257a07f Clarify when ucontext_t is available
mono-context currently uses a mix of MONO_SIGNAL_USE_SIGACTION and
UCONTEXT_REG_RAX #ifs to determine whether ucontext_t is available.
UCONTEXT_REG_RAX is unreliable, and MONO_SIGNAL_USE_SIGACTION is
misnamed because it is nowhere used to gate use of sigaction.
Standardize on a new MONO_SIGNAL_USE_UCONTEXT_T, replacing SIGACTION.
2016-01-15 14:31:12 -05:00
Andi McClure 7a49816cd5 Bottleneck module loader platform macros
processes.c contains implementations for module loading for several
platforms. Rather than scattering PLATFORM_MACOSX etc through the
file, pick a loader at the top of the file and base #ifs on that. This
makes BSD code clearer and makes it easier to special-case OS variants
where the normal loader is not available.
2016-01-18 10:54:51 -05:00
Andi McClure 5d6a5f6b0d Fix build on platforms where native thread IDs are not pointer sized
Certain of our debug prints assume thread ids can be cast directly to
a pointer. This does not work on platforms where thread IDs are ints.
2016-01-15 14:18:56 -05:00
Alexander Köplinger 1b8aef4bbe [corlib] Remove left-over files from long ago (System.PAL/Linux)
They are no longer in use and cause confusion as they show up in search results.
2016-01-15 19:30:18 +01:00
monojenkins f73b752db5 Merge pull request #2444 from xmcclure/randfixes
Bugfixes in mono-rand.c

2 commits:

* Make mono-rand consistent (fixes threadpool on some UNIX systems)

  mono-rand.c defines a function interface and provides three implementations (Windows, modern UNIX, base C standard). The clients of this file (RNGCryptoServiceProvider.cs, threadpool-ms-io.c) appear to be consistent in how they use this interface, but the interface is not documented, and the C-only implementation deviates from it (the return value of init is different). The result is that threadpool-ms-io fails an assert when run on a system using the C-only implementation. I documented the interface and fixed the C-only quirk.

* Fix nonuniform distribution of mono_rand_try_get_uint32

  mono_rand_try_get_uint32 returns a value in a range min..max inclusive. Due to a math error the ‘max’ value will be returned only one out of every 2^32-1 calls to the function. This is currently harmless because the only current callers of this function (in threadpool-ms-io) will run fine even if their max value is never returned, but it could become a problem later.
2016-01-15 18:20:15 +00:00
Alexander Köplinger 61c070c63f Merge pull request #2445 from nealef/master
Fix certmgr when a unicode encoded null is used as password
2016-01-15 18:52:22 +01:00
Neale 819147f693 Fix certmgr when a unicode encoded null is used as password 2016-01-15 11:30:56 -05:00
Andi McClure 68209ec30f Fix nonuniform distribution of mono_rand_try_get_uint32
mono_rand_try_get_uint32 returns a value in a range min..max
inclusive. Due to a math error the ‘max’ value will be returned only
one out of every 2^32-1 calls to the function. This is currently
harmless because the only current callers of this function (in
threadpool-ms-io) will run fine even if their max value is never
returned, but it could become a problem later.
2016-01-15 11:19:35 -05:00
Andi McClure 88ccc14361 Make mono-rand consistent (fixes threadpool on some UNIX systems)
mono-rand.c defines a function interface and provides three
implementations (Windows, modern UNIX, base C standard). The clients
of this file (RNGCryptoServiceProvider.cs, threadpool-ms-io.c) appear
to be consistent in how they use this interface, but the interface is
not documented, and the C-only implementation deviates from it (the
return value of init is different). The result is that
threadpool-ms-io fails an assert when run on a system using the C-only
implementation. I documented the interface and fixed the C-only quirk.
2016-01-15 11:01:31 -05:00
Miguel de Icaza aee167f8ff [getline] Improve the embedded sample 2016-01-15 10:26:16 -05:00
Miguel de Icaza 642b064379 [getline] Fix the logic for advancing the top item 2016-01-15 10:21:44 -05:00
Ludovic Henry 907ee86dbc [Process] Fix monodroid build 2016-01-15 15:14:17 +00:00
Zoltan Varga 7d706b98ce [llvm] Split long bblocks instead of disabling llvm for methods with them. 2016-01-15 10:05:39 -05:00
Zoltan Varga 5580898c82 [llvm] Fix a type conversion problem when calling the same method with two different signatures. 2016-01-15 10:05:39 -05:00
Ludovic Henry 65515ceedc Merge pull request #2362 from ludovic-henry/fix-process-missedoutput
[Process] Use ReferenceSource process async output/error reader
2016-01-15 14:32:32 +00:00
Marek Safar 7788d28f77 Bump reference source for CancellationTokenSource fixes 2016-01-15 15:28:45 +01:00
Marek Safar 991f5a9145 [mcs] Update project file 2016-01-15 10:00:12 +01:00
Marek Safar e57bcfe95d [mcs] Use probing like aproach for member access completion 2016-01-15 10:00:12 +01:00
Vlad Brezae c678533842 Merge pull request #2403 from BrzVlad/feature-emulation-delay
[jit] Delay opcode emulation to allow optimization passes to run on these opcodes
2016-01-15 02:00:17 +00:00
Zoltan Varga 459aee6ee4 [llvmonly] Fix mono_patch_info_equal () for MONO_PATCH_INFO_GSHAREDVT_IN_WRAPPER. 2016-01-14 19:54:54 -05:00
Zoltan Varga acbc18cce4 [llvmonly] Fix the addition of gsharedvt in wrappers around unbox wrappers. 2016-01-14 18:39:03 -05:00
Zoltan Varga 96191ba229 [llvmonly] Fix the gsharedvt parameter passing code so it emits valid llvm il. 2016-01-14 18:00:47 -05:00
Zoltan Varga 2cc337f230 [llvmonly] Add unwind info for unbox wrappers, not the get_unbox_tramp () generated function. 2016-01-14 17:04:54 -05:00
Zoltan Varga 34d130c051 [llvmonly] Fix initialization of static gshared methods, they receive a vtable as the rgctx argument, not a MonoMethodRuntimeGenericContext. Emit unwind info for unbox wrappers. Fix calls to gsharedvt methods from non-shared delegate invoke wrappers. 2016-01-14 16:47:56 -05:00
Aleksey Kliger (λgeek) 687bbf2f71 Merge pull request #2438 from lambdageek/cherry-pick-coop-handle
Cherry pick handles work
2016-01-14 15:15:51 -05:00
Zoltan Varga 7e6188f569 Merge pull request #2439 from akoeplinger/fix-seqpoint-test
[mono] test_op_il_seq_point test should use a temp file for NUnit results
2016-01-14 14:42:17 -05:00
Alexander Köplinger 7d38caa06d [mono] test_op_il_seq_point test should use a temp file for NUnit results
We were seeing red builds on Jenkins because the NUnit xml was malformed when something bad happened
during the test_op_il_seq_point tests and Jenkins couldn't parse it.

To fix this, write the results into a temp file and only rename to .xml at the end when everything worked.

Additionally, fixed a small typo in cleaning the .so files.
2016-01-14 20:29:10 +01:00
João Matos f272c39cf4 [runtime] Fixed ARM cross compiler builds. 2016-01-14 18:05:46 +00:00
Vlad Brezae 73f6173eeb [jit] Delay emulation to allow optimizations to happen on these ops
Emulation used to happen at emitting time (method_to_ir). Now it is done after the copy propagation pass, where we propagate immediates and can do strength reduction on some of these ops. Because the call to the native function might imply an inlined wrapper which compiles more IL instructions, we need to run the decomposition pass again.
2016-01-14 19:34:46 +02:00
Vlad Brezae 389f0ce6b9 [jit] Support decomposition of long imm ops to simple long ops 2016-01-14 19:34:46 +02:00
Vlad Brezae 523b643660 [jit] Don't crash in mono_op_imm_to_op if opcode is not handled
Mimic the behaviour of its counterpart, mono_op_to_op_imm, since crashing limits the usage of the function and it is the responsability of the upper layer.
2016-01-14 19:34:46 +02:00
Vlad Brezae 1cfcd43184 [jit] Don't decompose into unsupported instructions
If we emulate these ops, it means we don't support the *_2 ops and we shouldn't decompose into them.
2016-01-14 19:34:46 +02:00
Vlad Brezae e820587b57 [jit] Don't hardcode the long vreg components 2016-01-14 19:34:46 +02:00
Aleksey Kliger b47b55e73b [handle] rename mono_handle_arena_(initialize|deinitialize)
to mono_handle_arena_init and mono_handle_arena_cleanup, respectively.
2016-01-14 12:18:54 -05:00
Aleksey Kliger 1694283c8f [handle] Make MONO_HANDLE_ARENA_POP a function-like macro 2016-01-14 12:18:50 -05:00
Ludovic Henry 1a45c48351 [sgen] Remove DISABLE_CRITICAL_REGION as it's never defined 2016-01-14 11:41:09 -05:00
Ludovic Henry 8ed4ec1b5b [checked-build] Add in GC critical region assertion 2016-01-14 11:40:17 -05:00
Aleksey Kliger d1c34ca48d [checked] Nest MONO_{PREPARE,FINISH}_GC_CRITICAL_REGION 2016-01-14 11:38:15 -05:00
Aleksey Kliger b580227d02 [coop] store MonoHandleArena pointer in MonoThreadInfo 2016-01-14 11:38:15 -05:00
Aleksey Kliger e2719f79b6 [handle] Add _SETREF_NULL macros for MonoObjectHandle and MonoArrayHandle 2016-01-14 11:38:14 -05:00
Ludovic Henry 1384da6248 [handle] Rename MonoHandleStorage->obj to MonoHandleStorage->__private_obj 2016-01-14 11:38:14 -05:00
Ludovic Henry 0c05fb864f [handle] Add mono_handle_obj_is_null utility function 2016-01-14 11:38:13 -05:00
Zoltan Varga 042146997e [llvmonly] Implement Assembly.GetCallingAssembly () in llvmonly mode by saving the current assembly in the calling method. Enable it for Activator.CreateInstance () for now. 2016-01-14 11:26:27 -05:00
Ludovic Henry 75ea2386a1 [Process] Use ReferenceSource process async output/error reader
By using the referencesource one, we remove a buggy part of the Process class. It will now simply use Stream.{Begin/End}Read, and not a custom implementation that introduces its own bugs.
2016-01-14 16:03:01 +00:00
Alexander Köplinger 3a9fa982ea [man/mono.1] Fix typo from 9115bf0a 2016-01-14 16:28:55 +01:00
Zoltan Varga 97d9498c0e [runtime] Make sure ptr-to-structure and structure-and-ptr wrappers are unique, this is needed by full aot. Fixes #20186. 2016-01-14 10:12:01 -05:00
Marek Safar 4cf5ddee6d [mono] Update predefined Hebrew negative sign. Fixes #37681 2016-01-14 15:12:59 +01:00
Marek Safar 600f28367f [corlib] Bump reference source for #37583 2016-01-14 14:40:00 +01:00
monojenkins 18098049bc Merge pull request #2427 from alexrp/socket-responder-dedup
[bcl] Deduplicate the SocketResponder test helper class.

A number of fixes were made to the version in System but these fixes were never applied to the System.Web.Services version. Merge the two and place the class in the test-helpers directory to avoid this sort of maintenance problem.
2016-01-14 13:10:19 +00:00
Marek Safar fb327d037e Merge pull request #2434 from knocte/bitmapattributes
[System.Drawing] Include new .NET4.5 attributes (OWIN)
2016-01-14 08:56:50 +01:00
Andrés G. Aragoneses d8b83353b9 [System.Drawing] Include new .NET4.5 attributes (OWIN)
These stubs should fix this OWIN issue brought up in StackOverflow:
http://stackoverflow.com/questions/34751771/system-drawing-bitmapsuffixinsameassemblyattribute-missing-in-mono

Docs:
* https://msdn.microsoft.com/en-us/library/system.drawing.bitmapsuffixinsameassemblyattribute%28v=vs.110%29.aspx
* https://msdn.microsoft.com/en-us/library/system.drawing.bitmapsuffixinsatelliteassemblyattribute%28v=vs.110%29.aspx

Patch contributed under the terms of the MIT/X11 licence.
2016-01-14 10:37:10 +08:00
Alex Rønne Petersen ceff52c9ae [bcl] Deduplicate the SocketResponder test helper class.
A number of fixes were made to the version in System but these fixes were never
applied to the System.Web.Services version. Merge the two and place the class
in the test-helpers directory to avoid this sort of maintenance problem.
2016-01-14 03:32:23 +01:00
Alex Rønne Petersen 9a1769db68 Merge pull request #2426 from alexrp/http-test-remove-abort
Revert "[bcl] Fix System.Net.HttpWebRequestTest.GetRequestStream hang"
2016-01-14 03:11:41 +01:00
Alex Rønne Petersen bb2209b851 Merge pull request #2424 from alexrp/task-unobserved-exceptions
[TPL] Add support for the <ThrowUnobservedTaskExceptions /> config element.
2016-01-14 03:10:00 +01:00
Alex Rønne Petersen e0f17122d5 [runtime] Make VolatileRead/VolatileWrite semantics compatible with MS.NET.
We previously followed the spec semantics for these which meant weaker memory
barriers than MS.NET. However, since we've been importing large amounts of
code from the reference sources, it makes sense to switch these methods to
the MS.NET semantics as we don't generally audit the reference source code for
compatibility with our (spec-compliant) memory model. It's safe to assume that
most MS.NET code is written with the assumption of strong memory barriers in
these methods.
2016-01-14 02:08:20 +01:00
Zoltan Varga 8051b58749 [llvm] Add a missing r4 opcodes. 2016-01-13 16:47:31 -05:00
Zoltan Varga e17a7e891f [llvmonly] Create empty stacktraces if backtraces are not supported by the platform. 2016-01-13 16:47:23 -05:00
Zoltan Varga 8281216415 [runtime] Disable a test which fails with bitcode. 2016-01-13 16:45:42 -05:00
Alexander Köplinger 63371c9b03 Merge pull request #2428 from akoeplinger/fix-ipv6-test
[System] Ignore ReceiveIPv6() UdpClient test when IPv6 is not available
2016-01-13 18:11:33 +01:00
Zoltan Varga 0f88e839ef [aot] Avoid overwriting entries in domain->seq_points if decode_exception_debug_info () is called more than once. Fixes #37582. 2016-01-13 12:10:12 -05:00
Alexander Köplinger 998fbdb7da [System] Ignore ReceiveIPv6() UdpClient test when IPv6 is not available
The test hangs on Jenkins otherwise.
2016-01-13 16:48:47 +01:00
Rolf Bjarne Kvinge c010ebc09e [System] xamarin_start_wwan is not available for tvOS and watchOS. 2016-01-13 15:13:03 +01:00
Ludovic Henry ddb269bd97 [handle] Add macro to push/pop arena 2016-01-13 13:13:28 +00:00
Ludovic Henry 25c9d081c0 [handle] Make handle.h use exclusively public headers and MONO_API functions 2016-01-13 13:11:43 +00:00
Ludovic Henry 91f5dbb6ca [handle] Remove SGen dependency 2016-01-13 13:10:21 +00:00
Ludovic Henry b5a786b021 [handle] Fix typo 2016-01-13 13:10:21 +00:00
Ludovic Henry e330e2bbc5 [handle] Implement mono_handle_(new|elevate) functions 2016-01-13 13:10:19 +00:00
Ludovic Henry b7db0b7b8f [handle] Inline handle-private.h in handle.h
MonoHandleArena functions need to be as public as MonoHandle functions, as we cannot have one without the other.
2016-01-13 13:08:16 +00:00
Marcos Henrich b21767e01c Merge pull request #2274 from esdrubal/udpclientreceive
Fixes UdpClient.Receive with IPv6 endpoint
2016-01-13 10:17:38 +00:00
Marek Safar ff008e9cea Merge pull request #2423 from radical/mcs-args
[mcs] Accept and ignore command line args supported by csc ..
2016-01-13 08:37:24 +01:00
Alex Rønne Petersen 6cf6b95367 Revert "[System] Tweak tests to work with Thread.Interrupt as well."
This reverts commit bb50c3f3c9.
2016-01-13 05:48:04 +01:00
Alex Rønne Petersen 902f758f91 Revert "[bcl] Fix System.Net.HttpWebRequestTest.GetRequestStream hang"
This reverts commit b3fa096e5e.

The Abort () call is problematic on many platforms and is no longer necessary
as we properly close the listening socket since 1103abf383.

Conflicts:

	mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/SocketResponder.cs
	mcs/class/System/Test/System.Net/SocketResponder.cs
2016-01-13 05:42:45 +01:00
Alex Rønne Petersen 111565d367 [TPL] Add support for the <ThrowUnobservedTaskExceptions /> config element.
Improves the situation wrt: https://bugzilla.xamarin.com/show_bug.cgi?id=36560
2016-01-13 04:52:36 +01:00
João Matos 1f914414b4 Merge pull request #2422 from akoeplinger/environment-is64bitoperatingsystem
[corlib] Properly implement Environment.Is64BitOperatingSystem
2016-01-13 01:55:01 +00:00
Alexander Köplinger 2fa5d255ab [corlib] Properly implement Environment.Is64BitOperatingSystem
Before we only checked if IntPtr.Size == 8, but this returns false for a 32bit Mono running on a 64bit OS.
Added an icall that gets the correct value from the runtime instead.

Note: this currently only whitelists x86_64, aarch64 and ppc64 as 64-bit platforms.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=37414
2016-01-13 02:46:37 +01:00
Vlad Brezae 95f1d9f467 Merge pull request #2261 from BrzVlad/fix-arm-fast-tls-master
[arm] Fix arm fast tls
2016-01-13 03:31:33 +02:00
Ankit Jain d6ed00cd14 [mcs] Accept and ignore command line args supported by csc ..
.. that we don't support:

	/utf8output
	/subsystemversion
	/highentropyva
	/highentropyva+
	/highentropyva-
2016-01-12 17:01:16 -05:00
Zoltan Varga 282edf8494 [llvmonly] Avoid disabling llvm for the Selector.GetHandle () intrinsics. 2016-01-12 14:39:55 -05:00
Zoltan Varga 55c3b05839 [llvmonly] Fix support for variant interface methods, they work similarly to generic virtual methods. 2016-01-12 14:23:28 -05:00
Joao Matos 18f49fd0ce Revert "Apple has introduced the System Integrety Protection in OS X 10.11. This prevents writes to /usr amongst other paths. /usr/local is still writable though."
This reverts commit b723c89628.

@migueldeicaza thinks this is the wrong approach, reverting until we figure out the right way to go about this.
2016-01-12 17:41:58 +00:00
Zoltan Varga 18282151ad [llvm] Ignore OP_IL_SEQ_POINT. 2016-01-12 12:26:34 -05:00
Stefan Sedich a30b26eeaa handle automatically mapping IPv4 addresses to IPV6 for dual mode sockets 2016-01-12 09:05:13 -08:00
Aleksey Kliger (λgeek) 33fe41835b Merge pull request #2418 from lambdageek/dev/bug-12205
[reflection] Correct ReflectedType for generic methods
2016-01-12 11:50:10 -05:00
Zoltan Varga 5da42b1a1f [aot] Add support for name mangling for more types. 2016-01-12 10:33:36 -05:00
Marcos Henrich e58fe58ef1 [System.Xml] Test sub class serialization on lists
Covers #36829
2016-01-11 18:03:43 +00:00
Aleksey Kliger 76b0f592c0 [reflection] Test MethodInfo.ReflectedType property
Test cases for [#12205](https://bugzilla.xamarin.com/show_bug.cgi?id=12205)
2016-01-11 12:18:43 -05:00
Rolf Bjarne Kvinge e7961fa20d [mscorlib] Add support for intercepting threadpool work, and use it for Xamarin.iOS/Mac.
This is used to Xamarin.iOS/Mac to wrap threadpool work in an NSAutoreleasePool.

Also open up corlib's internals to Xamarin.iOS/Mac so that the linker
doesn't have to be involved when accessing internal API.
2016-01-11 18:13:42 +01:00
Aleksey Kliger de74da81bf [reflection] remove override get ReflectedType for MonoGenericMethod and MonoGenricCMethod
Should return the type that was queried, not the type where the method
is declared.

Fixes [#12205](https://bugzilla.xamarin.com/show_bug.cgi?id=12205)
2016-01-11 12:11:35 -05:00
Zoltan Varga ddf334d030 [runtime] Bump version to 4.3.3. 2016-01-11 12:01:10 -05:00
Alexander Köplinger 6a796dc348 Merge pull request #2382 from akoeplinger/system-net-mime-referencesource
[System] Port System.Net.Mime namespace from referencesources
2016-01-11 14:13:37 +01:00
Marek Safar 2ab35ec231 [mcs] Fixes inconsistent accessibility check for partial types. Fixes #37232 2016-01-11 13:51:02 +01:00
Zoltan Varga 58d269cc81 [llvm] Allow support for emitting some methods using 'linkonce' linkage. This allows the linker to get rid of duplicate copies. Enable it for gsharedvt wrappers. 2016-01-10 07:57:32 -05:00
Alexander Köplinger a4e29fb865 Merge pull request #2415 from razzfazz/fix_timespec
fix struct timespec member name
2016-01-09 22:42:14 +01:00
Zoltan Varga 35466f798d Merge pull request #2414 from akoeplinger/fix-threadpool-test-hang
[corlib] Don't throw exception for null locale to fix threadpool-exceptions5.exe hang
2016-01-09 15:45:56 -05:00
Daniel Becker 773729f807 handle path stripping correctly for root of watched tree 2016-01-09 12:28:33 -08:00
Daniel Becker 1b1f395bd4 handle EINTR for kevent calls
A kevent() syscall may "fail" with EINTR if the process receives
a signal before the timeout expires and before an event is placed
in the kqueue; in this case, rather than erroring out, the
syscall should simply be retried.
2016-01-09 12:17:52 -08:00
Daniel Becker a261f0806c fix struct timespec member name
The second member of struct timespec is actually called tv_nsec
(nanoseconds), not tv_usec (microseconds); this was likely
confused with struct timeval, where the second member is in fact
called tv_usec.
2016-01-09 12:17:20 -08:00
Alexander Köplinger 2b60cc97c1 [corlib] Don't throw exception for null locale to fix threadpool-exceptions5.exe hang
We were seeing persistent hangs in the threadpool-exceptions5.exe test on the Jenkins ARM machines.
Tracing the execution showed the following exceptions:

```
[0x7f65e3284700:] EXCEPTION handling: System.Threading.ThreadAbortException:
[0x7f65e3284700:] EXCEPTION handling: System.Exception: From OnCBFinished
[0x7f65e3284700:] EXCEPTION handling: System.ArgumentNullException: Value cannot be null.  <-- from CultureInfo.CreateSpecificCulture()
Parameter name: name
[0x7f65e3284700:] EXCEPTION handling: System.Threading.ThreadAbortException:
exception inside UnhandledException handler:

... program hangs here ...
```

It turns out that the machines don't have the LANG/LC_ALL env vars set, resulting in a null string returned
from get_current_locale_name(). The code then tries to construct a locale from that and throws an ANE which is
normally catched and turned into the InvariantCulture.

However, in the threadpool-exceptions5 test the first time a CultureInfo is created is in the OnUnhandledException
event handler when calling ToString(). This means that an exception is thrown while we are in the unhandled exception
handler and the runtime apparently just stops there (despite the exception actually being catched, probably because of
the thread abort) so we never get to signaling the monitor object -> we hang in Main().

The fix is to not rely on catching the ArgumentNullException when we get a null locale, which is a better approach anyway.

To easily reproduce the issue before the fix, use the following (on Linux only, we don't use LANG for locale on OSX):

```
~/dev/mono/mono/tests$ LANG=C MONO_PATH=../../mcs/class/lib/net_4_x/ ../mini/mono-sgen --trace=N:nothing threadpool-exceptions5.exe
```

Note: If you pass an invalid LANG=foo, the hang is still there as we throw a CultureNotFoundException and hit the same issue.
As the behavior looks like a runtime bug to me I filed https://bugzilla.xamarin.com/show_bug.cgi?id=37547
2016-01-09 21:11:08 +01:00
Zoltan Varga 96fb7a905d [llvmonly] Avoid creating an empty output file for the JITted code. 2016-01-09 12:21:51 -05:00
Zoltan Varga c71ae13235 [llvmonly] Avoid emitting the 'globals' aot table, its not used in llvmonly mode. 2016-01-09 11:19:48 -05:00
Zoltan Varga 5c5b3b9b77 Merge pull request #2412 from akoeplinger/disable-thread-test
[corlib] Disable Thread test that started failing after d5768a7f14
2016-01-09 08:08:55 -05:00
Alexander Köplinger 5d74d555dc [corlib] Disable Thread test that started failing after d5768a7f14
Setting the priority before starting a Thread doesn't work right now as there's no handle to the native
thread at that point (the current implementation doesn't store the priority, it just tries setting it
on the native thread) so the test would remember the default 'Normal' priority instead of 'BelowNormal',
causing the test to fail later on.

Added an assert to verify that the thread priority can be set before starting and disable the test for now.

Note: variable names 'before' and 'after' were switched in the test, fixed those as well.
2016-01-09 03:50:27 +01:00
Zoltan Varga 2a17ba39bb [llvm] Error out when using --aot=llvmonly if the runtime is not compiled with --enable-gsharedvt. 2016-01-08 16:22:14 -05:00
Miguel de Icaza a7a4958fff [csharp/getline] Add support for completion popup windows
This adds supprot to the getline.cs library to provide popup windows with
completion results.   There is a new public string property surfaced,
HeuristicsMode, that if set to "csharp" will trigger the completion window
independently of the "tab" character, based on the user input.

This mode triggers completion after the "." character is entered, and will
continue to trigger it as long as you type, or you backspace and the completion
succeeds.   The heuristic also ignores scenarios like "1.2", so there is no
compeltion provided after entering numbers by default.

Perhaps we can later introduce a "OnKeyEntered" command that users could
use to provide their own heuristics to control whether to popup the window
or not.
2016-01-08 16:20:58 -05:00
Radek Doulik e6164da1dc [linker] do not use System.IO.Path on assembly resource names
- fixes #37305

  - resource name can be general string and using it as path
    might throw

       System.ArgumentException: Illegal characters in path.

  - it would be possible to check for the path's invalid characters in
    the resource name. that would cause crossplatform issues
    though.

    various platforms have different invalid charactes sets for path
    names. for example using assembly built on mac with embedded
    linker blacklisting xml file, which's name contains characters in
    its filename which are invalid on windows. so the windows built
    app using that assembly would fail mysteriously, because the
    important parts wouldn't be preserved.

    thus we use just string comparison
2016-01-08 22:10:30 +01:00
Alexander Köplinger 7d40215052 [io-layer] Revert 31f13881a4 and fix it in a simpler way
We don't need the configure.ac check as we can just directly check if the macro is defined.
2016-01-08 21:58:40 +01:00
Zoltan Varga d3b2816c57 [runtime] Bump AOT file format version. 2016-01-08 15:45:33 -05:00
Alexander Köplinger 31f13881a4 [io-layer] Fix build on OSX
This got broken by d5768a7f14, SCHED_BATCH isn't available on OSX or Linux before 2.6.16
2016-01-08 21:39:02 +01:00
Zoltan Varga e4eed3f0aa [llvmonly] Enable more tests. 2016-01-08 15:18:59 -05:00
Zoltan Varga ee51321d2f [llvmonly] Fix gsharedvt calls from gsharedvt methods. 2016-01-08 15:18:59 -05:00
Alexander Köplinger 71b4ebc9c0 Merge pull request #2384 from akoeplinger/system-net-sockets-referencesource
[System] Initial port of System.Net.Sockets types from referencesource
2016-01-08 21:06:31 +01:00
Alexander Köplinger 0950f55eaf [System.Web] Add test for 9c25439320
Test case from https://bugzilla.xamarin.com/show_bug.cgi?id=13909
2016-01-08 20:54:54 +01:00
James Venning 9c25439320 Fix RouteCollection not correctly clearing itself 2016-01-08 20:47:59 +01:00
Neale d5768a7f14 Implement a SetPriority/GetPriority facility for real-time threads: if
mono is executed using the SCHED_RR policy, we will map POSIX priorities
to .NET priorities. Under this policy a thread running under this policy
which uses the SetPriority API will have its priority remapped and a
call to pthread_setschedparam() made to change its priority.

The following code fragment may be used to run a mono application
without requiring all root privileges other than the CAP_SYS_NICE
capability which enables priority manipulation:

void
runMonoRT(const char *const name, const int policy, char **argv)
{
    const pid_t         me = getpid();
    struct sched_param  param;

    param.sched_priority = sched_get_priority_min(policy);
    if (sched_setscheduler(me, policy, &param) == -1)
        fprintf(stderr, "sched_setscheduler(getpid(), %s, { %d }): %s.\n",
			name, param.sched_priority, strerror(errno));
    else
        execvp("mono", argv);
}

int
main(int argc, char **argv)
{
    uid_t       user;
    cap_value_t root_caps[2] = { CAP_SYS_NICE, CAP_SETUID };
    cap_value_t user_caps[1] = { CAP_SYS_NICE };
    cap_t       capabilities;

    /* Get real user ID. */
    user = getuid();

    /* Get full root privileges. Normally being effectively root
     * (see man 7 credentials, User and Group Identifiers, for explanation
     *  for effective versus real identity) is enough, but some security
     * modules restrict actions by processes that are only effectively root.
     * To make sure we don't hit those problems, we switch to root fully. */
    if (setresuid(0, 0, 0)) {
        fprintf(stderr, "Cannot switch to root: %s.\n", strerror(errno));
        return 1;
    }

    /* Create an empty set of capabilities. */
    capabilities = cap_init();

    /* Capabilities have three subsets:
     *      INHERITABLE:    Capabilities permitted after an execv()
     *      EFFECTIVE:      Currently effective capabilities
     *      PERMITTED:      Limiting set for the two above.
     * See man 7 capabilities for details, Thread Capability Sets.
     *
     * We need the following capabilities:
     *      CAP_SYS_NICE    For nice(2), setpriority(2),
     *                      sched_setscheduler(2), sched_setparam(2),
     *                      sched_setaffinity(2), etc.
     *      CAP_SETUID      For setuid(), setresuid()
     * in the last two subsets. We do not need to retain any capabilities
     * over an exec().
    */
    if (cap_set_flag(capabilities, CAP_PERMITTED, sizeof root_caps / sizeof root_caps[0], root_caps, CAP_SET) ||
        cap_set_flag(capabilities, CAP_EFFECTIVE, sizeof root_caps / sizeof root_caps[0], root_caps, CAP_SET)) {
        fprintf(stderr, "Cannot manipulate capability data structure as root: %s.\n", strerror(errno));
        return 1;
    }

    /* Above, we just manipulated the data structure describing the flags,
     * not the capabilities themselves. So, set those capabilities now. */
    if (cap_set_proc(capabilities)) {
        fprintf(stderr, "Cannot set capabilities as root: %s.\n", strerror(errno));
        return 1;
    }

    /* We wish to retain the capabilities across the identity change,
     * so we need to tell the kernel. */
    if (prctl(PR_SET_KEEPCAPS, 1L)) {
        fprintf(stderr, "Cannot keep capabilities after dropping privileges: %s.\n", strerror(errno));
        return 1;
    }

    /* Drop extra privileges (aside from capabilities) by switching
     * to the original real user. */
    if (setresuid(user, user, user)) {
        fprintf(stderr, "Cannot drop root privileges: %s.\n", strerror(errno));
        return 1;
    }

    /* We can still switch to a different user due to having the CAP_SETUID
     * capability. Let's clear the capability set, except for the CAP_SYS_NICE
     * in the permitted and effective sets. */
    if (cap_clear(capabilities)) {
        fprintf(stderr, "Cannot clear capability data structure: %s.\n", strerror(errno));
        return 1;
    }
    if (cap_set_flag(capabilities, CAP_PERMITTED, sizeof user_caps / sizeof user_caps[0], user_caps, CAP_SET) ||
        cap_set_flag(capabilities, CAP_EFFECTIVE, sizeof user_caps / sizeof user_caps[0], user_caps, CAP_SET)) {
        fprintf(stderr, "Cannot manipulate capability data structure as user: %s.\n", strerror(errno));
        return 1;
    }

    /* Apply modified capabilities. */
    if (cap_set_proc(capabilities)) {
        fprintf(stderr, "Cannot set capabilities as user: %s.\n", strerror(errno));
        return 1;
    }

    /*
     * Now we have just the normal user privileges,
     * plus user_caps.
    */
    runMonoRT("SCHED_RR", SCHED_RR, argv);

    return 0;
}
2016-01-08 20:42:52 +01:00
João Matos 1625a45791 Merge pull request #2411 from rolfbjarne/parse-debug-optionsapi-doc
Document mini_parse_debug_option
2016-01-08 18:00:49 +00:00
Rolf Bjarne Kvinge 2457338cf8 [mini] Document mini_parse_debug_option. 2016-01-08 18:36:14 +01:00
Rolf Bjarne Kvinge da51b1c427 [mini] Rename mini_parse_debug_option's argument to match the header file (and match better the usage). 2016-01-08 18:36:14 +01:00
Rolf Bjarne Kvinge c9faf02f6e [man/mono.1] Fix typo. 2016-01-08 18:36:03 +01:00
Alexander Köplinger a0cd461e27 [System] Initial port of System.Net.Sockets types from referencesource
These are the more trivial ones.

Needed a mono_corlib_version bump because some Socket field names changed to the MS version.
2016-01-08 18:01:10 +01:00
João Matos c23b96a99e Merge pull request #2363 from eriklarko/master
SpecialFolder.CommonApplicationData support for El Capitan
2016-01-08 15:26:25 +00:00
João Matos 4b4b612986 Merge pull request #2410 from steffen-kiess/fix-monop
[monop] Fix NullReferenceException in monop
2016-01-08 15:15:30 +00:00
Steffen Kieß ef2c349dfc [monop] Fix NullReferenceException in monop
Fix a NullReferenceException in monop when printing a type name in a
namespace somewhere below System while working on a class which does not
have a namespace.
2016-01-08 16:04:03 +01:00
Zoltan Varga 182f5e71ec [llvmonly] Extract the runtime invoke code into a separate function. 2016-01-08 10:02:37 -05:00
João Matos 177d973ef7 Merge pull request #2390 from schani/feature-bisector
Automatic optimization bug bisector.
2016-01-08 14:03:32 +00:00
João Matos 61150275c6 Merge pull request #2409 from rolfbjarne/parse-debug-options-api
[runtime] Add API to set debug options without going through MONO_DEBUG.
2016-01-08 13:39:22 +00:00
Zoltan Varga 063fb64def [aot] Print the number of different kinds of methods when printing stats. 2016-01-08 07:34:47 -05:00
Rolf Bjarne Kvinge 8a552061a3 [runtime] Add API to set debug options without going through MONO_DEBUG.
This is useful for embedders.
2016-01-08 13:34:09 +01:00
Zoltan Varga 954c58b87f [llvmonly] Add support for nullable return types in runtime invoke code, so it can be used for all methods. Avoid emitting most runtime invoke wrappers in llvm-only mode, they are not needed any more. 2016-01-08 07:12:52 -05:00
Zoltan Varga 1716506d14 [llvmonly] Enable some tests which now work. 2016-01-08 06:13:33 -05:00
Zoltan Varga 34629ae5e2 [llvmonly] Fix support for gsharedvt delegate invoke wrappers, they need to dynamically check whenever the called method uses a gsharedvt calling conv. 2016-01-08 06:13:33 -05:00
Zoltan Varga ce13c3d515 [amd64] Only use the gsharedvt calling conv for variable sized gsharedvt arguments. 2016-01-08 06:13:33 -05:00
Zoltan Varga dac6059932 [runtime] Set the wrapper info correctly for generic delegate-invoke wrappers. 2016-01-08 06:13:33 -05:00
João Matos 533d9a2b6c Merge pull request #2406 from vkargov/master
Fix the format statements in mono-gdb.
2016-01-08 00:43:11 +00:00
James Venning 9f488a8c7e Update assertions related to the number of interfaces supported by the runtime 2016-01-08 09:40:46 +10:00
Vladimir Kargov 8cbd16e9c7 Fix the format statements in mono-gdb. 2016-01-07 15:37:14 -08:00
Zoltan Varga 6a5f1f9e17 [ppdb] Fail fast when trying to load an .mdb file from memory. 2016-01-07 15:59:50 -05:00
Zoltan Varga 3a2b5353af [llvmonly] Share more signatures. 2016-01-07 15:29:03 -05:00
Ludovic Henry f048e17f41 [handle] Make arena chunk fixed size 2016-01-07 18:35:07 +00:00
Zoltan Varga 36bc196bde [llvmonly] Change the way delegate invokes are implemented, use a new CEE_MONO_CALLI_EXTRA_ARG il instruction so most of the logic is in the JIT, not in marshal.c. 2016-01-07 13:08:26 -05:00
Zoltan Varga 074c8a9deb [llvmonly] Remove the old llvmonly runtime support code, its not needed anymore. 2016-01-07 12:39:59 -05:00
Jonathan Pryor 66e33aa2ee Merge pull request #2333 from joelmartinez/docs-classic-fix
[mdoc] Added -api-style parameter.
2016-01-07 11:06:54 -05:00
Rolf Bjarne Kvinge ac69bf1f9b Bump referencesource to get changes for multiple appdomain removal. 2016-01-07 13:45:22 +01:00
Rolf Bjarne Kvinge 85da43008a [corlib] Remove multiple appdomain support (AppDomain.CreateDomain, etc) from tvOS/watchOS. 2016-01-07 13:04:27 +01:00
Zoltan Varga 72f22200ae [llvm] Fix support for aot data files. 2016-01-07 06:58:41 -05:00
Zoltan Varga e60af82853 [llvmonly] Remove some duplicate code. 2016-01-07 06:43:11 -05:00
Zoltan Varga 636639cffa [llvmonly] Share more signatures in the gsharedvt in/out wrappers. 2016-01-06 11:56:09 -05:00
Zoltan Varga f2c520ac2f [llvmonly] Fix a case where a non-virtual method was called using callvirt. 2016-01-06 11:55:31 -05:00
Joel Martinez 1dc0dba379 [mdoc] Added -api-style parameter.
You must now add the -api-style parameter when running mdoc update for a set of classic or unified assemblies.
This was added in order to properly support types and members that exist only in one or the other set.
Previously, there was an assumption that all types and members would be reflected in both classic and
unified versions of an assembly.
2016-01-06 09:47:24 -05:00
Rolf Bjarne Kvinge 45a86f2116 [aot] Fix emission of external aot data by aligning tables in the file.
The table reading code depends on data being aligned, so make sure it is.
2016-01-06 08:46:32 -05:00
Zoltan Varga d16e7ed0fc [runtime] Fix the DISABLE_JIT build. 2016-01-06 07:57:59 -05:00
Zoltan Varga 1a5bc40a03 [llvmonly] Add support for runtime invokes with nullable arguments. 2016-01-06 07:51:22 -05:00
Alex Rønne Petersen 2dc628d36f Merge pull request #2174 from stukselbax/master
[WCF] WebHttpBinding must use http scheme in case when SecurityMode == WebHttpSecurityMode.TransportCredentialOnly
2016-01-06 11:32:28 +01:00
Zoltan Varga e98f02b71b [llvmonly] Implement runtime invokes to gsharedvt methods. 2016-01-06 04:56:06 -05:00
Zoltan Varga a0d5b21a45 [jit] Fix the handling of virtual generic methods on interfaces in the delegate virtual invoke optimization. Fixes #37436. 2016-01-06 03:59:06 -05:00
James Venning 6e7f1d94eb Increase the number of interfaces supported by the runtime 2016-01-06 11:59:23 +10:00
Martin Baulig 1b616ca127 Revert "[corlib] Fixed the mobile build in System.Security.Cryptography.X509Certificates."
This reverts commit 0ed6c0f5bf.
2016-01-05 15:38:29 -05:00
Zoltan Varga bac8b504e0 [amd64] Enable LLVM for more parameter passing conventions. 2016-01-05 14:55:51 -05:00
Alexander Kyte 37b489765f [runtime] Read fields out of TransparentProxies correctly in debugger agent 2016-01-05 13:56:46 -05:00
Martin Baulig e442c34af4 [bcl]: Fix 'mobile_static' build. 2016-01-05 13:36:02 -05:00
Alexander Kyte 23ce21ede0 [runtime] Use explicit loop checking to remove depth limitation of sequence point search. 2016-01-05 13:07:29 -05:00
Zoltan Varga f04a83ca39 [llvm] Fix the linking of the bblocks containing endfinally instructions with the targets of leave instructions, previously we would link the first bblock instead of the last one. Fixes #37412. 2016-01-05 12:33:17 -05:00
Martin Baulig ae23fba121 Merge pull request #2401 from alexanderkyte/mobile_static_fixes
Minor mobile-static profile fixes
2016-01-05 12:13:24 -05:00
Aleksey Kliger (λgeek) f7fd77fa10 Merge pull request #2385 from lambdageek/dev/checked-imageset-subset
[checked] ImageSet may reference corlib implicitly in another ImageSet.
2016-01-05 11:45:22 -05:00
Alexander Kyte d6d786c07a [bcl] Fix Win32 network api exclusion on non-monodroid mobile 2016-01-05 11:38:06 -05:00
Alexander Kyte 93a4f8c833 [bcl] Take mobile_static profile into account in preprocessor directive 2016-01-05 11:36:32 -05:00
Joao Matos 048ed1a6b2 [Mono.Security] Fixed bootstrap build. 2016-01-05 16:19:35 +00:00
Martin Baulig a1e8c5265d [System]: Cleanup the internal 'MonoTlsProviderFactory'. 2016-01-05 16:19:35 +00:00
Martin Baulig 7b59ed35eb [System]: Include Mono.Security sources in XamMac profile to make it consistent with the other mobile profiles. 2016-01-05 16:19:35 +00:00
Martin Baulig ebbf7640cc [Mono.Security]: Add MonoTlsProviderFactory.GetMonoSslStream(SslStream). 2016-01-05 16:19:35 +00:00
Martin Baulig 8422335e52 [Mono.Security]: Add 'IMonoSslStream.Provider' and 'GetConnectionInfo()'. 2016-01-05 16:19:35 +00:00
Martin Baulig 1683084102 Fix some compiler warnings in Mono.Security and System. 2016-01-05 16:19:35 +00:00
Martin Baulig 9fa16c3adc [System]: Only use the 'MONO_SECURITY_ALIAS' conditional to determine whether or not to use 'extern alias MonoSecurity'. 2016-01-05 16:19:35 +00:00
Alexander Köplinger 9be02d456c Merge pull request #2396 from akoeplinger/flaky-osx-socket-test
[System] Fix flaky AcceptBlockingStatus test that sometimes failed on OSX
2016-01-05 16:35:07 +01:00
Zoltan Varga 527c92867b Revert "[amd64] Remove some restrictions on passing/returning vtypes in registers."
This reverts commit 25105bd605.

Revert this as it breaks tests.
2016-01-05 10:30:59 -05:00
Zoltan Varga fd8972132d [runtime] Fix the loaded llvm build. 2016-01-05 09:06:19 -05:00
Marcos Henrich f43a2563d7 [System] Removed dead code. 2016-01-05 11:56:26 +00:00
ArsenShnurkov 9c088b38e2 [System] Fix extra xml header in configs.
Fixes #36388.
2016-01-05 11:56:26 +00:00
Marcos Henrich 4d56564adc [System] Test configuration extra xml headers bug
Covers #36388
2016-01-05 11:56:25 +00:00
Marcos Henrich c1a732c452 [System.Configuration] Fix exception on bad xml.
When XmlException is thrown while loading the configuration file,
the XmlException should be encapsulated into a ConfigurationErrorsException.
2016-01-05 11:56:25 +00:00
Marcos Henrich 4980c52fff [System.Configuration] Test bad xml loading.
When ConfigurationManager.OpenMappedMachineConfiguration loads broken
xml ConfigurationErrorsException should be trown instead of
XmlException.
2016-01-05 11:56:24 +00:00
Zoltan Varga 5a9c73e7a9 [runtime] Allocate a parameter array in mono_jit_runtime_invoke () using g_alloca. 2016-01-05 05:32:53 -05:00
Zoltan Varga 25105bd605 [amd64] Remove some restrictions on passing/returning vtypes in registers. 2016-01-05 05:30:45 -05:00
Zoltan Varga 65e10b1622 [jit] Disable the support for -O=shared, use it only for icall wrappers. 2016-01-04 15:58:47 -05:00
Matthias Mailänder bec6f78249 reference libgdiplus with the proper .so name 2016-01-04 21:58:11 +01:00
Zoltan Varga 74c3fafd17 [llvmonly] Introduce a MonoFtnDesc structure to represent an address+argument pair, use this to explicitly mark functions returning function descriptors. 2016-01-04 14:38:37 -05:00
Zoltan Varga 364d06d722 [llvmonly] Remove some jit icalls which are no longer used. 2016-01-04 14:08:06 -05:00
Zoltan Varga a725737e3d [llvmonly] Add an optimized implementation for generic virtual calls on interfaces. 2016-01-04 14:01:44 -05:00
Vlad Brezae f607f01a76 [sgen] Avoid having all los objects pagesize aligned
Since we allocate los objects in page_size chunks, we randomly slide the objects within this space to have them start at different offsets. This improves caching behavior, especially when traversing multiple los objects at the same time.
2016-01-04 20:59:58 +02:00
Vlad Brezae 93b422cd89 [sgen] Use separate object ops with the concurrent collector when there is no evacuation
When we concurrently drain the gray stack, we check to see if there are any blocks that need evacuation. If there aren't, we can drain the gray stack using functions that don't check evacuation related block information. As we do with the serial collector.
2016-01-04 20:49:50 +02:00
Zoltan Varga 0a1bb664e0 [llvmonly] Clean up the optimized virtual call code a bit. 2016-01-04 13:09:11 -05:00
Marek Safar f105ad2620 [System] Fixes Process::WaitForExit to honour EnableRaisingEvents setting 2016-01-04 18:45:31 +01:00
Vincent Povirk d34b34c449 [sgen] Clean up thread pool on shutdown.
Keeping threads around can cause processes to keep running when they
shouldn't, particularly on Windows when the entry point returns.

This commit licensed as MIT/X11.
2016-01-04 11:01:29 -06:00
Zoltan Varga d580f33ae2 [llvmonly] Add an optimized implementation for generic virtual calls. 2016-01-04 11:40:10 -05:00
Alexander Köplinger d3f0e74076 [System] Fix flaky AcceptBlockingStatus test that sometimes failed on OSX
We were sometimes seeing the following failure on Jenkins on OSX:

```
Test Case Failures:
1) MonoTests.System.Net.Sockets.SocketTest.AcceptBlockingStatus : System.Net.Sockets.SocketException : Operation on non-blocking socket would block
at System.Net.Sockets.Socket.Accept () [0x00033] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System/System.Net.Sockets/Socket.cs:896
at MonoTests.System.Net.Sockets.SocketTest.BlockingConnect (Boolean block) [0x0003e] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs:129
at MonoTests.System.Net.Sockets.SocketTest.AcceptBlockingStatus () [0x0001e] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs:147
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```

In non-blocking mode accept() is specified to return this error when no client connection is available right now.
It looks like on OSX we don't immediately get that connection.

To fix this issue, we try to accept in a loop for 100ms and only fail when we don't get a connection in this time.
2016-01-04 17:32:06 +01:00
Marcos Henrich fdb5cadefb [ServiceModel] Fixes missing xsi xsd attributes
While serializing operations with XmlSerializerFormatAttribute,
attributes xmlns:xsi and xmlns:xsd were not added to the message body.

XmlBodyWriter now adds the missing attributes.

Fixes #34413.
2016-01-04 15:42:26 +00:00
Marcos Henrich 22dff27fb9 [System.ServiceModel] Test XmlAttributes
Tests that ClientBase is handling XML attributes correctly.

Covers #34413.
2016-01-04 15:42:25 +00:00
Zoltan Varga d901015f4e [aot] Add another special case for wrappers+gshared methods. 2016-01-04 10:25:26 -05:00
Alexander Köplinger a203534b42 Merge pull request #2393 from akoeplinger/servicemodel-collection-modified
[System.ServiceModel] Fix "collection was modified" exception in tests
2016-01-04 16:11:04 +01:00
Marek Safar d87420027c Bumpr reference source for mobile profile fixes 2016-01-04 15:01:26 +01:00
Marek Safar a9b812ac1a [mcs] Fixes typo 2016-01-04 15:01:23 +01:00
Marek Safar da556a3571 Merge pull request #2395 from akoeplinger/rijndael
[corlib] Remove RijndaelManaged test that makes no sense with referencesource impl
2016-01-04 09:31:05 +01:00
Alexander Köplinger 528d985f29 [corlib] Remove RijndaelManaged test that makes no sense with referencesource impl
The CreateEncryptor_KeyNull and CreateDecryptor_KeyNull tests tried to verify the previous Mono
behavior of throwing a CryptographicException when a null key is passed to the methods [1].

However, with the move to referencesource this no longer happens since when a null key is passed
a random one is generated instead [2].

The existing tests passed out of pure luck because a different CryptographicException is thrown later on:

```
System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
  at System.Security.Cryptography.RijndaelManagedTransform.DecryptData (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, System.Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) [0x007b5] in /Users/alexander/dev/mono/external/referencesource/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs:751
  at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) [0x000bb] in /Users/alexander/dev/mono/external/referencesource/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs:336
  at MonoTests.System.Security.Cryptography.RijndaelManagedTest.CreateDecryptor_KeyNull () [0x00066] in /Users/alexander/dev/mono/mcs/class/corlib/Test/System.Security.Cryptography/RijndaelManagedTest.cs:233
```

Unfortunately, sometimes it happens with the random key that this exception *doesn't* get thrown as the padding is valid, which makes the test randomly fail on Jenkins.
Deleting those tests is the simplest fix.

[1] https://github.com/mono/mono/blob/mono-4.0.0-branch/mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs#L107
[2] https://github.com/mono/referencesource/blob/33edf60ec4d35aba11850872777c8b3a484ca484/mscorlib/system/security/cryptography/rijndaelmanaged.cs#L66
2016-01-04 04:05:08 +01:00
Alexander Köplinger d33a7df441 [System.ServiceModel] Fix "collection was modified" exception in tests
We sometimes see the following exception in the ServiceModel tests:

```
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.ThrowHelper.ThrowInvalidOperationException (ExceptionResource resource) [0x00000] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/throwhelper.cs:99
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00016] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/collections/generic/list.cs:1180
  at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x00050] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/collections/generic/list.cs:1174
  at System.Linq.Enumerable.FirstOrDefault[TSource] (IEnumerable`1 source, System.Func`2 predicate) [0x00041] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/System.Core/System/Linq/Enumerable.cs:960
  at System.ServiceModel.Channels.Http.HttpListenerManager.TryDequeueRequest (System.ServiceModel.Dispatcher.ChannelDispatcher channel, TimeSpan timeout, System.ServiceModel.Channels.Http.HttpContextInfo& context) [0x00016] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System.ServiceModel/System.ServiceModel.Channels.Http/HttpListenerManager.cs:93
  at System.ServiceModel.Channels.Http.HttpListenerManager.TryDequeueRequest (System.ServiceModel.Dispatcher.ChannelDispatcher channel, TimeSpan timeout, System.ServiceModel.Channels.Http.HttpContextInfo& context) [0x000ab] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System.ServiceModel/System.ServiceModel.Channels.Http/HttpListenerManager.cs:104
  at System.ServiceModel.Channels.Http.HttpReplyChannel.TryReceiveRequest (TimeSpan timeout, System.ServiceModel.Channels.RequestContext& context) [0x00003] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System.ServiceModel/System.ServiceModel.Channels.Http/HttpReplyChannel.cs:154
  at System.ServiceModel.Channels.ReplyChannelBase+<BeginTryReceiveRequest>c__AnonStorey0.<>m__0 (TimeSpan tout, System.ServiceModel.Channels.RequestContext& ctx) [0x00056] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System.ServiceModel/System.ServiceModel.Channels/ReplyChannelBase.cs:129
```

I managed to repro this consistently on the debian-7-x64-1 Jenkins machine by running the test in a loop with the following code for about 15mins:
    while [ $? -eq 0 ]; do make check FIXTURE=System.ServiceModel.Dispatcher; done

The problem happens when RegisterListenerCommon/UnregisterListenerCommon is invoked through HttpChannelListener.OnOpen/OnAbort/OnClose which modifies the 'Entries' collection on another thread.

The fix is to add locking around the collection accesses.
2016-01-03 17:12:19 +01:00
Joao Matos da63cf5b2d [mini] Fixed non-JIT runtime support in generic sharing. 2016-01-03 15:03:32 +00:00
Joao Matos 0ed6c0f5bf [corlib] Fixed the mobile build in System.Security.Cryptography.X509Certificates. 2016-01-03 15:03:32 +00:00
Zoltan Varga 3451418af0 Add an optimized implementation for interface calls.
This works by using the imt entries in the vtable to store 'imt thunks', which in llvm-only mode, are C functions
which receive an info structure and the imt method and return the real method which needs to be called. Thus
interface calls are compiled into two calls: one to the imt thunk, and one to the method address returned by
the thunk.
2016-01-03 05:45:22 -05:00
Zoltan Varga 04d1f41629 [runtime] Pass the vtable to the vtable/imt trampoline creation functions so they can return a vtable specific value. Not yet used. 2016-01-03 05:45:22 -05:00
David Karlaš 8b8111af7e Merge pull request #2380 from alexanderkyte/pdb_fix_local_vars
[runtime] Fixed off-by-one bug in local variable counting for ppdb files.
2016-01-03 07:18:04 +01:00
Zoltan Varga 59c352646c [llvmonly] Optimize virtual calls by storing a function descriptor in vtable slots, and using an icall to initialize it if needed. 2016-01-03 00:49:38 -05:00
Zoltan Varga 92efab91ab [runtime] Avoid a crash if a generic type definition is passed to RuntimeHelpers.RunClassConstructor (). Fixes #37313. 2016-01-01 23:28:23 -05:00
Zoltan Varga 6aa7d30d96 [sgen] Avoid asserting if the tls offsets used by the managed allocators cannot be determined. This can happen when using shared libraries on linux. Fixes #30594. 2016-01-01 23:03:48 -05:00
Zoltan Varga 81e1e072c8 [llvm] Disable support for nested clauses, it still doesn't work. Fixes #37273. 2016-01-01 22:04:53 -05:00
Zoltan Varga 84a5f71d4d [llvm] Add missing OP_LMUL_IMM opcode. 2016-01-01 20:50:51 -05:00
Zoltan Varga daac6e51c0 [llvm] Add support for passing dummy arguments before arm64 hfa structures so they get passed completely on the stack, there was a mismatch between the cconv used by the JIT and LLVM, leading to problems if the caller was llvm and the callee was not, and vice versa. Part of the fix for #37236. 2016-01-01 20:13:19 -05:00
Alexander Köplinger 35c5089c2c Merge pull request #2392 from akoeplinger/web-wizard-sharing-violation
[System.Web] Fix WizardStepBase_Theme sharing violation error during test
2016-01-01 17:25:47 +01:00
Alexander Köplinger 12db763951 [System.Web] Fix WizardStepBase_Theme sharing violation error during test
We were sometimes seeing the following test failure on Jenkins:

```
Test Case Failures:
1) MonoTests.System.Web.UI.WebControls.WizardStepBaseTest.WizardStepBase_Theme : System.IO.IOException : Sharing violation on path /var/folders/wm/jvn0yl0d39q9sm9glcrhdrmw0000gn/T/tmp672264ba.tmp/App_Themes/Theme1/WizardTest.skin
at System.IO.File.SetLastWriteTime (System.String path, DateTime lastWriteTime) [0x00029] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/corlib/System.IO/File.cs:474
at MonoTests.SystemWeb.Framework.WebTest.CopyBinary (System.Byte[] sourceArray, System.String targetUrl) [0x00098] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/WebTest.cs:364
at MonoTests.SystemWeb.Framework.WebTest.CopyResource (System.Type type, System.String resourceName, System.String targetUrl) [0x00059] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/WebTest.cs:307
at MonoTests.System.Web.UI.WebControls.WizardStepBaseTest.WizardStepBase_Theme () [0x00000] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepBaseTest.cs:311
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```

This happens because System.Web.UI.WebControls/ThemeTest.cs copies the WizardTest.skin file to the same App_Themes/Theme1 path in its setup method.
Since we're not interested in any particular theme in WizardStepBase_Theme we fix this by just using a different theme name (WizardStepBase instead of Theme1) so the two test fixtures don't clash.
2016-01-01 15:05:15 +01:00
Alexander Köplinger 306b8c16ca Merge pull request #2391 from Utsav2/Utsav2-patch-1
Fix typo in AL man page
2016-01-01 12:22:39 +01:00
Utsav Shah f1e8be234f Fix typo 2015-12-31 22:56:00 -05:00
Mark Probst 121f253944 Automatic optimization bug bisector. 2015-12-31 10:23:08 -08:00
Miguel de Icaza 9115bf0abd [man/mono.1] Add details on --aot=data-outfile option 2015-12-30 23:13:02 -05:00
Vlad Brezae 4791a674a1 Merge pull request #2386 from BrzVlad/fix-jit
[jit] Some jit fixes
2015-12-30 00:23:31 +02:00
Aleksey Kliger 5b6ed15ebd [checked] Imageset may reference corlib implicitly in another imageset. 2015-12-28 11:49:14 -05:00
Vlad Brezae 571c1a149f [arm] Fix codegen for multiply instructions
The code worked because we never used mul with CPSR update and the code for ARMOP_MUL happens to be 0.
2015-12-27 11:51:29 +02:00
Vlad Brezae 2cc8a2f266 [jit] Fix specs for some conv instructions 2015-12-27 11:49:13 +02:00
Vlad Brezae 8e71adca75 [jit] Fix signed division by power of 2 optimization.
Add more division tests.
2015-12-27 11:46:45 +02:00
Alexander Köplinger 3bfea0a776 [System] Port System.Net.Mime namespace from referencesources
A few helper methods that existed in ContentType were moved into MailMessage.
I verified the test changes are required to match MS.NET behavior.
2015-12-24 13:27:12 +01:00
Marek Safar 53fb233e90 Merge pull request #2383 from akoeplinger/authenticated-stream-referencesource
[System] Port AuthenticatedStream from referencesources
2015-12-24 09:04:38 +01:00
Zoltan Varga 1d806f2b9b [runtime] Move the HAVE_MOVING_COLLECTOR define to config.h instead of the command line. 2015-12-24 00:40:46 -05:00
Zoltan Varga 2324a7ad93 [runtime] Make libmono point to libmonosgen instead of libmonoboehm. 2015-12-23 23:45:28 -05:00
Zoltan Varga 59ca29cd71 [runtime] Make the code in mini-llvm.c more C++ compatible. 2015-12-23 21:16:15 -05:00
Alexander Köplinger 6fdc0a8cef [System] Port AuthenticatedStream from referencesources 2015-12-24 02:01:51 +01:00
Zoltan Varga 71c35afcf1 Merge pull request #2381 from alexanderkyte/pdb_method_assert
[runtime] Make the pdb lookup function return NULL for runtime-generated methods rather than asserting.
2015-12-23 19:22:11 -05:00
Alexander Kyte 940c306e73 [runtime] Fixed off-by-one bug in local variable counting for ppdb files. 2015-12-23 19:19:06 -05:00
Alexander Kyte fba307e79d [runtime] Make the pdb lookup function return NULL for runtime-generated methods rather than asserting. 2015-12-23 19:15:38 -05:00
monojenkins 88dbb8625b Merge pull request #2379 from xmcclure/babysitter-contd
scripts/babysitter stdout logging improvements

Always print stdout log statements, even when all babysitter features
are turned off, even when the test suite does not support the protocol.
2015-12-23 19:25:16 +00:00
Andi McClure 8f800a33c8 scripts/babysitter stdout logging improvements
Always print stdout log statements, even when all babysitter features
are turned off, even when the test suite does not support the protocol.
2015-12-23 12:49:53 -05:00
Rolf Bjarne Kvinge 4365a2a8a2 [mkbundle] Add support for --quiet. 2015-12-23 12:03:03 +01:00
Rolf Bjarne Kvinge f7f66cb6d0 [mkbundle] Fix compiler warnings. 2015-12-23 12:01:40 +01:00
Zoltan Varga 6295dc7dbd [llvm] Fix LLVM support after e7166e4f9c. 2015-12-23 01:09:19 -05:00
Miguel de Icaza 9b17811bb7 ucm2cp: Remove the deprecated '#if NET_2_0' fence 2015-12-22 23:28:32 -05:00
Alexander Köplinger 6c728b6cc0 [System.Xml.Linq] Reenable a test that was commented out
It works fine now, the underlying mcs bug was fixed long ago.
2015-12-23 02:04:06 +01:00
Alexander Köplinger 266345ec8f Merge pull request #2366 from xmcclure/scripts-babysitter
Adds babysitter script for PR tests
2015-12-23 00:17:42 +01:00
Andi McClure 718a63ebb5 Support process-group killing in babysitter script
The babysitter script was failing to act as a GNU timeout replacement
because it was delivering signals to the spawned process only, whereas
GNU timeout would create a process group. This lead to a problem where
timeout kills by the babysitter would leave children of the spawned
process still running. To fix this, the babysitter script now follows
the exact steps that GNU timeout does (or as close as is possible in
Python). An attempt at a Windows process-group implementation is also
included, but I have not tested it.

Also changed the 'retry_support' key to 'babysitter_protocol' in the
JSON logs, because it was pointed out the old key was misleading (it
is true even when retries are deactivated).
2015-12-22 17:38:16 -05:00
Andi McClure 18da391e21 Have scripts/babysitter use MONO_BABYSITTER_LOG_FILE configuration
Instead of configuring logs with WORKSPACE dir
2015-12-22 15:04:57 -05:00
Andi McClure 0a63e216ff More peer review changes on scripts/babysitter
- Using “iteration” for # of retries instead of ambiguous “passes”
- More clearly document what environment keys are for in-script
- Remove CRASH_RESUME key, make setting always true
- Print explicit human-readable messages for stdout log
2015-12-22 14:47:28 -05:00
Alexander Köplinger 44a04d5bd6 Merge pull request #2375 from akoeplinger/servicemodel-remove-portfinders
[ServiceModel] Remove custom free port finder code
2015-12-22 18:42:35 +01:00
Rolf Bjarne Kvinge b9cc37c7d6 Merge pull request #2376 from rolfbjarne/bitcode-without-undefined-references
Do not allow undefined references if bitcode is enabled.
2015-12-22 17:38:09 +01:00
Rodrigo Kumpera e137ff6f7e Merge pull request #2034 from alexrp/ctx-cleanup
[runtime] Actually clean up context-static data segments.
2015-12-22 11:05:30 -05:00
Miguel de Icaza ccdf8c3274 Merge pull request #1896 from meum/patch-1
Fix dot stuffing in SmtpClient
2015-12-22 10:20:19 -05:00
Aleksey Kliger (λgeek) 5c7b6ea220 Merge pull request #2374 from lambdageek/dev/bug-37035
[WCF] ServiceHost should look for inherited ServiceBehaviorAttribute
2015-12-22 07:33:03 -05:00
Rolf Bjarne Kvinge 93469b3569 Do not allow undefined references if bitcode is enabled.
The linker does not allow the '-undefined' flag when bitcode
is enabled, so we can't pass it to the linker at all.
2015-12-22 13:05:53 +01:00
Alexander Köplinger 579a2cd705 [ServiceModel] Remove custom free port finder code
We have a common one in NetworkHelpers now.
2015-12-22 01:59:01 +01:00
Aleksey Kliger f92547dc16 [WCF] ServiceHost should look for inherited ServiceBehaviorAttribute
Fixes #37035
2015-12-21 17:33:11 -05:00
Zoltan Varga b362500d85 [aot] Add hooks which can be used by embedders to load the aot data for aot images compiled with --aot=data-outfile=... 2015-12-21 17:06:56 -05:00
Miguel de Icaza ee3eec088d Add documentation for MONO_ENABLE_COOP 2015-12-21 14:16:49 -05:00
João Matos 6f4db43170 Merge pull request #2373 from akoeplinger/servicemodel-tcpreplychannel-race
[ServiceModel] Make TcpReplyChannel.OnClose thread-safe
2015-12-21 17:44:41 +00:00
Marek Safar ca587aad35 Merge pull request #2372 from abock/dcs-iserializable-bxc37171
XmlObjectSerialier: fix ISerializable (bxc#37171)
2015-12-21 18:33:47 +01:00
Aaron Bockover f76b8b4df1 XmlObjectSerialier: fix ISerializable (bxc#37171)
The shim/bridge between Mono and the RS implementation of
XmlObjectSerializer, DataContractSerializer, etc. did not properly
invoke the constructor required by ISerializable, as it completely
omitted passing the populated SerializationInfo object.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=37171
2015-12-21 11:00:46 -05:00
Alexander Köplinger 672cc68198 [ServiceModel] Make TcpReplyChannel.OnClose thread-safe
We were seeing the following unhandled exception on Jenkins:

````
Unhandled exceptions:
1) MonoTests.System.ServiceModel.OperationContextTest.Current : System.NullReferenceException: Object reference not set to an instance of an object
  at System.ServiceModel.Channels.NetTcp.TcpReplyChannel.OnClose (TimeSpan timeout) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Channels.NetTcp/TcpReplyChannel.cs:141
  at System.ServiceModel.Channels.CommunicationObject.Close (TimeSpan timeout) [0x0001c] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Channels/CommunicationObject.cs:140
  at System.ServiceModel.Channels.CommunicationObject.Close () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Channels/CommunicationObject.cs:131
  at System.ServiceModel.Dispatcher.ListenerLoopManager.TryReceiveRequestDone (IAsyncResult result) [0x00027] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChannelDispatcher.cs:583
```

This happens because multiple threads can call OnClose() and so `client` can be null.

Fixed this by taking code from HttpReplyChannel.OnClose which handled this already and also fixed the race condition there (the checks need to happen under a lock).
2015-12-21 14:33:14 +01:00
Marek Safar aaca175b44 Merge pull request #2370 from DavidKarlas/replaceQuote
[XBuild] Fixed method invocation with string argument containing ",` or '
2015-12-21 10:00:20 +01:00
Zoltan Varga e7166e4f9c Add preliminary support for storing the AOT metadata outside the AOT image. This can save about 10-20% from the executable size when statically linking AOT images. Needs callbacks to allow embedding apps to load the aot data. 2015-12-20 22:08:30 -05:00
monojenkins 2400cc6195 Merge pull request #2371 from akoeplinger/symbolicate-quoted
[symbolicate] Make sure MONO_PATH is quoted

Without it we saw a " ./../../class/lib/net_4_x: Is a directory" error in the cygwin build.

@monojenkins merge
2015-12-20 16:55:59 +00:00
Alexander Köplinger 412d06b373 [symbolicate] Make sure MONO_PATH is quoted
Without it we saw a " ./../../class/lib/net_4_x: Is a directory" error in the cygwin build.
2015-12-20 16:20:31 +01:00
David Karlaš 49f2a66d25 [XBuild] Fixed method invocation with string argument containing ",` or '
Before this commit string value starting or ending with this char was malformed because Trim removed also part of string value
Also fixed recent regression from 42c0a94445 which failed to split arguments if doubleQuote was inside singleQuoute
2015-12-20 10:41:01 +01:00
Zoltan Varga cb6ccf37a4 [llvmonly] Avoid emitting runtime invoke wrappers for the signatures which the gsharedvt based invoke wrappers can handle. 2015-12-19 18:43:09 -05:00
Zoltan Varga d1e6645b42 [llvmonly] Share more gsharedvt wrappers. 2015-12-19 18:29:41 -05:00
Zoltan Varga d2508abd9e [llvmonly] Avoid generating gsharedvt in wrappers for method signatures, they are not needed. 2015-12-19 18:06:45 -05:00
Alexander Köplinger 48020350b0 [csproj] Refreshed order.xml and csproj files 2015-12-19 17:58:35 +01:00
Frederik Carlier ce24528b41 Update the System.Diagnostics.Tracing namespace to better match the .NET API 2015-12-19 17:58:34 +01:00
Aleksey Kliger (λgeek) 9af477b63b Merge pull request #2364 from lambdageek/dev/checked-critical
[coop] checked build GC critical regions
2015-12-19 11:57:01 -05:00
João Matos f5adb4c2f8 Merge pull request #2367 from BillSeurer/master
[powerpc] New macros and utility functions for v2 elf ABI function calls
2015-12-19 16:16:49 +00:00
João Matos c1653b9bf8 Merge pull request #2369 from akoeplinger/msvc-win64-crash
[sgen] Disable freeing of OS memory on 64bit Windows build too
2015-12-19 16:15:23 +00:00
Alexander Köplinger e786c9b946 Merge pull request #2368 from DavidKarlas/portablePdbTargetsSupport
[XBuild] Add support for copying/cleaning portable .pdb files generated by Roslyn compiler
2015-12-19 15:31:28 +01:00
Alexander Köplinger 0f27da61ea [sgen] Disable freeing of OS memory on 64bit Windows build too
This was applied for the x86 build in 398c7fc21f.
Moved the check so that it applies to the x64 MSVC build as well.

We were hitting the same assert in mono_vfree() on Jenkins and this fixes it.
2015-12-19 15:17:02 +01:00
David Karlaš 6db292b470 [XBuild] Add support for copying/cleaning portable .pdb files generated by Roslyn compiler 2015-12-19 12:29:50 +01:00
Zoltan Varga ceeab929cc [llvmonly] Avoid adding some gsharedvt wrappers which are already added. 2015-12-19 01:39:03 -05:00
Zoltan Varga d08183ff48 [jit] Only emit the gsharedvt runtime invoke wrappers in llvm-only mode. 2015-12-19 01:19:37 -05:00
Zoltan Varga 9764580b0a [runtime] Factor out a part of mono_jit_runtime_invoke () into a separate function. 2015-12-19 01:19:37 -05:00
Zoltan Varga b6b9f61122 [runtime] Disable the check-seq-points tests on arm, it cannot be made to reliably work without major changes since arm cannot encode all 32 bit immediates inside instructions, which means that opcodes which call is_rotated_imm8 () would need special handling whe the 'single-imm-size' option is used. 2015-12-19 03:38:36 +00:00
Zoltan Varga f13b642d7f [jit] Enable gsharedvt in llvmonly mode by default if ENABLE_GSHAREDVT is defined. 2015-12-18 17:05:58 -05:00
Aleksey Kliger 3a60d3564c [coop] Checked build GC critical regions.
For local handles in coop suspend configuartions we need the idea of a
"critical region": a situation when transitioning from GC
Unsafe (running) to GC Safe (blocking) mode constitutes a bug. In
checked builds, we'd like to assert when that happens.

This PR adds MONO_PREPARE_GC_CRITICAL_REGION,
MONO_FINISH_GC_CRITICAL_REGION and MONO_REQ_GC_NOT_CRITICAL.

In regular build, these are nops. In checked build, they use a new
thread-local flag to prevent transitions from running to blocking.
2015-12-18 15:15:49 -05:00
Marek Safar 25497f5308 [mcs] Propagate null operator flag during standalone to extension methods promotion. Fixes #37080 2015-12-18 21:14:06 +01:00
Andi McClure de51d0e998 Peer feedback changes for babysitter script PR 2015-12-18 15:04:19 -05:00
Aleksey Kliger (λgeek) f2b8c44a91 Merge pull request #2314 from lambdageek/dev/local-handles
Just the low-level bits of the handles API
2015-12-18 14:55:12 -05:00
Bill Seurer 99902cec93 [powerpc] New macros and utility functions for v2 Elf ABI function calls. 2015-12-18 13:23:40 -06:00
Andi McClure 1dc0598bad Adds babysitter script for PR tests
I see two problems with our current automated PR tests:
- Many false negatives— PR tests often fail due to recurring failures
  unrelated to the PR
- Information about what failed is awkward to retrieve, scattered in
  multiple places

This commit adds a Python script, `scripts/babysitter`. Currently our
Jenkins test suites are each run wrapped with the `timeout` command.
The babysitter acts as a drop-in replacement for GNU timeout but adds
the following features:
- Logs machine readable output about each test suite (as
  line-delimited json)
- If the test suite uses NUnit, can detect if a test case failed or
  crashed (terminated mono in mid-test), and retry unsuccessful tests
  (up to a limit).

The reasoning here is that tests which fail inconsistently are
currently most likely due to one of our outstanding recurring failures
rather than the change made in the PR. Therefore, if a failing test
succeeds on retry, the PR itself is probably valid (although the
failure should be logged and looked at).

In addition to the script itself, changes to NUnit were required in
order to support the retry feature and allow fine-grained logging for
NUnit suites.

Major TODOs:
- Add retry support for our non-NUnit-based test suites
- Save the XML files NUnit produces (since reruns stomp XMLs from
  previous runs)
- Add some kind of sensible feature for dealing with timeouts
2015-12-18 13:15:18 -05:00
Miguel de Icaza e20cd1cf85 [icall/GetMachineName] Use sysconf if available to capture the whole host name, fall back to a fixed size buffer otherwise 2015-12-18 13:10:46 -05:00
Ludovic Henry 223af711a1 [coop] Cleanup 2015-12-18 11:21:46 -05:00
Ludovic Henry 3a22518833 [coop] Introduce new runtime handle API 2015-12-18 11:21:45 -05:00
Zoltan Varga 3cfbb97b17 [runtime] Remove some debug printfs. 2015-12-18 01:38:23 -05:00
Zoltan Varga a705a45de2 Add an alternative implementation for runtime invokes in llvmonly mode
which uses gsharedvt out wrappers. We invoke the wrappers, and the
wrappers invoke the methods themselves. The advantage of this approach is
that the set of possible signatures for gsharedvt out wrappers is small,
so the set of runtime invoke wrappers needed to invoke them is also small,
thus only a small number of them need to be generated.
Not yet enabled.
2015-12-18 00:42:20 -05:00
Zoltan Varga 27302ec451 [runtime] Add a mono_marshal_get_runtime_invoke_for_sig () helper function to create a runtime invoke wrapper for a signature. 2015-12-18 00:42:20 -05:00
Alexis Christoforides 682bd7ab48 [mkbundle] Fix --nomain option for Windows 2015-12-17 21:38:20 -05:00
Alexis Christoforides 84d7f7e888 [mkbundle] Allow override of embedded assemblies.
If they exist, name-matched assemblies in the current directory will be embedded instead of the properly resolved ones.
2015-12-17 21:38:19 -05:00
Zoltan Varga d6c522d5ed Merge pull request #2365 from akoeplinger/fix-llvm-method
[mini] Ensure mono_llvm_create_vars() is only present in ENABLE_LLVM
2015-12-17 21:10:07 -05:00
Alexander Köplinger a8a3253def [mini] Ensure mono_llvm_create_vars() is only present in ENABLE_LLVM
It caused a build error on msvc debug builds because the symbol wasn't there.
2015-12-18 02:59:23 +01:00
Vlad Brezae fff669316e [sgen] Pagesize is already cached in mono_pagesize 2015-12-18 01:55:51 +02:00
Vlad Brezae 99d608a7e0 [sgen] Add align defines. 2015-12-18 01:55:49 +02:00
Alexander Köplinger 0de646eb4c Merge pull request #2350 from akoeplinger/signcode-sha1
[signcode] Change default hashing algorithm from MD5 to SHA1
2015-12-17 23:38:09 +01:00
Alexis Christoforides 34c202a092 [mkbundle] Fix typo 2015-12-17 17:02:55 -05:00
Alexis Christoforides 62eca45496 [mkbundle] Correct some linking options for Windows 2015-12-17 13:45:20 -05:00
Alexis Christoforides 48cf6194d0 [mkbundle] Allow overriding linked Mono library path 2015-12-17 13:45:20 -05:00
Alexis Christoforides 3e40c70cf4 Merge pull request #2342 from lewurm/mkbundlefix
[mkbundle] restore old behavior of -c flag
2015-12-17 13:44:56 -05:00
Erik Larkö b723c89628 Apple has introduced the System Integrety Protection in OS X 10.11. This prevents writes to /usr amongst other paths. /usr/local is still writable though.
System.Environment.SpecialFolder.CommonApplicationData returns /usr/share on OS X 10.11, which is now not a very good place to put things :) This patch changes this folder to /usr/local/share.

This change is released under the MIT license.
2015-12-17 17:30:29 +01:00
Sebastien Pouliot f663abeaf1 [test][System.Runtime.Serialization] Ensure test compile on XI (avoid more than one Main method) 2015-12-17 09:02:49 -05:00
Jo Shields fcb5e103e7 Fix "make dist" WITHOUT accidentally un-bumping referencesources 2015-12-17 10:29:57 +00:00
Jo Shields f66b5973d6 Revert "Fix typo in dde9ee9e (Fixes make dist)"
This reverts commit 85cbe23b99.
2015-12-17 10:29:17 +00:00
Jo Shields 85cbe23b99 Fix typo in dde9ee9e (Fixes make dist) 2015-12-17 09:45:37 +00:00
Zoltan Varga b8285895e7 [jit] Fix the support for gshared types in mini_emit_initobj (), previously we were treating them as reference types, leading to stack overwrites. Fixes #37079. 2015-12-17 01:20:13 -05:00
Vlad Brezae ce8077bd4c [sgen] Use SGEN_ALIGN_UP in more places 2015-12-17 03:46:00 +02:00
Zoltan Varga 68c21f2734 [jit] Make it possible to enable gsharedvt in llvmonly mode even if MONO_ARCH_GSHAREDVT_SUPPORTED is not enabled. 2015-12-16 16:07:34 -05:00
Zoltan Varga eb8745e71a [jit] Remove a superfluous assert. 2015-12-16 15:38:05 -05:00
Zoltan Varga 51ae069cda [jit] Reorganize mono_jit_runtime_invoke () a bit so info->ret_box_class is set even if dyncall is not supported. 2015-12-16 15:17:41 -05:00
Zoltan Varga 756c659ca6 Add support for translating between normal and gsharedvt calling conventions in llvmonly mode.
This is implemented by generating two wrappers for each concrete signature found in the assembly:
* an 'in' wrapper translates from the normal to the gsharedvt signature
* an 'out' wrapper translates from the gsharedvt to the normal signature

The wrappers take an extra argument, which points to a function descriptor, which is an <addr, arg> pair. They
make a call to ADDR which ARG as an extra argument. ADDR/ARG is either a gsharedvt method with an rgctx
argument, or another gsharedvt wrapper with a function descriptor argument.

All calls made out of gsharedvt methods with a variable signature use the gsharedvt calling convention. If the
callee is also gsharedvt, no wrapper is needed. If the callee is not gsharedvt, the call goes thought
a gsharedvt out wrapper.
Calls made from normal methods to gsharedvt methods go though a gsharedvt in wrapper.

    * mini-generic-sharing.c (mini_get_gsharedvt_in_sig_wrapper): New function to generate gsharedvt in
    wrappers as IL code.
    (mini_get_gsharedvt_out_sig_wrapper): Ditto for out wrappers.

    * method-to-ir.c (emit_llvmonly_calli): New helper function to make a call to a function descriptor.
    (mono_method_to_ir): Make some indirect calls to MONO_RGCTX_INFO entries using function descriptors.

    * aot-compiler.c (compile_method): Generate gsharedvt wrappers for the signatures used by the method.

    * aot-runtime.c (decode_method_ref_with_target): Decode gsharedvt wrappers.

    * jit-icalls.c (resolve_vcall): Rewrite this so it can handle gsharedvt as well.
    (resolve_iface_call): Ditto.
    (mono_init_delegate): Ditto.
    (mono_init_delegate_virtual): Ditto.

    * mini-trampolines.c (mini_create_llvmonly_ftndesc): New helper function to create a function descriptor.
    (mini_add_method_wrappers_llvmonly): New helper function to add gsharedvt in/out wrappers, similar
    to mini_add_method_trampolines ().

    * mini-generic-sharing.c (mini_get_gsharedvt_wrapper): Return the newly added wrappers in llvmonly mode.
    (class_type_info): Insert gsharedvt wrappers if needed. Some MONO_RGCTX_INFO types will now resolve to
    function descriptors instead of function addresses.
    (instantiate_info): Ditto.
2015-12-16 15:09:55 -05:00
Zoltan Varga 36c7332104 2015-12-16 Zoltan Varga <[email protected]>
Add mono_signature_full_name () helper function.

	* debug-helpers.c (mono_signature_full_name): New helper function to stringify a signature, including
	its return types as well.
2015-12-16 14:11:28 -05:00
Zoltan Varga 95263a9615 2015-12-16 Zoltan Varga <[email protected]>
Add beginnings for support for gsharedvt in llvmonly mode. Gsharedvt methods use a calling convention
	where everything is passed and returned by ref, even normal types. I.e.

	public int foo<T> (T t, int i);

	becomes:

	void foo (int *vret, T* t_addr, int *i_addr);

	Not enabled yet.

	* mini-llvm.c: Implement support for gsharedvt.

	* ssa.c (mono_ssa_remove_gsharedvt): Same as mono_ssa_remove (), but only remove the
	OP_VPHI nodes referencing gsharedvt variables, since they cannot be handled by the
	llvm backend.

	* mini-llvm.c (mono_llvm_create_vars): New backend function, similar to mono_arch_create_vars ().

	* decompose.c (mono_decompose_vtype_opts): Decompose more opcodes in llvm mode so
	opcodes using gsharedvt variables don't reach the llvm backend. Some, like OP_LDADDR and
	vcalls, still do.

	* method-to-ir.c (mono_allocate_gsharedvt_vars): New function to allocate gsharedvt locals,
	extracted from mono_spill_global_vars () so it can be used in llvm mode too.
2015-12-16 14:11:28 -05:00
Jonathan Pryor 4e45904553 [mono-api-info] Add mono-api-info -L, mono-api-info -r
**The Scenario**: `mono-api-info` and `mono-api-html`, together, are a
useful way to track API changes over time, specifically to check for
accidental API breakage:

	# Have a "known good" assembly version;
	# keep reference/assembly.xml in version control
	$ mono-api-info assembly.dll > reference/assembly.xml

	# ...then on every new build, check for breakage:
	$ mono-api-info assembly.dll > new-assembly.xml
	$ mono-api-html reference/assembly.xml new-assembly.xml > assembly-diff.html
	$ if grep '<p>Removed' assembly-diff.html > /dev/null ; then \
		echo "ABI BREAK IN assembly.dll" ; \
		cat assembly-diff.html ; \
	fi

This is a very nice workflow, and has been used in Xamarin.Android to
track accidental API breakage for some time.

**The problem** with the above workflow are *implicit* references:
`mono-api-info` will happily look for dependencies in the same
directory as `assembly`, but it will *also* look for assembly
references in various system-specific directories, which is fine...

...until it *isn't* fine, e.g. if you have your own version of
mscorlib.dll that you need to use, *not* the system one, as your own
version may have API differences from the system mscorlib.dll which
are "percolated" into `mono-api-info` output. For example, on
"desktop" profiles, System.Attribute implements
System.Runtime.InteropServices._Attribute, and thus *all* custom
attribute types will have _Attribute listed as an implemented
interface. The Xamarin.iOS and Xamarin.Android mscorlib.dll,
meanwhile, does *not* have System.Attribute implementing _Attribute.
Consequently, changing the mscorlib.dll which is used while processing
an assembly will change `mono-api-info` output, resulting in "API
breakage" which doens't actually exist, because the wrong mscorlib.dll
was used to generate the original API description in the first place.

We need a way to control which mscorlib.dll/etc. are used. This can be
done by allowing specification of the assembly search directories, so
that we can "override" the default system-specific directory location.

**The solution**: Add a `mono-api-info -L PATH` option which adds PATH
to the list of directories that `mono-api-info` will search when
resolving assembly references. This allows "overriding" the system
directory location, as PATH will be searched for mscorlib.dll before
the system directory location.

Additionally, add a `mono-api-info -r ASSEMBLY` option, which will
pre-process ASSEMBLY (and all dependencies) and add the directory
which contains ASSEMBLY to the assembly search paths.

These two options are conceptually similar to `mcs -L` and `mcs -r`.

Finally, while adding support for these options, add support for
`mono-api-info --help`, so that we don't need to use only the man page
to get option information.
2015-12-16 13:02:19 -05:00
Alexander Köplinger cd62639d9c Merge pull request #2324 from akoeplinger/caching-locking
[System.Runtime.Caching] Add missing locking when accessing cache entries
2015-12-16 18:05:45 +01:00
Rodrigo Kumpera 8e8abf2a8f Merge pull request #2356 from ludovic-henry/fix-thread-suspend-deadlock
[threads] Fix potential deadlock on suspend
2015-12-16 10:57:17 -05:00
Ludovic Henry 0e1e2e0ff1 [threads] Fix potential deadlock on suspend
Because mono_thread_info_safe_suspend_and_run is locking the suspend lock, we cannot enter the blocking state in any of its callee, as that could lead to a deadlock.
2015-12-16 14:00:15 +00:00
monojenkins ac432e4ba2 Merge pull request #2353 from ludovic-henry/fix-servicemodel-15153
Add test and merge #1879

@monojenkins merge
2015-12-16 13:55:04 +00:00
monojenkins 4313344919 Merge pull request #2351 from ludovic-henry/fix-socket-36941
[socket] Add test for SocketOptionName.MulticastTimeToLive
2015-12-16 11:35:02 +00:00
Marek Safar 9dc34141e1 Merge pull request #2345 from akoeplinger/xbuild14
Bump xbuild script to 14.0 and a few other fixes
2015-12-16 12:13:07 +01:00
Mark Mikofski d6ff307ec6 Add test for bug #15153 2015-12-16 10:40:24 +00:00
Ludovic Henry b78f3f6f07 [socket] Add test for SocketOptionName.MulticastTimeToLive 2015-12-16 10:11:42 +00:00
Andi McClure d75e8ea37e Merge pull request #2354 from xmcclure/ugh-no-gdi
Fix Microsoft.Build.Tasks make check on OS X
2015-12-15 22:38:31 -05:00
Andi McClure 2cb0c1ed7b Fix Microsoft.Build.Tasks make check on OS X
The mcs/class/Microsoft.Build.Tasks make check contains a test whose
goal is to verify that Microsoft.Build.Evaluation.Project can run a
MSBuild code fragment which has an assembly reference. The assembly
referenced in the test is System.Drawing. However on many systems
System.Drawing does not work without special setup. The test should
reference a different assembly (I picked System.Runtime.Serialization)
because ensuring System.Drawing is working isn't relevant to the test.
2015-12-15 17:23:31 -05:00
Andi McClure 45f2f4854a Merge pull request #2346 from xmcclure/proxy-load-fail
Let GetTransparentProxy fail clean on load error (bug 36848)
2015-12-15 16:39:09 -05:00
Alexander Köplinger f378e76b0d [signcode] Change default hashing algorithm from MD5 to SHA1
MD5 is considered insecure and switching the default to SHA1 should be better for everyone.

See the discussion on the mailing list: http://lists.ximian.com/pipermail/mono-devel-list/2015-December/043424.html
2015-12-15 20:57:57 +01:00
Alexander Köplinger fb76fe4ed4 [scripts] Bump xbuild script to 14.0
This means we'll use xbuild 14.0 by default, which allows users to build projects with ToolsVersion=14.0
2015-12-15 20:37:46 +01:00
Alexander Köplinger 51b91335be [xbuild] Add new TargetFrameworkVersion entries in Microsoft.Common.targets
Add the new 4.5.2, 4.6 and 4.6.1 versions to Microsoft.Common.targets so xbuild doesn't print "warning : TargetFrameworkVersion 'v4.6.1' not supported by this toolset".

Additionally I found a bug in the target where "and" was used instead of "or" which means the condition was never true, fixed as well.
2015-12-15 20:37:46 +01:00
Andi McClure dde9ee9e2f Let GetTransparentProxy fail clean on load error (bug 36848)
icall for Remoting.RealProxy.GetTransparentProxy can sometimes attempt
to load an invalid class which is not previously loaded. Currently,
this leads to an assert failure in mono_class_proxy_vtable which does
not expect to be getting an invalid proxy class as input. Fix is for
the icall to load the class early and raise on failure.

A test is included.
2015-12-15 13:47:56 -05:00
monojenkins 564fe71fa8 Merge pull request #2338 from BogdanovKirill/httpwritefix3
[HttpConnection] Bug fix: HttpListener's "IgnoreWriteExceptions" property value is ignored when "Expect: 100-Continue" header set in request

That problem was discussed previously here: https://github.com/mono/mono/pull/2300
I want to offer alternative solution now.
2015-12-15 17:43:22 +00:00
monojenkins 42c503ad55 Merge pull request #2344 from ludovic-henry/fix-servicemodel-flakiness
[tests] Fix more System.ServiceModel flakiness

@monojenkins: automerge
2015-12-15 16:00:03 +00:00
Ludovic Henry bc46b50bec [tests] Fix more System.ServiceModel flakiness 2015-12-15 14:27:22 +00:00
monojenkins 03fea967b0 Merge pull request #2343 from ludovic-henry/threads-cleanup
[automerge][threads] Various cleanups

None
2015-12-15 13:29:58 +00:00
Ludovic Henry 1341462d18 [threads] Add mono_thread_info_usleep function 2015-12-15 11:59:27 +00:00
Ludovic Henry 0535ccce42 [threads] Bring mono_thread_info_safe_suspend_and_run code together 2015-12-15 11:58:21 +00:00
Ludovic Henry f7ad314256 [threads] Remove dead code 2015-12-15 11:45:33 +00:00
monojenkins bf92280e7b Merge pull request #2340 from ludovic-henry/fix-servicemodel-flakiness
Merge pull request #2340 from ludovic-henry/fix-servicemodel-flakiness

[tests] Attempt at fixing System.ServiceModel.Dispatcher.Bug32886.Bug32886_Test flakiness
2015-12-15 02:35:02 +00:00
Bernhard Urban c010d577b6 [mkbundle] restore old behavior of -c flag 2015-12-14 17:16:48 -08:00
Ludovic Henry 6776742fde [tests] Attempt at fixing System.ServiceModel.Dispatcher.Bug32886.Bug32886_Test flakiness 2015-12-14 23:59:42 +00:00
Alexis Christoforides f81f8763c1 Merge pull request #2306 from migueldeicaza/master
[mono/driver] On OSX, increase the number of file handles available.
2015-12-14 15:05:28 -05:00
monojenkins aadfc9966e Merge pull request #2341 from ludovic-henry/fix-threadpool-max-worker
Merge pull request #2341 from ludovic-henry/fix-threadpool-max-worker

[automerge][threadpool] Fix various threadpool issues

Tests results:
 - ARM soft float Linux: pending
 - i386 Windows: pending
 - i386 Linux: success
 - ARM hard float Linux: pending
 - AMD64 Linux: success
 - i386 OSX (Proprietary): failure
2015-12-14 19:04:11 +00:00
Ludovic Henry e769c3d881 [threadpool] Saner default for max number of worker threads on android and ios 2015-12-14 17:09:09 +00:00
Ludovic Henry a06e616587 [threadpool] Limit number of threads created per second 2015-12-14 17:09:09 +00:00
Ludovic Henry 3513df7305 [threadpool] Fix overflow of max number of worker threads
In case all threads would wait on a Sleep or a Wait, the monitor thread would simply increase the number of max working thread, up to the point it would overflow the number of max worker threads.
2015-12-14 17:09:08 +00:00
Marek Safar 9900f812e2 Merge pull request #2218 from mono/assignProjectConfigurtionFix
AssignProjectConfigurtion task fix
2015-12-14 15:37:18 +01:00
Marek Safar fca35d0455 Bump reference souces to include fix for #36786 2015-12-14 13:29:53 +01:00
Marek Safar 0944794945 [mcs] test update to work on 64bit mono 2015-12-14 11:58:11 +01:00
Marek Safar 988706c4d0 Merge pull request #2334 from iainx/handle-comma
[mcs] Handle commas inside quotes correctly
2015-12-14 09:50:30 +01:00
iain holmes 42c0a94445 [mcs] Handle commas inside quotes correctly
OpenLiveWriter's build files break due to incorrectly parsing (".",",") as three arguments: a . and two " instead of two: a . and a ,

This is the error:

OpenLiveWriter/writer.build.targets: error : Error executing task WriteLinesToFile: Error converting Property named 'Lines' with value '#define FILE_VERSION $(BuildVersion.Replace(".",","));#define PRODUCT_VERSION $(BuildVersion)' to type Microsoft.Build.Framework.ITaskItem[]: Method 'Replace(., , )' arguments cannot be evaluated'

This patch ignores , as a separator character if it is inside ""
2015-12-13 19:12:57 +00:00
Frederik Carlier 1088aae436 Include EventSource-related classes 2015-12-13 14:55:17 +00:00
Frederik Carlier 4ed3927036 System.Diagnostics.Tracing: Add missing classes 2015-12-13 14:53:30 +00:00
bogdanov 10e5aba155 [HttpConnection] Bug fix: HttpListener's "IgnoreWriteExceptions" property value is ignored when "Expect: 100-Continue" header set in request
The problem is connected with "Listener" property of "context" object. It is null in "GetResponseStream" method, when it's called internally from "FinishInitialization" method of "HttpListenerRequest" class. This problem is possible only in situation when we have "Expect: 100-Continue" header from http client.

This change is released under the MIT license.
2015-12-13 18:29:12 +05:00
Marek Safar d93c3106c0 Merge pull request #2335 from iainx/implement-mir
Microsoft.Build.Engine] Implement ConvertToITaskItemArray
2015-12-13 08:19:33 +01:00
Alexander Köplinger ad8ebf5bad [acceptance-tests] Bump coreclr and ms-test-suite repos
Brings in similar fixes to those repos like in e6cf61f920
2015-12-13 02:55:28 +01:00
Alexander Köplinger e6cf61f920 [corlib] Fix String.PadLeft/Right tests and add a new test for large string
We didn't catch the regression that is fixed in a780c52749
because the tests didn't check the actual string or that an OOM is raised.

Add a new test for creating a large string (which works on 64bit Mono) to test a similar
codepath.
2015-12-13 02:51:17 +01:00
Frederik Carlier 83dc431619 EventSource: Add WriteEvent overloads, properties, constructors, to better match what's available in .NET 4.5 2015-12-13 00:52:31 +00:00
Frederik Carlier cf3469db19 System.Diagnostics.Tracing: Use Reference Source files where possible, add EventSourceSettings enum 2015-12-13 00:50:50 +00:00
iain holmes 7ca3836e05 Microsoft.Build.Engine] Implement ConvertToITaskItemArray
Create a TaskItem containing the result of the invocation
2015-12-12 22:18:53 +00:00
Martin Baulig ec9b161ca8 Revert "[System]: Add _HelperAsyncResults.cs from the referencesource."
This reverts commit c6d239fa79.

(cherry picked from commit cfc81a28ab)
2015-12-12 12:39:43 -05:00
Marek Safar 22794cf3c4 [mcs] Improve a780c52749 to not emit extra conversion for constant values 2015-12-12 11:05:57 +01:00
Ludovic Henry 60e1beca4a Merge pull request #2311 from mlancione/master
[System.Windows.Forms] Locking Window Handle List
2015-12-11 19:10:14 +00:00
Rodrigo Kumpera 6f5ff63651 Merge pull request #1916 from ludovic-henry/iolayer-remove-sharedhandle
[io-layer] Remove shared handles cross process support
2015-12-11 12:25:46 -05:00
Ludovic Henry 2ef7d89bd7 [threadpool] Fix GetAvailableThreads test 2015-12-11 17:22:38 +00:00
Marek Safar a780c52749 [mcs] Extend int to native int when doing pointer arithmetic on it. Fixes #36839 2015-12-11 17:55:56 +01:00
mlancione 2c031ad668 Typo error
Fixing a compiler error.
2015-12-11 09:21:16 -05:00
Ludovic Henry 91ddeb4a83 [io-layer] Remove shared handles cross process support 2015-12-11 14:00:39 +00:00
João Matos ce4c1182c0 Merge pull request #2327 from akoeplinger/fix-msvc
[msvc] Fix casts that result in an error when building with VS
2015-12-10 23:04:27 +00:00
Marek Habersack 262b4ef73f Fix endless recursion in XmlCompiledTransform on mobile
One of the XmlCompiledTransform overloads called itself recursively,
leading to either a stack overflow or segfault

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=36436
2015-12-10 22:01:52 +01:00
Alexander Köplinger 52e4236ccd [msvc] Fix casts that result in an error when building with VS
Those showed up after the recent C++ compliance commit.
2015-12-10 21:46:34 +01:00
Martin Baulig c6d239fa79 [System]: Add _HelperAsyncResults.cs from the referencesource.
(cherry picked from commit 17e92c8775)
2015-12-10 15:29:14 -05:00
Rodrigo Kumpera a9f65e0f28 [jit] Better error message for a gsharing assert. 2015-12-10 14:37:21 -05:00
Rodrigo Kumpera bebc7ee13f [configure] Bump mono version.D 2015-12-10 14:14:07 -05:00
João Matos a7317980f5 Fixed Windows MinGW build and avoid leakage of io-layer types. 2015-12-10 18:15:09 +00:00
Martin Baulig b1a575a3b5 [corlib]: Cleanup X509Certificate and move the implementation-specific bits into a separate class.
(cherry picked from commit b82b0b8402)
2015-12-10 13:03:47 -05:00
Ludovic Henry 2a7060c124 [threadpool] Fix System.Web tests failures 2015-12-10 16:54:22 +00:00
Aleksey Kliger (λgeek) ca39924db5 Merge pull request #2310 from lambdageek/dev/bug-36305
[reflection] Fix MethodInfo.GetBaseDefinition for open constructed types (close #36305)
2015-12-10 11:13:43 -05:00
mlancione b2a7312983 More code-style changes
Fixed a few other code style requirements.
2015-12-10 09:22:58 -05:00
Alexander Köplinger 7a79d9d7e6 [System.Runtime.Caching] Add missing locking when accessing cache entries
The "entries" collection in CacheEntryCollection can be modified while we're enumerating it,
which is not allowed. Add locking in FlushItems() to prevent this.
2015-12-10 14:56:05 +01:00
mlancione 9146d3e90f Code-style changes
Chaged code to match mono coding style.
2015-12-10 08:54:22 -05:00
Ludovic Henry d7cb86ab64 Merge pull request #2305 from ludovic-henry/fix-threadpool-36414
[threadpool] Fix get min and available threads icalls
2015-12-10 11:18:10 +00:00
Martin Baulig 4f9c74a2c4 Merge pull request #2296 from xmcclure/webrequest-regex
Correctly escape proxy domains in WebRequest (bug #36356)
2015-12-09 22:17:21 -05:00
Alexander Köplinger 0a7461e32c Merge pull request #2312 from ArsenShnurkov/bug36724
fix for https://bugzilla.xamarin.com/show_bug.cgi?id=36724
2015-12-10 01:12:19 +01:00
Zoltan Varga 0883d8d549 Fix the x86/ppc build. 2015-12-09 18:57:22 -05:00
Martin Baulig 5da163f6f4 [corlib]: X509Certificate needs to implement IDisposable. 2015-12-09 18:48:10 -05:00
João Matos 487cc2845f Merge pull request #2288 from evincarofautumn/c++-compat
[runtime] Compile cleanly with -Wc++-compat.
2015-12-09 23:29:25 +00:00
Jon Purdy ef48103513 [runtime] Compile cleanly with -Wc++-compat.
* Add explicit casts for void pointers and enums.

 * Rename 'class' to 'klass' and 'this' to 'this_obj'.

 * Avoid other C++ keywords by appending an underscore.

 * Change MonoSeqPointInfo to avoid empty struct size warnings.
2015-12-09 14:05:58 -08:00
Zoltan Varga 4705ea65d5 [sdb] Align the location of the MonoContext structure on the stack in the sdb trampolines on x86, to prevent a possible crash with memcpy. 2015-12-09 16:36:54 -05:00
Ludovic Henry 780fbf4a57 [threadpool] Fix get min and available threads icalls
Fix bug #36414
2015-12-09 19:38:05 +00:00
Aleksey Kliger ced936f46b [reflection] Fix MethodInfo.GetBaseDefinition() for open constructed base types.
When a generic derived class has an open constructed base type, we have
to apply the type arguments in order to find the correct base definition MethodInfo.
2015-12-09 14:36:19 -05:00
Alexis Christoforides 85c7bd08ef Merge pull request #2285 from knocte/filesystemwatcher
[FileSystemWatcher] Kill race condition (fixes BXC#10205)
2015-12-09 14:11:41 -05:00
mlancione 1ccc3e5e03 Fixing Tab Spaces
Replaced spaces in previous commit with tabs, to follow format of
mono/master.
2015-12-09 14:09:05 -05:00
Alexis Christoforides 22cc803651 [mkbundle] Fix execution on OS X and Linux 2015-12-09 13:51:32 -05:00
ArsenShnurkov f0c0c2b246 fix for https://bugzilla.xamarin.com/show_bug.cgi?id=36724 2015-12-09 20:58:00 +03:00
Aleksey Kliger e5644cf2dc [reflection] Test case for 36305.
When the base type of a generic type is an open constructed generic
type, GetBaseDefinition() must take the instantiation into account while
traversing the class hierarchy.
2015-12-09 10:39:28 -05:00
Miguel de Icaza 5dcc44a7ed [mono/driver] On OSX, increase the number of file handles available.
We just reverted a patch that prevented the FileSystemWatcher from
opening too many file descriptors (200).  That was a band-aid at one
of the spots that opened too many file, as we would exhaust the number
of files, and later abort when some other operation needed files.

The problem is that OSX defaults to 256 file descriptors, and .NET
applications are file descriptor hungry, in fact, many applications
increase their file handled limit before starting.

This patch on OSX will attempt to increase the number of handles
available to 1024 if the number of handles avaialble is less than
that.

The commit that removed the limit was:

2af882232c

And it was closed to fix:

#28693
2015-12-08 21:10:13 -05:00
Alexander Köplinger 0434dc0235 Merge pull request #2297 from akoeplinger/msvc-autoupdate-config.h
[msvc] Automatically update (win-)config.h with the correct version number
2015-12-08 23:54:10 +01:00
Zoltan Varga 01aab6b158 Disable partial sharing again, it causes problems on ppc/s390x, and crashes in the roslyn benchmark:
https://performancebot.mono-project.com/builders/debian-armhf_utilite-desktop_auto-sgen/builds/743/steps/roslyn/logs/stdio
2015-12-08 17:21:57 -05:00
Zoltan Varga 4d7c4f1a2b [llvm] Use a separate calling convention for gsharedvt methods in llvmonly mode, pass/return everything by ref. Not yet used. 2015-12-08 17:12:28 -05:00
Rodrigo Kumpera 50ed95a0c7 Merge pull request #2295 from lambdageek/dev/test-conc-hashtable-coop-fix
(test-conc-hashtable.c) Make test work with cooperative suspend
2015-12-08 16:29:33 -05:00
Ludovic Henry 1d00109cd3 Merge pull request #2302 from ludovic-henry/fix-delegate-36640
[delegate] Fix multicast Method property implementation
2015-12-08 20:33:53 +00:00
Bernhard Urban 0417db05ea [runtime] remove debug statements introduced by a0e1dae32c 2015-12-08 11:38:21 -08:00
João Matos 59866a89e7 Merge pull request #2304 from BillSeurer/master
[ppc] Temporary fix for power to get builds working.
2015-12-08 19:31:37 +00:00
Ludovic Henry 5b9b780ba7 Merge pull request #2301 from ludovic-henry/fix-delegate-36646
[delegate] Fix multicast remove behaviour
2015-12-08 18:54:41 +00:00
Bill Seurer 35b511524a [ppc] Temporary fix for power to get builds working. 2015-12-08 12:52:01 -06:00
Zoltan Varga d91246028c [runtime] Initialize a dynamic_images_mutex. 2015-12-08 12:19:11 -05:00
Ludovic Henry 20df1ab1ff [delegate] Fix multicast remove behaviour
The .NET delegate removal semantic is a bit unpredictable. For example, the following (d1 + d2 + d3) - (d1 + d3) is going to return the d123 delegate, and not the d2 delegate as we could have guessed. This is because removal will remove the `list' of delegates as a whole, and not the elements in the list.

The previous implementation would then have a different behavior than the one observed on .NET.

Fixes bug #36646
2015-12-08 16:43:26 +00:00
Ludovic Henry 174c4317b1 [delegate] Fix multicast Method property implementation
.NET returns the method for the last delegate of the multicast delegate.
2015-12-08 16:38:32 +00:00
Zoltan Varga f59f83e577 Merge pull request #2299 from lewurm/finalizer_thread
[runtime] adding additional assert to highlight source of a race
2015-12-08 11:37:49 -05:00
Zoltan Varga 93f14d9b0e Merge pull request #2298 from akoeplinger/gsnprintf
[metadata] Use g_snprintf instead of snprintf to fix MSVC build
2015-12-08 00:58:56 -05:00
Bernhard Urban a0e1dae32c [runtime] adding additional assert to highlight source of a race
We've seen that error for quite some time:

> `* Assertion at ../../mono/utils/mono-os-mutex.h:71, condition `res != EINVAL' not met`

It looks like there's a race between `finalizer_thread()` and `mono_gc_cleanup()` around
`reference_queue_mutex`. The source of the problem is, `finalizer_thread` could end up
being alive, although `mono_gc_cleanup()` made some effort to kill it and then destroys
`reference_queue_mutex`, while the finalizer thread is still using it in
`reference_queue_proccess_all()`.

> $ MONO_GC_DEBUG=bridge=Bridge MONO_GC_PARAMS=minor=split MONO_ENV_OPTIONS=--gc=sgen MONO_PATH=/home/lewurm/monoperf/mono/mcs/class/lib/net_4_x ../../mono/mini/mono sgen-bridge-major-fragmentation.exe --optimize=all --debug
> [...]
> [12/08/2015 01:49:31] done
> Shutting down finalizer thread timed out.
> * Assertion at gc.c:867, condition `finalizer_thread_exited' not met
>
> Stacktrace:
>
>
> Native stacktrace:
>
>
> Debug info from gdb:
>
> [New LWP 7623]
> [New LWP 7622]
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
> 0x4043b5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
>   Id   Target Id         Frame
>   3    Thread 0x417ff430 (LWP 7622) "mono" 0x4043b5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
>   2    Thread 0x42573430 (LWP 7623) "Finalizer" 0x0021482a in finalizers_with_predicate (predicate=0x1fd121 <object_in_domain_predicate>, user_data=0x37a348, out_array=0x42572c70, out_size=64, hash_table=0x338f68 <major_finalizable_hash>) at sgen-fin-weak-hash.c:581
> * 1    Thread 0x406c4250 (LWP 7620) "mono" 0x4043b5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
>
> Thread 3 (Thread 0x417ff430 (LWP 7622)):
> #0  0x4043b5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1  0x404371d8 in pthread_cond_wait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #2  0x00242266 in mono_os_cond_wait (cond=0x346e98 <work_cond>, mutex=0x346e80 <lock>) at ../../mono/utils/mono-os-mutex.h:105
> #3  0x00242c1a in thread_func (thread_data=0x0) at sgen-thread-pool.c:118
> #4  0x40433fbc in start_thread () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #5  0x405a0b3c in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>
> Thread 2 (Thread 0x42573430 (LWP 7623)):
> #0  0x0021482a in finalizers_with_predicate (predicate=0x1fd121 <object_in_domain_predicate>, user_data=0x37a348, out_array=0x42572c70, out_size=64, hash_table=0x338f68 <major_finalizable_hash>) at sgen-fin-weak-hash.c:581
> #1  0x00214894 in sgen_gather_finalizers_if (predicate=0x1fd121 <object_in_domain_predicate>, user_data=0x37a348, out_array=0x42572c70, out_size=64) at sgen-fin-weak-hash.c:622
> #2  0x001fd16a in mono_gc_finalizers_for_domain (domain=0x37a348, out_array=0x42572c70, out_size=64) at sgen-mono.c:546
> #3  0x001ca2a4 in finalize_domain_objects (req=0x47ba68) at gc.c:678
> #4  0x001ca3b6 in finalizer_thread (unused=0x0) at gc.c:730
> #5  0x001a1392 in start_wrapper_internal (data=0x3b1100) at threads.c:713
> #6  0x001a1430 in start_wrapper (data=0x3b1100) at threads.c:760
> #7  0x0027097a in inner_start_thread (arg=0xbed58de0) at mono-threads-posix.c:92
> #8  0x40433fbc in start_thread () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #9  0x405a0b3c in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>
> Thread 1 (Thread 0x406c4250 (LWP 7620)):
> #0  0x4043b5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1  0x4043a396 in waitpid () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #2  0x000d1b24 in mono_handle_native_sigsegv (signal=6, ctx=0xbed58a80, info=0xbed58a00) at mini-exceptions.c:2235
> #3  0x00112424 in sigabrt_signal_handler (_dummy=6, _info=0xbed58a00, context=0xbed58a80) at mini-posix.c:218
> #4  <signal handler called>
> #5  0x405248e6 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
> #6  0x405330fe in raise () from /lib/arm-linux-gnueabihf/libc.so.6
> #7  0x40535956 in abort () from /lib/arm-linux-gnueabihf/libc.so.6
> #8  0x00277eaa in monoeg_log_default_handler (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, message=0x47bb28 "* Assertion at gc.c:867, condition `finalizer_thread_exited' not met\n", unused_data=0x0) at goutput.c:233
> #9  0x00277dca in monoeg_g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=0x3089b8 "* Assertion at %s:%d, condition `%s' not met\n", args=...) at goutput.c:113
> #10 0x00277e32 in monoeg_assertion_message (format=0x3089b8 "* Assertion at %s:%d, condition `%s' not met\n") at goutput.c:133
> #11 0x001ca786 in mono_gc_cleanup () at gc.c:867
> #12 0x001c1d24 in mono_runtime_cleanup (domain=0x37a348) at appdomain.c:356
> #13 0x0001dec0 in mini_cleanup (domain=0x37a348) at mini-runtime.c:3560
> #14 0x000a672c in mono_main (argc=5, argv=0x358098) at driver.c:2065
> #15 0x00017c4e in mono_main_with_options (argc=5, argv=0x358098) at main.c:20
> #16 0x00017c7e in main (argc=4, argv=0xbed591b4) at main.c:53

=================================================================
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.
=================================================================
2015-12-08 02:04:25 +00:00
João Matos 68fb0f566d Update Makefile.am with monobt script 2015-12-08 00:29:20 +00:00
Alexander Köplinger 47737e5599 [metadata] Use g_snprintf instead of snprintf to fix MSVC build
The latter only works with Visual Studio 2015 and later. We're still using VS2013 on Jenkins
2015-12-08 01:17:24 +01:00
Andi McClure ab991d242d Document HTTP_PROXY and NO_PROXY environment variables. 2015-12-07 17:20:39 -05:00
Vlad Brezae 44f4429237 Merge pull request #2246 from BrzVlad/feature-concurrent-evacuation
Feature evacuation with concurrent sgen
2015-12-07 17:09:17 -05:00
Vlad Brezae e314e59991 [sgen] Fix binary protocol scan process reference entries
The obj pointer can actually point inside the object for big arrays
2015-12-07 23:43:00 +02:00
Vlad Brezae 52857f832e [sgen] Binary protocol entry for mod union cardtable markings 2015-12-07 23:42:58 +02:00
Vlad Brezae e3e44c0a13 [sgen] Fix mod union cardtable marking race
When the nursery collector is starting and we have a concurrent collection in progress we need to save the global card table entries to the mod union card tables. When doing so we were marking all the mod union cards with either 0 or 1, so we could lose a mark if the concurrent collector tries to mark the same card at the same time, since the concurrent collector now runs concurrent even with nursery collections. We fix this by never marking with 0.
2015-12-07 23:39:53 +02:00
Vlad Brezae e2a6512834 [sgen] Remove pointless prototype 2015-12-07 23:39:53 +02:00
Vlad Brezae 28839a2c7c [sgen] Remove allow synchronous flag for concurrent collection
When concurrent, we always handle evacuating blocks, without the need of a synchronous major collection.
2015-12-07 23:39:50 +02:00
Vlad Brezae dfd1980f1b [sgen] Evacuation for the concurrent collector
The concurrent mark no longer follows references into blocks that are evacuated. The cardtable is marked instead and all the objects will be moved during the finishing pause.
2015-12-07 23:33:45 +02:00
Alexander Köplinger 361691c2a6 [msvc] Automatically update (win-)config.h with the correct version number
A small powershell command grabs the version number from configure.ac and uses it during winsetup.bat,
this way we don't have to manually keep them in sync.
2015-12-07 22:19:19 +01:00
Alexander Köplinger 53ad517b70 [msvc] Add 'include' directory to .gitignore
Copying of header files to this directory was introduced in 8c455550ab,
but we don't want to actually check it in.
2015-12-07 22:17:50 +01:00
Zoltan Varga 54a020da2d [aot] Fix the encoding/decoding of generic parameters after 835cc6eda9. 2015-12-07 16:15:24 -05:00
Andi McClure 6ae64e4022 Correctly escape proxy domains in WebRequest (bug #36356)
Our implementation for System.Net.WebRequest takes proxy exclusions
which are in fileglob (*.example.com) format, and passes them to
System.Net.WebProxy as a "bypass list", which expects Regex format.
This means immediate failure if you have an exclusion with a fileglob,
because WebProxy will throw an exception for bad Regex format.
2015-12-07 16:01:51 -05:00
Vlad Brezae 82ac52c75b [arm] Re-enable fast tls on all targets 2015-12-07 15:26:09 -05:00
Vlad Brezae 522b692bb1 [arm] Respect the ios abi on tls thunks 2015-12-07 15:26:06 -05:00
Marek Safar 669b6059fc [System] Fixes mobile build 2015-12-07 20:09:27 +01:00
Aleksey Kliger 5e3db4ff8d (test-conc-hashtable.c) Make test work with cooperative suspend.
By initializing `mono_therads_runtime_init()`
2015-12-07 13:39:20 -05:00
Joao Matos 4497e9265b Added the monobt LLDB plugin to the repository. 2015-12-07 18:20:43 +00:00
Alexander Köplinger 75c7aac448 Merge pull request #2294 from akoeplinger/fix-cygwin
[utils] Fix cygwin build
2015-12-07 19:11:57 +01:00
Zoltan Varga 835cc6eda9 Merge pull request #2237 from xmcclure/container-owner
Unambiguous ownership of generic param objects
2015-12-07 13:04:20 -05:00
Aleksey Kliger (λgeek) 1076f87892 Merge pull request #2247 from ivmai/match-ext-libgc-api
Match ext libgc api
2015-12-07 12:23:09 -05:00
Marek Safar d2325f1483 [System] Fixes leak in NtlmClient which never released cached WebRequest. Fixes #36596 2015-12-07 17:59:46 +01:00
Vlad Brezae 3943651f47 [arm] Fallback to aeabi_read_tp on linux fast tls
The previous implementation on linux arm used aeabi_read_tp to fetch the thread pointer. Use it to preserve compatibility.
2015-12-07 11:37:40 -05:00
Alexander Köplinger d0313abe8a [utils] Fix cygwin build
mono_os_sem_wait() used mono_os_sem_timedwait() before it was defined in mono-os-semaphore.h.
Moved the function to fix the cygwin build.

Also added a missing return statement in mono-os-mutex.h that was causing a lot of warnings.
2015-12-07 17:27:41 +01:00
Marek Safar f1c147af8f [mcs] Process flow analysis for interpolated string inserts. Fixes #36589 2015-12-07 15:17:26 +01:00
Marek Safar 8acf24a38c Bump reference sources 2015-12-07 09:21:41 +01:00
Rodrigo Kumpera 8088633392 Revert "Merge pull request #2237 from xmcclure/container-owner"
This reverts commit 761a84f867, reversing
changes made to d565a22e16.

Corlib compilation was broken with the PR in so I'm reverting it until it can be worked out.
2015-12-06 22:32:24 -05:00
Rodrigo Kumpera 2e34bdb4cb Revert "[reflection] Fix the build from the last commit."
This reverts commit f11e09ab4b.
2015-12-06 22:29:46 -05:00
Rodrigo Kumpera f11e09ab4b [reflection] Fix the build from the last commit. 2015-12-06 22:19:04 -05:00
Rodrigo Kumpera 761a84f867 Merge pull request #2237 from xmcclure/container-owner
Unambiguous ownership of generic param objects
2015-12-06 20:43:37 -05:00
Zoltan Varga d565a22e16 Merge pull request #2291 from akoeplinger/msvc-fixes
[msvc] Fix Windows build breaks caused by a595d489fa
2015-12-06 20:41:32 -05:00
Alexander Köplinger a51f7d90e5 [msvc] Fix Windows build breaks caused by a595d489fa
The .vcproj's and .def's weren't updated and there was a typo in mono-os-mutex.h that caused a build break.
2015-12-07 02:37:32 +01:00
Zoltan Varga 62c31ed116 Merge pull request #2290 from akoeplinger/msvc-mono-architecture
[msvc] Fix a few missing renames from ARCHITECTURE -> MONO_ARCHITECTURE
2015-12-06 20:11:03 -05:00
Alexander Köplinger 591174f1ae [msvc] Fix a few missing renames from ARCHITECTURE -> MONO_ARCHITECTURE
They were missed in 43403b8221.
2015-12-07 01:08:06 +01:00
Rodrigo Kumpera 574d397fdc Merge pull request #2276 from lambdageek/dev/bug-36283
[reflection] Fix Type.GetProperties() for generic class instances
2015-12-06 01:59:50 -05:00
Miguel de Icaza 2af882232c [System] Remove arbitrary debugging limit from FileSystemWatcher on OSX, fixes #28693 2015-12-05 15:09:06 -05:00
Sebastien Pouliot 4a6dec855f [corlib][tests] Disable tests that requires Windows (dllimport) on mobile profile
This enables building the tests w/bitcode enabled on AppleTV (and they
were already excluded from the results anyway).

Part of the fix for
https://bugzilla.xamarin.com/show_bug.cgi?id=36569
2015-12-05 11:19:36 -05:00
Rodrigo Kumpera 0c1916e584 Merge pull request #2289 from lewurm/arm-sgen-bridge
[tests] add timestamps to logging in bridge tests
2015-12-04 22:51:24 -05:00
Bernhard Urban aa8f4ab865 [tests] add timestamps to logging in bridge tests 2015-12-05 00:09:40 +00:00
Miguel de Icaza cace785a75 Merge pull request #2286 from migueldeicaza/master
[System.Runtime.Serialization] 36100 fix; Static serializer calls directly into internal APIs to fix C6 regression
2015-12-04 19:06:46 -05:00
Zoltan Varga e79740c92a [llvm] Add beginnings of support for gsharedvt. 2015-12-04 18:33:16 -05:00
Zoltan Varga 9ffb26eed7 [jit] Increase the buffer size used by the dyncall data structures to 512, add a test for #36566. 2015-12-04 17:44:56 -05:00
Marek Safar c7a05eb7f3 Bump reference source to .net 4.6.1 2015-12-04 17:26:49 -05:00
Marek Safar 81442f79f4 [System] interopservices from reference source 2015-12-04 17:26:49 -05:00
Marek Safar 4fea5b80b7 [System] System.Net.Cache from reference source 2015-12-04 17:26:49 -05:00
Vlad Brezae 45b649f1aa [arm] Debug print implementation if we don't recognize tls
Allows adding new implementations without the need of a testing device.
2015-12-04 16:20:39 -05:00
Vlad Brezae e2d3e1a2a5 [arm] Fast tls implementation for android marshmallow 2015-12-04 16:20:38 -05:00
Vlad Brezae 62682da5e1 [arm] Rework tls detection on android in order to be more strict
Unify the tls implementation across platform using a TlsImplementation structure which maps a potential pthread_getspecific implementation to the corresponding fastpaths. Some implementations might require an additional check of the kuser_get_tls kernel helper.
2015-12-04 16:20:37 -05:00
Vlad Brezae d42e7490e3 [arm] Fallback to pthread on android if we don't recognize the tls implementation 2015-12-04 16:20:35 -05:00
Alexander Köplinger 21e8b26731 [System.Runtime.Remoting] Disable a test that hangs on Linux for now
I talked with Ludovic about this and we're going to disable the test until we figure out what happens.
2015-12-04 15:43:21 -05:00
Zoltan Varga 6ca09a2af0 Merge pull request #2287 from lewurm/armseqpoints
[arm] add support for single-imm-size debug option
2015-12-04 15:22:15 -05:00
Bernhard Urban 6f393598ee [arm] add support for single-imm-size debug option 2015-12-04 14:24:06 -05:00
Miguel de Icaza ae8d66d6a9 [System.Runtime.Serialization] Static serializer calls directly into internal APIs to fix C6 regression
With C6 we introduced a regression
https://bugzilla.xamarin.com/show_bug.cgi?id=36100, which is caused by
the new static serialization code that we wrote to reuse Microsoft's
serializer.

The code uses Invoke on a series of MethodInfos, and this obscures the
actual code that will be invoked at runtime to serialize certain
objects, causing the following exception:

Attempting to JIT compile method '(wrapper runtime-invoke) <Module>:runtime_invoke_bool_Nullable`1<Decimal> (object,intptr,intptr,intptr)' while running with --aot-only.

This patch makes the simple code work, but a more thorough review of
the code would allow us to remove many of the slow dynamic codepaths
in the serializer.

We opted for that approach to keep the code as similar as possible to the
original.

But the code basically does this:

* Use the XmlFormatGeneratorStatics property InternalSerializeMethod,
  whose sole purpose is to delay computing the MethodInfo for the
  XmlFormatWriterGenerator's InternalSerialize.

* Use the resulting method in a few places to call the MethodInfo.

The MethodInfo was used because the original code uses Reflection.Emit
to create fast serializers and it needs handles to internal methods,
but our static rewriter does not need it.

We should replace all of those uses, but for now, this patch at least
deals with the 36100 bug.
2015-12-04 13:54:48 -05:00
Zoltan Varga 8bc9896c55 [jit] Use mini_get_underlying_type () in the tracing code to handle more types. 2015-12-04 13:07:29 -05:00
Alexander Köplinger 38aa91b1af [test] Bump test timeout again
Discussed this with @lambdageek, we still see some of the tests timeout on Jenkins on the slow armhf/armel workers.
Let's see if bumping the timeouts helps.
2015-12-03 18:16:13 -05:00
Joao Matos 93307fc291 [System] Fixed mobile build regression after 43b65b6775. 2015-12-03 14:46:39 -05:00
Zoltan Varga a0e881630c [jit] Enable partial sharing by default. 2015-12-03 13:52:02 -05:00
Zoltan Varga 0264a6c566 [jit] Fix a verification error when using partial sharing. 2015-12-03 13:51:42 -05:00
Miguel de Icaza f5849edcda Update code_of_conduct.md 2015-12-03 12:51:07 -05:00
Miguel de Icaza 50acb4dd75 Add code of conduct 2015-12-03 12:48:33 -05:00
Zoltan Varga 16cd8a3832 Revert "[jit] Enable partial sharing for the JIT too."
This reverts commit 8bf2946478.

Revert this as it breaks the test.
2015-12-03 11:30:38 -05:00
Zoltan Varga c91930b08d Revert "[jit] Remove the partial sharing enabling code, its always enabled now."
This reverts commit a8cdc818c8.

Revert this as it breaks tests.
2015-12-03 11:30:15 -05:00
Rodrigo Kumpera c2ac08b8ad Merge pull request #2260 from xmcclure/fix-testwaitany
Cleanup and crash fix around UnixSignal.WaitAny (bug #36214)
2015-12-03 10:36:10 -05:00
Marek Safar 43b65b6775 [System] Uri component values from reference source 2015-12-03 10:33:57 -05:00
Andrés G. Aragoneses cfc5011ced [FileSystemWatcher] Kill race condition (fixes BXC#10205)
As seen in the stacktraces provided in [1],
a thread could modify the Files hashtable
while other thread is enumerating it, so this
can be prevented by using a lock{} in the parts
of the code that access and modify this field.

Patch licensed as MIT/X11.

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=10205
2015-12-03 13:35:54 +08:00
Zoltan Varga 99e6331453 Bump referencesource to 0632b0f497253bb43a217247ee99c953b00979fd. 2015-12-02 22:00:45 -05:00
Zoltan Varga 6c105a9610 [aot] Fix the emission of EnumComparer instances, some types use different comparers. 2015-12-02 22:00:30 -05:00
Zoltan Varga 9df6cb7197 [runtime] Mark an AOT tests as GSHAREDVT. 2015-12-02 21:56:14 -05:00
Zoltan Varga 0926c26a03 [ppdb] Fix support for loading debug info for .dll files. 2015-12-02 19:32:10 -05:00
Marek Safar 9ba1f60233 Merge pull request #2284 from akoeplinger/httpclient-fix
[System.Net.Http] Replace google.com with example.org in a test
2015-12-02 19:22:55 -05:00
Alexander Köplinger 744479fb3e [System.Net.Http] Replace google.com with example.org in a test
It sometimes fails on Jenkins and google might be doing unwanted things (like redirecting to https),
so we just use example.org instead which hopefully is more stable in that regard.
2015-12-02 18:20:58 -05:00
Zoltan Varga a8cdc818c8 [jit] Remove the partial sharing enabling code, its always enabled now. 2015-12-02 18:20:00 -05:00
Aleksey Kliger 157c2dec16 reflection: Type.GetProperties() collect more generic properties (Closes #36283)
When collecting candidate properties, look at the generic definition
when throwing away duplicates (hide-by-name-and-signature for properties
should look at generic definition) because inflating method could
conflate distinct signatures to the same one:
  class Foo<T,U> {
    public T this[T t] { get { return t; } }
    public U this[U u] { get { return u; } }
  }

The class Foo<int,int> has 2 indexers, not 1.  They just happen to have
the same signature because T and U both got replaced by int.
2015-12-02 18:14:39 -05:00
Aleksey Kliger 6e676d8a9b Failing test case for 36283 2015-12-02 18:14:38 -05:00
Zoltan Varga 8bf2946478 [jit] Enable partial sharing for the JIT too. 2015-12-02 17:59:45 -05:00
Zoltan Varga 8af156d3bd [runtime] Get rid of the unused MONO_ARCH_HAVE_LLVM_IMT_TRAMPOLINE define. 2015-12-02 17:43:38 -05:00
Zoltan Varga 15b01a0245 [runtime] Get rid of LLVM_IMT_TRAMPOLINE, its no longer used. 2015-12-02 17:41:31 -05:00
Andi McClure 96b523de70 Merge pull request #2279 from xmcclure/mono-posix-version
Fail cleanly when MonoPosixHelper.dll version is wrong (bug #35655)
2015-12-02 17:17:38 -05:00
Miguel de Icaza 4e40137213 Merge pull request #2282 from joelmartinez/docs-multiassembly-fix
[mdoc] Improved error handling for multiassembly.
2015-12-02 17:04:32 -05:00
Marek Safar cc5c9a49ca Merge pull request #2281 from lambdageek/dev/bug-36418
Make Type.GetProperty() work for indexers returning primitive types
2015-12-02 16:47:19 -05:00
Aleksey Kliger 35d4f66d7b Make System.DefaultBinder.CanConvertPrimitive reflexive (Closes #36418) 2015-12-02 16:38:58 -05:00
Aleksey Kliger d3972762a2 Test case for #36418 2015-12-02 16:38:57 -05:00
Joel Martinez 3e6ffdf99f [mdoc] Improved error handling for multiassembly.
While there were tests included for the [multiassembly option](https://github.com/mono/mono/pull/2127), unfortunately
the tests did not consider starting from an existing repository. So this patch
rectifies the issue by improving a small function to consider the possibility
of a null result. Test that reproduced, and subsequently proves the resolution
is included here.
2015-12-02 16:23:14 -05:00
Rodrigo Kumpera a595d489fa Merge pull request #2231 from ludovic-henry/coop-sync-friendliness
[coop] Synchronization primitive friendliness
2015-12-02 15:54:17 -05:00
Andi McClure bca3964c8b Cleanup in signal.c and related tests
Add comments, add assert for edge case around signal registration, and
make consistent *always* using atomic get/set for memory shared
between the signal handler and the threads.
2015-12-02 14:58:55 -05:00
Zoltan Varga a0adf5e4df [jit] Initialize gsharing counters in mono_generic_sharing_init () to prevent initialization races. Fixes #36443. 2015-12-02 13:21:07 -05:00
Alexander Köplinger 2d8abdda49 [System.ServiceModel] Fix Bug32886 test to work on cultures with a different decimal separator 2015-12-02 12:13:46 -05:00
Zoltan Varga 43403b8221 [runtime] Rename the 'ARCHITECTURE' define to 'MONO_ARCHITECTURE' to avoid a symbol clash with an llvm enumeration value. 2015-12-01 23:51:38 -05:00
Zoltan Varga 53c7deb62d [runtime] Add a test for MONO_ENV_OPTIONS. 2015-12-01 23:47:23 -05:00
Alexander Köplinger a7500b8f2d Merge pull request #2278 from akoeplinger/remove-net-45-csproj
[csproj] Remove *net_4_5.csproj files from the class libs
2015-12-01 22:35:16 -05:00
Zoltan Varga 55b1f58716 [jit] Add a testcase for #36280. 2015-12-01 22:15:40 -05:00
Zoltan Varga 906997b481 [jit] Avoid a verification error in gsharedvt code with ldarga + gshared types. Fixes #36292. 2015-12-01 22:12:50 -05:00
Zoltan Varga 9d6a8f62fc [llvm] Zero extend array indexes when targeting llvm, this seems to work around a codegen problem on arm64. Fixes #36263. 2015-12-01 18:51:21 -05:00
Andi McClure 249ee0686b Fail cleanly when MonoPosixHelper.dll version is wrong (bug #35655)
Add version keys to the C and C# versions of Mono.Posix and add static
constructors which fail early if the version keys differ.
2015-12-01 18:03:21 -05:00
João Matos de47498f5a Merge pull request #2223 from lobrien/master
Changed link from GUID to URL
2015-12-01 17:46:44 -05:00
Zoltan Varga 6c5326ab48 [aot] Cache inflated methods loaded from aot images to avoid repeating an expensive search. Fixes #36256. 2015-12-01 16:30:46 -05:00
Alexander Köplinger b4a9c31f19 [csproj] Small fixes to the genproj readme 2015-12-01 22:19:48 +01:00
Alexander Köplinger 173add3aee [csproj] Update order.xml and csproj files 2015-12-01 22:19:36 +01:00
Alexander Köplinger 9d24fb1564 [csproj] Remove *net_4_5.csproj files from the class libs
We only use the net_4_x profile now so those csproj's don't make sense anymore.
2015-12-01 22:19:36 +01:00
Zoltan Varga 720723ea9d Fix a warning. 2015-12-01 16:16:22 -05:00
Zoltan Varga 6fdbc2f308 [aot] Add instances of EnumEqualityCompater<T> for all integer types. Fixes #36370. 2015-12-01 16:05:38 -05:00
Alexander Köplinger 2ad5aaf618 Merge pull request #2277 from lewurm/xmldoc
[docs] fix case in Makefile
2015-12-01 15:56:58 -05:00
Marek Safar 0d019500ce [mcs] Remove parenthesized null operator special case. Fixes #36425 2015-12-01 15:35:23 -05:00
Bernhard Urban 4130fda974 [docs] fix case in Makefile 2015-12-01 15:14:20 -05:00
João Matos 00cb1f9655 Merge pull request #2275 from lewurm/httputilityfix
[System.Net] use WebUtility instead of HttpUtility
2015-12-01 13:35:26 -05:00
Bernhard Urban d5fe53c943 [System.Net] use WebUtility instead of HttpUtility 2015-12-01 13:28:45 -05:00
Zoltan Varga a7a0f54d3a [aot] Add instances of EnumEqualityComparer which is used by EqualityComparer to compare int/uint based enums. Fixes #36370. 2015-12-01 12:41:57 -05:00
Zoltan Varga 3d24eb5a43 [gsharedvt] Fix support for constrained calls on interfaces. Fixes #36383. 2015-12-01 12:12:38 -05:00
Marek Safar 5f2cae6e66 [mcs] Better fix for commit 1bcab9bcd7 2015-12-01 12:11:35 -05:00
Alexander Köplinger dd5fb3546a [System] Add test case for bug #2231
Provided by Tom Hindle in https://bugzilla.xamarin.com/show_bug.cgi?id=2033#c5
2015-12-01 16:43:57 +01:00
Marcos Henrich aeaf37296f [System] Fixes UdpClient.Receive with IPv6 endpoint
Fixes #6057

Partially reverts 838b6c5e41
2015-12-01 10:35:35 -05:00
Marcos Henrich 5ceaed8e43 [System] Tests UdpClient.Receive with IPv6 endpoint
Covers #6057
2015-12-01 10:32:52 -05:00
João Matos cafd968e0c Merge pull request #2256 from joelmartinez/docs-morenetdocs
[docs] Added more libraries to `netdocs`
2015-12-01 10:29:12 -05:00
João Matos 3ec7b46f9f Merge pull request #2258 from protel-opensource/protelmaster
Fix error handling for case of invalid host name
2015-12-01 10:28:40 -05:00
João Matos 40d516ff7b Merge pull request #2269 from dellis1972/xmlpeek
[msbuild] Added XmlPeek
2015-12-01 10:27:11 -05:00
João Matos a26d35379e Merge pull request #2265 from directhex/pthread_tls_on_mips
Force with_tls=pthreads on MIPS, which lacks proper __threads implementation
2015-12-01 10:26:37 -05:00
Marek Safar 09890e2d91 Merge pull request #2272 from alex-skiffin/master
[NetworkInterface] IPv4Mask property implementation for Linux
2015-12-01 08:43:20 -05:00
alex-skiffin 1ebbfe8740 [NetworkInterface] Implement IPv4Mask property on Linux.
This change is released under the MIT license.
2015-12-01 09:37:40 +05:00
Marek Safar 1bcab9bcd7 [mcs] Tidy up better function betterness for methods with default parameters and unused params. Fixes #36384 2015-11-30 17:48:19 -05:00
Sebastien Pouliot f48d6486a1 Bump external/referencesource to get mobile fixes 2015-11-30 16:58:15 -05:00
João Matos f5e7b1dbe7 Merge pull request #2271 from BrzVlad/fix-sizeof-monoarray
[runtime] Fix sizeof MonoArray with non gnu compiler
2015-11-30 14:21:48 -05:00
Zoltan Varga fc7cd69b25 [sdb] Fix ppdb support by adding a variant of mono_debug_symfile_lookup_location () which works with ppdb too. Fixes #36339. 2015-11-30 14:01:02 -05:00
Andi McClure 1251a594c9 Convert MonoGenericContainer/Param accessor macros to inline functions 2015-11-30 13:39:27 -05:00
Zoltan Varga 2a35f71d5e [jit] Disable the gsharedvt version of Array.UnsafeMov. 2015-11-30 12:43:56 -05:00
Zoltan Varga 1c90513ad9 [llvm] Remove unused includes from mini-llvm-cpp.cpp. 2015-11-28 23:03:57 -05:00
Zoltan Varga 5b74196809 [llvm] Move the JIT related code to a separate llvm-jit.cpp file. 2015-11-28 22:40:06 -05:00
Zoltan Varga fcfbfe577b [llvm] Fix the passing of the this argument which got broken by 7336f89c6e. 2015-11-28 22:37:00 -05:00
Zoltan Varga 7e4eb02620 [runtime] Fix support for MONO_ENV_OPTIONS which got broken by 8593c4dddc. 2015-11-28 22:35:45 -05:00
Zoltan Varga 78ae03e7aa [jit] Fix the verbosity of the 'LLVM failed for' messages. 2015-11-28 14:55:33 -05:00
Zoltan Varga 2e7bee9137 [ppdb] Fix reading of locals/scopes for the last method in the scope table. Fixes #36257. 2015-11-28 14:53:04 -05:00
Sebastien Pouliot 333440ddf0 [System.Data] Remove unneeded files that includes win32 specific p/invokes in the mobile profile 2015-11-27 16:25:46 -05:00
Zoltan Varga 8269971fd1 Fix a warning. 2015-11-27 11:08:38 -05:00
Sebastien Pouliot d70efaeedc [System.Xml] Do not build MS RS Win8Helpers.cs file (which includes win32-specific pinvokes) as it is unneeded for building the mobile profile 2015-11-27 08:51:25 -05:00
Marek Safar 7dcdeac71b [mcs] Add new test 2015-11-27 12:15:09 +01:00
Marek Safar 9c1c5c0986 [mcs] Fix codegen for nested binary bitwise operators. 2015-11-27 12:11:54 +01:00
Rolf Bjarne Kvinge a9ca27bcaa [mscorlib][System] Use PlatformNotSupportedException instead of NotSupportedException when it makes sense. 2015-11-27 09:49:23 +01:00
Sebastien Pouliot 1b6f93898e [System][ios] Disable non-working Ping code (and non-existing DllImport)
* capget is not part of libc (libSystem.dylib) on iOS (or OSX); and
* There's no working Process class to invoke `ping` by itself leading to

[FAIL] DllImportTest.LackOfCapget : System.InvalidOperationException : Process has not been started.
 		  at System.Diagnostics.Process.get_HasExited () [0x00039] in /Users/poupou/git/xamarin/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Diagnostics/Process.cs:184

It's technically possible to implement ping on iOS [1] so the code is
not totally removed from the build (API remains identical to existing).

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=964
2015-11-26 14:55:00 -05:00
Marek Safar dea711605e [mcs] Fixes codegen for lifted bitwise operators which are liften only due to null operand 2015-11-26 20:07:03 +01:00
Sebastien Pouliot 1157071aad [Mono.Data.Sqlite] Remove p/invokes to symbols that are not available on iOS version of libsqlite3
/usr/lib/libsqlite3.dylib: 77 symbols
	[NOT FOUND] sqlite3_column_database_name
	[NOT FOUND] sqlite3_column_database_name16
	[NOT FOUND] sqlite3_column_origin_name
	[NOT FOUND] sqlite3_column_origin_name16
	[NOT FOUND] sqlite3_column_table_name
	[NOT FOUND] sqlite3_column_table_name16
	[NOT FOUND] sqlite3_key
	[NOT FOUND] sqlite3_rekey

note: XI has unit tests that will detect if those symbols are added in a
future version of iOS.
2015-11-26 11:45:04 -05:00
Sebastien Pouliot 4be48fef27 [mscorlib] Do not include several win32-p/invoke calls (AccessControl) for the mobile profile 2015-11-26 11:37:03 -05:00
Sebastien Pouliot 5bd701308e [mscorlib] Do not include a win32-p/invoke call (GetFullPathName) for the mobile profile 2015-11-26 11:34:41 -05:00
Vlad Brezae a14a49e8cf [runtime] Fix sizeof MonoArray with non gnu compiler
We would have the problem that array->vector != array + sizeof
(MonoArray), which would waste space and also lead to problems in
accessing the array elements.
2015-11-26 04:19:27 -08:00
Dean Ellis 86522f62f0 [msbuild] Added XmlPeek
XmlPeek was missing from Mono. Adding it based on the
open source msbuild implementation with a few minor
changes because of missing support classes.
2015-11-26 11:29:30 +00:00
Marek Safar f958af36b0 [mcs] Fix null coalescing operator on cast of source expression resolved to implicit user operator conversion. Fixes #36161 2015-11-26 11:38:38 +01:00
Zoltan Varga 8327116c33 Revert "[aot] Cache inflated methods loaded from aot images to avoid repeating an expensive search. Fixes #36256."
This reverts commit d4828b42f0.

Revert this as it causes test failures.
2015-11-25 22:05:02 -05:00
Zoltan Varga f585ab8f46 [jit] Comment out a call to mono_debug_count (), it should only be enabled during debugging. 2015-11-25 22:05:02 -05:00
Martin Baulig c7ee4160d2 [Mono.Security]: Actually rename MonoSslStream.cs into IMonoSslStream.cs.
(cherry picked from commit 6609e27194)
2015-11-25 18:46:50 -05:00
Andi McClure ee43692e03 Minor cleanup inspired by but unrelated to generic param refactor
Comments, variable initialization, formatting. No functional changes.
2015-11-25 17:40:10 -05:00
Andi McClure 4a3498d994 Clarify ownership of generic param objects
This patch fixes rule violations found by the first batch of
mempool-reference audit points. The fix is to remove ambiguities in
what image owns or should own any particular generic parameter object.
Previously, there were four options for specifying a
MonoGenericParam’s image:

 1. klass/method union in MonoGenericContainer.
 2. image field in MonoGenericContainer.
 3. image field in MonoGenericParam.
 4. No field; “image” passed in to methods in at time of usage.

This patch removes 3 and 4; it preserves the image field from (2), but
merges it into the union from (1). It adds a new field,
“is_anonymous”, to indicate when the image member of the union should
be used. The single source of the “owner" union now always points to
the generic param’s image, directly or indirectly.

A further change is made to support this: Previously, containers were
optional, and the presence or absence of container was incidentally
used to determine whether an object was a MonoGenericParam or a
MonoGenericParamFull. Now, containers are mandatory for all
MonoGenericParams, so a new “is_small_size” bit in the container
tracks this information.

This change opens some sources of risk:

 ⁃ Code which creates MonoGenericParams now must make sure to
allocate a container early.
 ⁃ Code that accesses the MonoGenericContainer::owner field
must all be correctly updated to look for is_anonymous or there will
be a crash. (Much of this code would have previously used a NULL
container as the flag for “anonymous”).
 ⁃ Code that casts MonoGenericParams to MonoGenericParamFull
must use the is_small_size field.
 ⁃ Some generic containers will now exist with NULL type_params
and 0 type_argc. Code which reads the type param array must either not
receive objects from these containers, or must handle it.
 ⁃ If code by users of the embedding API exists which somehow
depends on particular behavior related to the now-unused image
argument of mono_class_from_generic_parameter, it will break.

I have audited code around, at least, the first three of these cases
and fixed what problems I found.
2015-11-25 17:38:03 -05:00
Zoltan Varga d4828b42f0 [aot] Cache inflated methods loaded from aot images to avoid repeating an expensive search. Fixes #36256. 2015-11-25 17:33:02 -05:00
Andi McClure 152d6d0561 Add first batch of mempool-reference audit points to class.c 2015-11-25 17:23:15 -05:00
Andi McClure 5a486ac1d7 Improvements to mempool reference auditing feature
- New audit-point macro for atomic writes
- Check imageset list directly (instead of indirectly through image
  list)
- Check dynamic images and have special rules for them (for the time
  being we will allow dynamic images to point to non-dynamic ones
  without auditing, long-term this is a FIXME)
- Print image names out with more detail (image sets get full names)
- Remove some #if CHECKED_BUILDs
- New g_assert_checked asserts for checked builds only
2015-11-25 17:07:59 -05:00
Martin Baulig 2b82ffe426 [Mono.Security]: Rename 'Mono.Security.Interface.MonoSslStream' into 'IMonoSslStream' and make it an interface.
(cherry picked from commit aa2166908a)
2015-11-25 16:34:58 -05:00
Martin Baulig 41545ee28f [Mono.Security]: Add a few more 'Mono.Security.Interface' APIs.
The following general-purpose enums and exception helpers were moved
here from Mono.Security.NewTls.Interface, which is going away.

* Alert, CipherAlgorithmType, CipherSuiteCode, ExchangeAlgorithmType,
  HashAlgorithmType, TlsConnectionInfo, TlsException, TlsProtocolCode,
  TlsProtocols.

* TlsConnectionInfo has been merged into MonoTlsConnectionInfo.

Note that you may not use 'using' statements for both 'Mono.Security.Interface'
and 'System.Security.Authentication' due to conflicting types.  Use a prefix such as
"using MSI = Mono.Security.Interface;" or "using SSA = System.Security.Authentication;"
if you need both namespaces.

(cherry picked from commit af05134433)
2015-11-25 16:34:43 -05:00
Martin Baulig 23f9e7c037 [System]: Make $(the_libdir_base)Mono.Security.dll depend on ../Mono.Security/Makefile.
(cherry picked from commit 77477b0e2b)
2015-11-25 16:31:11 -05:00
Marek Safar 1e1e2592ae [System.Data] Implement CommandBehavior.SequentialAccess support for GetValues method. Fixes #35857 2015-11-25 19:06:13 +01:00
Zoltan Varga e901ed6c27 [aot] Escape some characters in method names to avoid assembler problems with obfuscated assemblies. Fixes #36247. 2015-11-25 12:31:40 -05:00
Jo Shields 2b26da4737 Force with_tls=pthreads on MIPS, which lacks proper __threads implementation 2015-11-25 17:15:58 +00:00
Rolf Bjarne Kvinge 463c9d3392 [System.Data] Try to fix random DataViewTest.DefaultColumnNameAddListChangedTest failure.
It looks like the GC might be involved somehow in these random
failures, so make sure objects aren't freed too early.
2015-11-25 17:59:06 +01:00
Rolf Bjarne Kvinge 3c9209bb42 [System] Fix SmtpClientTest.Deliver_Async to not require main thread processing. 2015-11-25 14:04:34 +01:00
Rolf Bjarne Kvinge 828d7d782b [System] Remove Process.Start and related API from TvOS/WatchOS. 2015-11-25 12:55:58 +01:00
Rolf Bjarne Kvinge 50791d90f4 [corlib] Re-introduce Thread.Abort/Suspend/Resume, but make them throw NotSupportedException instead.
Re-introduce Thread.Abort/Suspend/Resume so that we don't have to
create separate PCL profiles.

Instead make them throw a NotSupportedException, and add an
[Obsolete (error: true)] attribute so that these methods can't
be used from source.
2015-11-25 12:55:13 +01:00
Rolf Bjarne Kvinge bb50c3f3c9 [System] Tweak tests to work with Thread.Interrupt as well. 2015-11-25 12:54:44 +01:00
Rolf Bjarne Kvinge b5d5920a4a [System] Don't throw SocketExceptions when we're stopping. 2015-11-25 12:54:44 +01:00
Zoltan Varga fe199df729 [aot] Handle gsharedvt versions of delegate invoke wrappers correctly, there could be multiple copies of them for the same class. Fixes #36125. 2015-11-24 18:42:57 -05:00
Marek Safar d7f86d6c23 Merge pull request #2263 from akoeplinger/net_4_6.xml
[xbuild] Add net_4.6.xml/net_4.6.1.xml and wire through xbuild
2015-11-24 22:48:09 +01:00
Martin Baulig b48cd9b3c1 [Mono.Security]: Minor 'Mono.Security.Interface' API improvements.
* MonoTlsSettings: Add static 'DefaultSettings' and CopyDefaultSettings().

* MonoTlsProvider: Add 'ID' and 'Name' properties.

(cherry picked from commit 51226c86f9)
2015-11-24 15:15:28 -05:00
Andi McClure d94ba5bb30 Spinlock to prevent SIGPIPE in signal.c (bug #36214)
There is a race condition in signal.c where a signal-waiting thread
can close the pipe and then the signal handler can try to write to it.
Introduce a locking mechanism to prevent this. Separate mph_int_set
and mph_int_test_and_set to support the lock code.
2015-11-24 14:48:36 -05:00
Martin Baulig 093b32e2df [System]: Allow null 'settings' argument in ChainValidationHelper.
(cherry picked from commit 9d6b03a587)
2015-11-24 14:24:23 -05:00
Jonathan Pryor bc3822e7fb Merge pull request #2264 from xmcclure/fix-testwaitany-mini
Minimal fix for sporadic Mono.Unix.UnixSignalTest.TestWaitAny crashes (bug #35936)
2015-11-24 14:03:20 -05:00
Andi McClure 61d6cac99c Don't fsync() on a pipe (causes bug #35936)
fsync() on a file descriptor from a pipe() is invalid, and
occasionally crashes on current OS X.
2015-11-24 13:46:19 -05:00
Ludovic Henry 46667577d0 [coop] Remove MONO_TRY_BLOCKING
Switching to blocking should only be done when actually blocking (ex: mutex
lock, sem wait, cond wait, blocking syscalls), and not around a whole
section. This means that blocking can only be a leaf state, and we
should not switch from blocking to blocking mode again.
2015-11-24 13:24:40 -05:00
Ludovic Henry b92d16e0da [coop] Switch loader_mutex to coop implementation 2015-11-24 13:24:40 -05:00
Ludovic Henry 7d72280d8e [coop] Switch MonoDomain->lock to coop implementation 2015-11-24 13:24:39 -05:00
Ludovic Henry 6c36ef761a [coop] Switch threads_mutex locks to coop implementation 2015-11-24 13:24:39 -05:00
Ludovic Henry 61515ad07e [coop] Make lock tracer os and coop mutex aware 2015-11-24 13:24:38 -05:00
Ludovic Henry eaff8b6d82 [gc] Remove dead lock 2015-11-24 13:24:38 -05:00
Ludovic Henry 4aa9d7f84d [coop] Switch file mmap locks to coop implementation 2015-11-24 13:24:37 -05:00
Ludovic Henry f07b0c9415 [io-layer] Switch cond timed wait to use milliseconds 2015-11-24 13:24:37 -05:00
Ludovic Henry 9ec0fc5f5a [coop] Switch finalizer locks to coop implementation 2015-11-24 13:24:36 -05:00
Ludovic Henry eb34dde267 [coop] Switch global_suspend_semaphore to coop implementation 2015-11-24 13:24:35 -05:00
Ludovic Henry 2881a02e4a [coop] Switch Posix and Win32 threads locks to coop implementation 2015-11-24 13:24:35 -05:00
Ludovic Henry 39b86a7f9c [coop] Switch debugger agent locks to coop implementation 2015-11-24 13:24:34 -05:00
Alexander Köplinger 92d00136b1 [xbuild] Add net_4.6.xml/net_4.6.1.xml and wire through xbuild
Commented the entries in ToolLocationHelper, they could be misunderstood since the 4.0/4.5/4.6 entries are all the same.
2015-11-24 17:58:58 +01:00
Alexander Köplinger 2b1d785ca4 [System.ComponentModel.DataAnnotations] Update tests to match the new strings from 21a3421f4c 2015-11-24 17:54:47 +01:00
Sebastien Pouliot b14d33150a [system][monodroid] Remove reference to Win32NetworkInterfaceAPI (as the type was removed from the profile earlier) 2015-11-24 09:38:07 -05:00
Sebastien Pouliot 2f717098f2 [system.net.http] Make HttpClient a partial class and skip default .ctor when building for iOS 2015-11-24 09:38:07 -05:00
Alexander Köplinger 21a3421f4c Merge pull request #2208 from martinbooth/dataannotation_strings_from_corefx_without_resx
[System.ComponentModel.DataAnnotations] Replaced data annotation error messages with values extracted from corefx resource file
2015-11-24 15:26:39 +01:00
Alexander Köplinger 3fceb6d87d Merge pull request #2248 from barsgroup/bugfix/35980
CSharpCodeCompiler should treat multi-line warning messages as warnings
2015-11-24 15:16:03 +01:00
Dmitry Kalyanov 0a5ff97371 CSharpCodeCompiler should not treat multi-line warnings from mcs as internal compiler errors.
Most errors and warnings from c# compiler are reported in one line in format "FILE(LINE, COL): warning CS1234: Text".
But some warning span multiple lines:

  /tmp/3fb23cc0/634d2022.0.cs(22,29): warning CS0114: `NS.B.F()' hides inherited member `NS.A.F()' ..
  /tmp/3fb23cc0/634d2022.0.cs(16,29): (Location of the symbol related to previous warning)

Previously the second line was considered to be an internal compiler error since it doesn't match the error regex.

This seems to be only type of messages that span multiple lines.

This fixes #35980
2015-11-24 13:02:44 +03:00
Zoltan Varga ad12e8716d [llvm] Fix the mapping of byref types. 2015-11-23 21:18:44 -05:00
Jonathan Pryor 4861bca897 Merge pull request #2259 from xmcclure/modet-pointer
Fix unsafe pointer conversion in sys-stat.c
2015-11-23 15:31:02 -05:00
Andi McClure f4744df2fd Fix sys-stat.c where a pointer to a mode_t (potentially an int16) was being unsafely converted to an int32 pointer 2015-11-23 14:33:44 -05:00
Andi McClure 71679ae8e4 Improve nunit error reporting in case of a test returning a null results object in the absence of an exception. 2015-11-23 14:27:18 -05:00
Jan Thonemann 49158fec2d Fix error handling for case of invalid host name
If a attacker injects invalid content into the "host" header field like
"><script>alert(123)</script>
this content is now html encoded.
This prevents XSS attacks.
2015-11-23 13:01:57 +01:00
Zoltan Varga a425ee9491 [runtime] Fix non-byref LPArray marshalling. Fixes #36128. 2015-11-22 09:04:21 -05:00
Alexander Köplinger f82f4e84b1 Merge pull request #2255 from directhex/override-mono-wrapper
Allow mono-wrapper executable to be overridden by environment
2015-11-22 15:01:04 +01:00
Zoltan Varga d3d896f474 [ji] Add a mini-llvm.h header file for the functions implemented by the LLVM backend. 2015-11-21 10:13:52 -05:00
Zoltan Varga 84f6564eef [runtime] Implement FIXMEs in the portable ppdb code. 2015-11-21 09:30:45 -05:00
Zoltan Varga ccacd58248 [runtime] Fix the loading of ppdb files. 2015-11-21 08:32:24 -05:00
Zoltan Varga 29b72e8329 [aot] Fix support for runtime invokes to array accessors of reference arrays. Fixes #35855. 2015-11-21 06:53:57 -05:00
Marek Safar f722da253f [system] Bump uri limit to match .net. Fixes #36095 2015-11-21 10:48:46 +01:00
Alexis Christoforides fb0e534319 [mkbundle] Improved support for Windows 2015-11-20 21:42:10 -05:00
Sebastien Pouliot 444efa3329 [System.Data] Remove some win32-specific p/invokes for the mobile profile
This reduce the size of System.dll and also removes some Win32 specific
p/invokes.

They cause native linking issues for tvOS as Xcode 7.1 does not allow
`-u` in bitcode-enabled builds so we have to call directly the symbols
and it must exists at (native) link time.

**Incomplete** (some remains) but enough so we can run LinkSDK and
System.Data unit tests apps (the managed linker can remove the rest)
2015-11-20 21:33:49 -05:00
Miguel de Icaza 4cdc90bc56 [mdoc] Add some diagnostics 2015-11-20 20:32:02 -05:00
Marek Safar 48d0231d5f [corlib] Bump reference source for .net 4.6 hotfix. Fixes #36003 2015-11-21 00:20:02 +01:00
Zoltan Varga e194fe208c [runtime] Use the standard __MOBILE__ define instead of MOBILE for the mini tests. 2015-11-20 17:49:02 -05:00
Joel Martinez f2e79e5d17 [docs] Added more libraries to netdocs.
In response to various customer queries, wondering why various libraries could not be found in our documentation. The libraries being added to the  doc set are:

- System.Json
- System.Net.Http
- System.Runtime.Serialization
- System.ServiceModel
- System.XML.Linq
2015-11-20 13:36:24 -05:00
Sebastien Pouliot 9ea2f50a2a [System] Remove internal Win32* classes from mobile builds
This reduce the size of System.dll and also removes some Win32 specific
p/invokes.

They cause native linking issues for tvOS as Xcode 7.1 does not allow
`-u` in bitcode-enabled builds so we have to call directly the symbols
and it must exists at (native) link time.
2015-11-20 11:57:48 -05:00
Sebastien Pouliot 9879831588 [System.ServiceModel.Internals] Do not include win32 p/invokes in mobile builds
This cause native linking issues for tvOS as Xcode 7.1 does not allow
`-u` in bitcode-enabled builds so we have to call directly the symbols
and it must exists at (native) link time.
2015-11-20 10:07:37 -05:00
Rolf Bjarne Kvinge 384332ad5a [runtime] Revert breaking changes in MonoGHashGCType.
Xamarin.iOS and Xamarin.Mac uses this enum, and changing the values
causes us to break.

For Xamarin.Mac apps that do not bundle their mono, this would break
when the user updated their system mono.
2015-11-20 15:16:38 +01:00
Rolf Bjarne Kvinge 2ade2231b4 [System.Drawing] Add ifdefs to source code used by Xamarin.iOS/Mac to make it compile there. 2015-11-20 12:58:10 +01:00
Zoltan Varga d9172de543 [aot] Add instances of LongEnumEqualityComparer which is used by EqualityComparer to compare long/ulong based enums. 2015-11-20 06:16:00 -05:00
Jo Shields d133efa6c5 Allow mono-wrapper executable to be overridden by environment
This makes it easier to force Cygwin-brokered test suite runs to use MSVC builds of Mono, i.e. by overriding MONO_EXECUTABLE to .../msvc/bin/Win32/mono-sgen.exe
2015-11-20 11:04:10 +00:00
Marek Safar e84f23e484 Merge pull request #2254 from Sebmaster/fix-datasourceview
Fix NullReferenceException when reader fails in SqlDataSourceView
2015-11-20 10:42:16 +01:00
Zoltan Varga 8cff5151cb [corlib] Disable an attribute test which fails on mobile because of linking. 2015-11-20 02:29:45 -05:00
Alexander Köplinger a8ef200b11 [msvc] Remove outdated projects and configs to fix x64 build
Some of the profiler projects are no longer needed since the corresponding pieces were removed.

Update sln to only build required projects by default and update configurations in projects.

Fixes the Win64 build on Jenkins.
2015-11-20 02:20:28 +01:00
Sebastian Mayr 9780d577e9 Fix NullReferenceException when reader fails
If the reader execution in the try block fails, reader will stay null, but we later try to access reader.RecordsAffected. This raises a null reference exception which hides the original exception, making this particularly hard to detect.
2015-11-20 01:53:02 +01:00
Martin Baulig f79731662f [System]: Implement X509Certificate2.Export(X509ContentType.Pfx).
(cherry picked from commit e51b4ec685)
2015-11-19 15:44:02 -05:00
Zoltan Varga 27432be3ec [x86] Fix OP_IMUL_OVF_UN clobbering edx in some cases. Fixes #36052. 2015-11-19 14:19:14 -05:00
Ludovic Henry b580f5f4e1 [coop] Switch SGen sgen_interruption_mutex to coop implementation 2015-11-19 18:30:20 +00:00
Ludovic Henry 9f522ef368 [coop] Switch SGen gc_mutex to coop implementation 2015-11-19 18:30:19 +00:00
Ludovic Henry 5f4a870218 [coop] Switch ThreadPool locks to coop implementation 2015-11-19 18:30:19 +00:00
Ludovic Henry 06ae5e2e92 [coop] Switch ThreadPoolIO locks to coop implementation 2015-11-19 18:30:18 +00:00
Ludovic Henry 0fe6879969 [socket] Fix blocking section around close 2015-11-19 18:30:18 +00:00
Ludovic Henry 6fde25fe99 [coop] Switch type_initialization_section and TypeInitializationLock->initialization_section to coop implementation 2015-11-19 18:30:17 +00:00
Ludovic Henry 95acc1e441 [io-layer] Fix uninitialized mutex 2015-11-19 18:30:17 +00:00
Ludovic Henry 49eb91e6f8 [coop] Switch appdomains_mutex to coop implementation 2015-11-19 18:30:16 +00:00
Ludovic Henry 3546e55aaf [coop] Switch sleep_(mutex|cond) to coop implementation 2015-11-19 18:30:16 +00:00
Ludovic Henry 5db3e92b51 [coop] Switch MonoInternalThread->synch_cs to coop mutex 2015-11-19 18:30:15 +00:00
Ludovic Henry 3895f81572 [coop] Switch finalizer_sem to coop mutex 2015-11-19 18:30:15 +00:00
Ludovic Henry 77f9f40869 [gc] Remove dead code 2015-11-19 18:30:14 +00:00
Ludovic Henry 33e1332df8 [utils] Add mutex and semaphore API to support coop suspend
Instead of having to use MONO_PREPARE_BLOCKING/MONO_TRY_BLOCKING in the
user code, we do it directly in this new mutex and semaphore coop API.

Using the mono_os_* locking functions should not be the default case, as
that could lead to longer than necessary time to suspend, and even in
certain cases to deadlocks.
2015-11-19 18:30:14 +00:00
Ludovic Henry 7ac23bc974 [utils] Move mutex and semaphore to mono_os_*
This is to separate from the mono_coop_* mutex and semaphores
2015-11-19 18:30:13 +00:00
Ludovic Henry 4899b4627a [attach] Remove dead code 2015-11-19 18:30:12 +00:00
Ludovic Henry 34a361a6df [semaphore] Cleanup
Move all the code to mono-semaphore.c, so it will be easier to make it
coop suspend friendly.
2015-11-19 18:30:06 +00:00
Ludovic Henry b54ab7a4ba [mutex] Cleanup
Move all the code to mono-mutex.c, so it will be easier to make it coop
suspend friendly.
2015-11-19 18:29:24 +00:00
Rolf Bjarne Kvinge 9a80281b02 Fix mcs build to use Thread.Abort. 2015-11-19 19:24:24 +01:00
Rolf Bjarne Kvinge 4f0cb955e9 Remove Thread API from the watch/tv runtime profiles as well. 2015-11-19 19:24:23 +01:00
Jonathan Pryor fde24d3d17 Merge pull request #2183 from joelmartinez/monodoc-ecmacref-fix
[monodoc] Fixed several issues with `.ToEcmaCref` method.
2015-11-19 10:39:54 -05:00
Jo Shields e3fa11a369 [msvc] Fix path to ml64.exe in masm.fixed.props 2015-11-19 14:20:21 +00:00
Miguel de Icaza c86c8cdf10 Bring the Asin/Acos fix from CoreFX 2015-11-19 09:14:13 -05:00
Marek Safar d287861cfa [corlib] Update long/short timepatterns. Reference source DateTimeInfo uses different logic for single pattern extraction. Fixes part of #36003 2015-11-19 14:56:11 +01:00
Rolf Bjarne Kvinge f1b7be2f57 Remove Thread.[Abort|Suspend|Resume] from TvOS/WatchOS.
In tests replace usages of Thread.Abort with Thread.Interrupt when it looks
like it can work, otherwise just disable the complete test.
2015-11-19 12:54:36 +01:00
Zoltan Varga f2b6974b9b [aot] Fix support for synchronized wrappers of gsharedvt methods. 2015-11-19 06:09:48 -05:00
Rolf Bjarne Kvinge d4b64f5ba9 [mono-api-info] Take return type into account when comparing methods. 2015-11-19 10:28:38 +01:00
Rolf Bjarne Kvinge 30c02efa29 [mono-api-info] Take into account parameters when sorting properties. 2015-11-19 10:28:38 +01:00
Rolf Bjarne Kvinge 16b9ec5be5 [mono-api-info] Sort attributes.
So that info files can be compared textually to test for api equality.
2015-11-19 10:28:37 +01:00
Zoltan Varga 37f2657ac7 [jit] Fix memory leaks in the generic sharing code by making sure that values stored into an rgctx slot are never NULL, since otherwise the runtime would recompute them on every access. Fixes #36000. 2015-11-19 02:00:28 -05:00
Zoltan Varga ce6e1950b2 [jit] Fix the gsharedvtcheck make target. 2015-11-19 02:00:28 -05:00
Alexander Köplinger 2e1d4228e3 [metadata] Remove unused empty struct from marshal.h
It breaks MSVC.
2015-11-18 23:41:42 +01:00
Alexander Köplinger 96b24f637c [mini] Add MONO_API to mono_parse_env_options
We need this exported for our multi lib setup in MSVC.
2015-11-18 23:41:41 +01:00
Alexander Köplinger 5aa84a313e [msvc] Remove obsolete jay project files
We're requiring VS2013 now.
2015-11-18 23:41:35 +01:00
Alexander Köplinger 790700d0bf [msvc] Fix msbuild warnings
OutDir/IntDir should end with trailing slash.

Don't override Linker OutputFile, instead copy jay via a PostBuildEvent to the correct dir.
2015-11-18 23:41:26 +01:00
Alexander Köplinger 7ba10805f3 [msvc] Add missing files to libmonoutils.vcxproj 2015-11-18 22:01:24 +01:00
Alexander Köplinger 2c99109044 [msvc] Update .def files 2015-11-18 22:01:23 +01:00
Sebastien Pouliot a0da4f621d [tests] Skip Local name (incorrect) assumption for iOS/tvOS/watchOS/OSX in TimeZoneInfo tests 2015-11-18 12:31:40 -05:00
Zoltan Varga 05b1231601 [runtime] Fix multiple inclusion of object-offsets.h 2015-11-18 11:48:42 -05:00
Ludovic Henry 3a8c9eaffb Merge pull request #2243 from konrad-kruczynski/process_exited_should_wait_in_background
Process.cs: adding a handler to Exited will make the program wait for the process to exit
2015-11-18 13:57:25 +00:00
Konrad M. Kruczynski e348cf2a80 Caller of Exited event should wait for process to exit in background.
Otherwise simply adding an event will make our program to live at least as long
as the created process lives.
2015-11-18 13:44:49 +01:00
Rolf Bjarne Kvinge 7f4c6459e3 [System] Exclude code that tries to load System.Windows.Forms.dll dynamically on mobile.
It won't succeed anyway.
2015-11-18 13:37:30 +01:00
Zoltan Varga dc00526d13 [aot] Fix another memory leak. 2015-11-18 07:26:28 -05:00
Zoltan Varga 314167f18c Bump ikdasm to 323eeecdf13c39527c53efa5f6c8487765ee42c0. 2015-11-18 06:24:30 -05:00
Vlad Brezae 950d7d2151 [sgen] Register counter for evacuated objects 2015-11-18 12:39:53 +02:00
Vlad Brezae 48c61581b2 [sgen] Remove unused stat 2015-11-18 12:39:53 +02:00
Zoltan Varga 91eb302670 [external/ikdasm] Bump to d6db90d6780d5cdb37ef97ec36d0cb452ac70e9e. 2015-11-18 04:23:53 -05:00
Zoltan Varga 6bf2ccd968 [runtime] Add a DECL_SIZE2 macro usable from offsets files. 2015-11-18 00:34:03 -05:00
Zoltan Varga a2c475bcbe [runtime] Fix the lookup of nested types in type forwarders. Fixes #35447. 2015-11-18 00:06:49 -05:00
Zoltan Varga 34f604bd21 Fix a warning. 2015-11-17 22:54:02 -05:00
Zoltan Varga 52f87fc52b [aot] Fix a memory leak in init_amodule_got (). 2015-11-17 22:36:28 -05:00
Ludovic Henry 6a02a31ff4 Revert "[sgen] Remove sgen specific suspend code"
This reverts commit 64af68dd8d.
2015-11-18 00:25:43 +00:00
Ivan Maidanski 5e3eac6b4d [boehm] Put *_freelists into thread_local_freelists (as in BDWGC v7)
Mono create_allocator accesses libgc private *_freelists directly.
These fields have been grouped together into struct
thread_local_freelists in BDWGC v7.
This commit does code refactoring to match the structure of external
GC regarding *_freelists.

 * Move GRANULARITY, NFREELISTS (used by *_freelists) out of
   GC_Thread_Rep.

 * Move ptrfree_freelists, normal_freelists, gcj_freelists from
   GC_Thread_Rep to struct thread_local_freelists.

 * Add tlfs field (of type struct thread_local_freelists) to
   GC_Thread_Rep.

 * Update pthread_support.c and boehm-gc.c code accordingly.
2015-11-18 01:05:36 +03:00
Ivan Maidanski b0e91acb61 [boehm] Match BDWGC v7 API
Mono-specific libgc functionality has been recently added to BDWGC.
This commit changes API of included Boehm GC to match that of the
external GC.

 * Renaming:
   - GCEventType -> GC_EventType
   - GC_get_restart_signal -> GC_get_thr_restart_signal
   - GC_toggleref_register_callback -> GC_set_toggleref_func
   - GC_set_finalizer_notify_proc -> GC_set_await_finalize_proc

 * Replace global variable with a setter:
   - GC_notify_event -> GC_set_on_collection_event() (acquires GC lock)

 * Foreign threads registration:
   - add GC_allow_register_threads() (no-op for GC v6, called by
     mono_gc_base_init)
   - add GC_SUCCESS, GC_DUPLICATE, GC_NO_MEMORY, GC_UNIMPLEMENTED macros
   - add struct GC_stack_base
   - replace GC_thread_register_foreign(void*) with
     GC_register_my_thread(struct GC_stack_base)
   - define GC_register_my_thread also for Solaris and Win32
   - GC_register_my_thread returns GC_DUPLICATE if already registered

 * Toggle-ref callback declaration change:
   - add GC_ToggleRefStatus (enum type)
   - callback returns GC_ToggleRefStatus instead of int

 * Toggle-ref addition status checked:
   - GC_toggleref_add return type changed from void to int
   - GC_toggleref_add returns GC_SUCCESS or GC_NO_MEMORY
   - static ensure_toggleref_capacity() returns FALSE if GC MALLOC failed
   - call g_error() if GC_toggleref_add failed

 * Conditional public function declaration:
   - wrap GC_DllMain declaration into ifdef GC_INSIDE_DLL
   - define GC_INSIDE_DLL prior to include gc.h
2015-11-18 01:05:26 +03:00
Martin Baulig 7e3c27c4a8 Actually, really fix my last build - sorry for the breakage.
(cherry picked from commit e95a4a2e35)
2015-11-17 16:45:59 -05:00
Martin Baulig 3b2f130adc Fix my last commit.
(cherry picked from commit 4a5da6f763)
2015-11-17 16:05:29 -05:00
Alexander Köplinger 61374d794c Merge pull request #2236 from akoeplinger/add-dataflow
[System.Threading.Tasks.Dataflow] Replace implementation with CoreFx version
2015-11-17 22:03:53 +01:00
Martin Baulig 9dea40613f [Mono.Security]: Add 'X509Chain' to ICertificateValidator.InvokeSystemValidator and MonoTlsProvider.InvokeSystemCertificateValidator.
On OS X and Mobile, the X509Chain will be initialized with all the
certificates from the X509CertificateCollection, but not actually
built.

ServicePointManager.ServerCertificateValidationCallback can use the 'chain' argument
to get all the certificates from the server.

(cherry picked from commit 73e37f0ecf)
2015-11-17 15:54:44 -05:00
Martin Baulig e1e95f6e29 [Mono.Security]: The default value of 'MonoTlsSettings.UseServicePointManagerCallback' is supposed to be true.
This fixes a regression where ServicePointManager.ServerCertificateValidationCallback
was not called when using WebClient.

(cherry picked from commit 5022db1956)
2015-11-17 15:54:31 -05:00
Ludovic Henry 3125d0f46d [threads] Fix build 2015-11-17 15:48:52 +00:00
Marek Safar ec9933d2f1 [mcs] Set null operator barrier between invocation instance and its arguments. Fixes #33341 2015-11-17 16:14:47 +01:00
Zoltan Varga cca098bffc [arm] Avoid an assertion check in aot mode. 2015-11-17 10:02:23 -05:00
Zoltan Varga ccee596d1a [runtime] Add MONO_ABI_SIZEOF macros similar to the existing MONO_ABI_ALIGNOF macros, use these to compute sizes of types. 2015-11-17 10:01:38 -05:00
Alexis Christoforides 3c43a0e1c7 Merge pull request #2240 from UCIS/patch-6
Fixed hang in SslStreamBase when stream is closed during I/O
2015-11-17 09:57:39 -05:00
Ludovic Henry 64af68dd8d [sgen] Remove sgen specific suspend code 2015-11-17 14:45:07 +00:00
Alex Rønne Petersen d9ca0dd929 Merge pull request #2241 from f00f/patch-1
Fixed typo
2015-11-17 15:29:05 +01:00
f00f 23673d636e Fixed typo 2015-11-17 15:28:19 +01:00
Ivo Smits 843f1253dd Fixed hang in SslStreamBase when stream is closed during I/O
If the SslStreamBase is disposed while a read or write operation is in progress, the asynchronous I/O state is never marked as completed, resulting in synchronous Read/Write calls never returning. To fix this, the internal I/O callbacks should mark the asynchronous operations as completed, possibly with an error, even if the SslStreamBase is disposed.
2015-11-17 14:54:02 +01:00
Rolf Bjarne Kvinge 3033a4b5b5 Merge pull request #2201 from rolfbjarne/linker-better-xml-processing-errors
[linker] Provide better error message when an error occurs while processing xml descriptions
2015-11-17 08:47:18 -05:00
Alexander Köplinger 889d23575a Remove link to Wrench from README.md
We're retiring public Wrench and replacing it with Jenkins, see http://lists.ximian.com/pipermail/mono-devel-list/2015-November/043399.html
2015-11-17 14:14:55 +01:00
Rolf Bjarne Kvinge 932bfeda56 Add monotouch_*_runtime profiles for watchOS and tvOS. 2015-11-17 12:51:39 +01:00
Rolf Bjarne Kvinge 3fd03bf763 Ignore extensions-config.h 2015-11-17 12:51:37 +01:00
Zoltan Varga 57b52680cf Fix the build. 2015-11-17 03:30:49 -05:00
Zoltan Varga 74527e03dd Remove obsolete interpreter embedding sample. 2015-11-17 02:16:25 -05:00
Zoltan Varga 45d468d66e [jit] Remove unused mono_aot_register_globals () function. 2015-11-17 02:12:29 -05:00
Zoltan Varga ab5b9179ab [jit] Remove the nursery_bits from the wrapper info for the gc write barrier methods, its no longer needed after 85581ff1bb. 2015-11-17 01:54:17 -05:00
Zoltan Varga a649be26c7 [jit] Add a header file for aot-compiler.c. 2015-11-17 01:51:13 -05:00
Zoltan Varga 80b2c7c49b [jit] Fix the check for emulation of div instructions in 9f253965d0. 2015-11-16 22:28:38 -05:00
Alexander Köplinger 932f85fbec Merge pull request #2239 from xmcclure/interbals2
Minor: Style cleanup on internal headers (continued)
2015-11-17 00:25:26 +01:00
Andi McClure 732bc07bd8 Minor: Style cleanup on internal headers (continued)
Previous patch missed some build files.
2015-11-16 18:17:21 -05:00
Andi McClure 59c279b9e6 Merge pull request #2238 from xmcclure/interbals
Minor: Style cleanup on internal headers
2015-11-16 17:26:17 -05:00
Andi McClure aa6dc985b7 Minor: Style cleanup on internal headers
For consistency, rename any -internal.h files to -internals.h. Also remove INTERBALS
2015-11-16 15:45:01 -05:00
Marcos Henrich 5c2596af27 Updated Assert.Equals to Assert.AreEqual 2015-11-16 17:58:03 +00:00
Alexander Köplinger d17c5407a4 [System.Threading.Tasks.Dataflow] Replace implementation with CoreFx version
We were seeing some random test failures on Jenkins with our Dataflow implementation.
Replacing it with Microsoft's CoreFx version fixed those and makes us more compatible.

While we'd ideally not ship this assembly at all with Mono (it doesn't ship with .NET),
we shipped it in the past and as such people might rely on it so we can't remove it.

The CoreFx commit this version was taken is 905a1940bcda0afdca2f14ceb2b0161ebc4d1d02.
2015-11-16 17:17:02 +01:00
Alex Rønne Petersen 99b3b2cced [arm] HACK: Disable fast TLS on ARM for now.
https://bugzilla.xamarin.com/show_bug.cgi?id=35178
2015-11-16 17:03:26 +01:00
Alex Rønne Petersen ea970d8953 [linker] Always preserve Interlocked.Exchange<T> ().
The runtime expects to be able to find the generic variant of this method in
the metadata even when code is calling the `object` overload.
2015-11-16 16:07:18 +01:00
Alexander Köplinger 464aa0336d Merge pull request #2228 from lambdageek/dev/sgen-timeouts
[test] sgen tests should behave nicer on slower machines.
2015-11-16 15:10:24 +01:00
Zoltan Varga 28a147ae7c [arm] Simplify the seq point code used for soft breakpoints. 2015-11-16 03:55:00 +00:00
Miguel de Icaza b67f4e0d2f [Windows.Forms] add a warning to the Carbon driver when running on 64 bits 2015-11-15 10:12:03 -05:00
Zoltan Varga ea09193eb8 [runtime] Fix Thread.CurrentThread in non-root appdomains by setting the tls slot in start_wrapper, otherwise Thread.CurrentThread would create a new Thread object so there would be two. Fixes #35828. 2015-11-15 08:32:36 -05:00
Zoltan Varga a75a39e4df Fix a warning. 2015-11-15 03:00:30 -05:00
Zoltan Varga efeb26e32e [amd64] Make amd64_patch non-inline, it seems to be miscompiled by older clang versions (5.1). 2015-11-14 19:04:40 -05:00
Zoltan Varga 1c2cf65921 [amd64] Enable div checks when running on tvos. 2015-11-13 22:42:23 -05:00
Zoltan Varga 07d8d41a3b [jit] Emit div checks if MONO_ARCH_NEED_DIV_CHECK is enabled even when div instructions are not emulated. 2015-11-13 19:48:59 -05:00
João Matos 2ccf016f5b Merge pull request #2233 from madewokherd/ucontextgregs
Do not define UCONTEXT_GREGS on win64.
2015-11-13 15:02:14 -08:00
Zoltan Varga a706d531a9 Revert "[jit] Emit div checks if MONO_ARCH_NEED_DIV_CHECK is enabled even when div instructions are not emulated. Enable div checks for tvos."
This reverts commit 276824dd28.

Revert this as it breaks on some android devices:
https://bugzilla.xamarin.com/show_bug.cgi?id=35844
2015-11-13 16:27:35 -05:00
Aleksey Kliger 5693ac2840 [test] Give the sgen tests more time. 2015-11-13 15:32:10 -05:00
Aleksey Kliger bfb46573ac [test] Make sgen tests behave nicer on slower machines.
* TestDriver.cs Add `TestTimeout` utility to check how much time CI
       allocated for the test.
  * sgen-domain-unload-2.cs print warning if running low on time.
  * sgen-new-threads-dont-join-stw.cs print progress dots and a warning
       when running low on time.
2015-11-13 15:32:10 -05:00
Martin Baulig ba97606b1d [Mono.Security]: Cleanup the internal `Mono.Security.Interface.ICertificateValidator'.
* ICertificateValidator.SelectClientCertificate(): return bool, indicating whether
  a certificate has been selected or the caller should use its default
  implementation (if it has any).

* ICertificateValidator.ValidateCertificate(): new common function for both client
  and server certificates; replaces ValidateChain() and ValidateClientCertificate().

* MonoTlsProvider.InvokeSystemCertificateValidator(): return bool, indicating whether
  the certificate has been validator or the default system validator should be used.

(cherry picked from commit 42421eec1e)
2015-11-13 14:32:27 -05:00
Vincent Povirk fa3dba9be8 Do not define UCONTEXT_GREGS on win64. 2015-11-13 12:58:36 -06:00
Rodrigo Kumpera 3bc22b1961 Merge pull request #2227 from esdrubal/tzparse
[corlib] Fixes TimeZoneInfo.ParseTZBuffer abbrevs.
2015-11-13 13:12:15 -05:00
Marcos Henrich 54d3309f3a [corlib] Fixes TimeZoneInfo.ParseTZBuffer abbrevs.
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=31432

In a few android devices TimeZoneInfo.ParseTZBuffer was failing ito
parse Europe/Moscow with:
at System.ThrowHelper.ThrowKeyNotFoundException ()
at System.Collections.Generic.Dictionary`2[System.Int32,System.String].get_Item (Int32 key)mscorlib/system/collections/generic/dictionary.cs:176
at System.TimeZoneInfo.ParseTimesTypes (System.Byte[] buffer, Int32 index, Int32 count, System.Collections.Generic.Dictionary`2 abbreviations) [0x0002f] in mcs/class/corlib/System/TimeZoneInfo.cs:1293
at System.TimeZoneInfo.ParseTZBuffer (System.String id, System.Byte[] buffer, Int32 length)

It was failing while getting the third index [3] from] from abbrevs.

abbrevs added values were the following:
[0, MMT]
[1, MT]
[2, T]
[4, MST]
[5, ST]
[6, T]
[8, MDST]
[9, DST]
[10, ST]
[11, T]
[13, S]
[15, M]
[17, MSK]
[18, SK]
[19, K]
[21, EET]
[22, ET]
[23, T]
[25, MSD]
[26, SD]
[27, D]
[29, EEST]
[30, EST]
[31, ST]
[32, T]

Index 3 was not added because its values is an empty string, as indexes
with empty values are used in this case we are now adding them to the
abbrevs dictionary.

Fixes #31432
2015-11-13 15:51:12 +00:00
Marcos Henrich 1ca88f9547 [corlib] Tests TimeZoneInfo.ParseTZBuffer
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=31432

Tests TimeZoneInfo.ParseTZBuffer with Europe/Moscow data that thrown
at System.ThrowHelper.ThrowKeyNotFoundException ()
at System.Collections.Generic.Dictionary`2[System.Int32,System.String].get_Item (Int32 key)mscorlib/system/collections/generic/dictionary.cs:176
at System.TimeZoneInfo.ParseTimesTypes (System.Byte[] buffer, Int32 index, Int32 count, System.Collections.Generic.Dictionary`2 abbreviations) [0x0002f] in mcs/class/corlib/System/TimeZoneInfo.cs:1293
at System.TimeZoneInfo.ParseTZBuffer (System.String id, System.Byte[] buffer, Int32 length)
2015-11-13 15:51:11 +00:00
Ludovic Henry e389dac610 [IO] Dump handle when we run out of them
When running out of handle, it's hard to know exactly why. Dumping them
will help troubleshoot handle leaks.
2015-11-13 11:59:54 +00:00
Marek Safar 526c802c3b Bump referencesource 2015-11-13 09:26:52 +01:00
Zoltan Varga 276824dd28 [jit] Emit div checks if MONO_ARCH_NEED_DIV_CHECK is enabled even when div instructions are not emulated. Enable div checks for tvos. 2015-11-12 22:59:34 -05:00
Zoltan Varga 75ad142bb2 [arm] Fix register assignments during hfa parameter passing. Fixes pinvoke_ppdcd.exe. 2015-11-12 18:48:59 -05:00
Zoltan Varga cb7c762c3e [runtime] Rename iltests.il.in back to iltests.il, architecture specific tests should be handled using Category attributes. 2015-11-12 18:07:15 -05:00
Radek Doulik 072a7aa91a [linker] do not try to iterate thru null array
- fixes the case when custom attribute instance constructor contains
   null value for System.Type[] array
2015-11-12 21:07:19 +01:00
Martin Baulig 475d00292a Rewrite the test case from commit b503b87a to not use Assert.IsInstanceOfType(). 2015-11-12 14:15:39 -05:00
Alexander Köplinger 140660e246 [Facades] Fix tarball (for real this time)
Turns out EXTRA_DISTFILES only works with library.make or executable.make,
so we need to just use DISTFILES here...
2015-11-12 17:06:03 +01:00
Alexander Köplinger 49051897c5 [Facades] Fix tarball by adding a new file to EXTRA_DISTFILES
It was added in 29a02f2b12.
2015-11-12 15:04:58 +01:00
Alexander Köplinger 67a6622180 Merge pull request #2224 from Gankov/patch-1
Fixed a typo in Mono.Cairo
2015-11-12 14:21:39 +01:00
Gankov Andrey d01d4a61ee Fixed a typo 2015-11-12 12:55:26 +03:00
Zoltan Varga 7df720cf51 [runtime] Remove a bogus assertion. 2015-11-11 21:30:07 -05:00
Zoltan Varga 94f19327d6 [jit] Use emit_runtime_constant () in a few more places to reduce code duplication between the JIT and mono_resolve_patch_target (). 2015-11-11 20:57:15 -05:00
Rodrigo Kumpera 6ee42d0c51 Merge pull request #2213 from kumpera/widen-unsafe-mov
[jit] Add support for widening of Array.UnsafeMov intrisic. Fixes #35310
2015-11-11 19:15:39 -05:00
Rodrigo Kumpera 6794876036 [jit] Allow reference types with Array.UnsafeMov. Document restrictrions in Array.cs. 2015-11-11 18:30:00 -05:00
Larry O'Brien 88547f4efd Changed link from GUID to URL
Closes https://github.com/xamarin/documentation/issues/944
2015-11-11 13:12:55 -10:00
Zoltan Varga 7642f734b5 [runtime] Use 'this_obj' instead of 'this' in a few more places. 2015-11-11 17:59:19 -05:00
Rodrigo Kumpera d5b32bdca3 [jit] Add support for widening of Array.UnsafeMov intrisic. Fixes #35310
This enables usage of JitHelper.UnsafeEnumCast<> with enums smaller than int.

This changes enables the intrinsic for int conversions of same reg class.
2015-11-11 17:38:56 -05:00
Alexander Köplinger 654cab1b99 [acceptance-tests] Split compiling/cleaning test sources and bump coreclr
The coreclr-compile-tests would throw a shell error "Argument list too long" on OSX due
to the huge amount of tests passed to make in one go. The same happened for make clean.

We now compile and clean the three sets of coreclr test sources separately to avoid this.

Additionally, bump the coreclr reference and include a new test that was added upstream.
2015-11-11 23:21:01 +01:00
Rodrigo Kumpera 1d378cd515 Merge pull request #2222 from akoeplinger/dataflow-test-reliability
[Dataflow] Fix flaky tests by bumping timeouts
2015-11-11 16:48:35 -05:00
Alexander Köplinger 0f6b85f08b [Dataflow] Fix flaky tests by bumping timeouts
We were seeing random Dataflow tests fail on Jenkins from time to time.
I managed to reproduce the BroadcastBlockTest.CloningTest and WriteOnceBlockTest.CloningTest
fail on my machine by generating CPU load and running those test in a while(true).

Bumping the timeouts from 100ms -> 1s fixed the flakiness for me, so I went ahead and
opportunistically bumped all such small timeouts throughout the testsuite.
2015-11-11 22:40:28 +01:00
Rodrigo Kumpera 5b1b364871 Merge pull request #2207 from lambdageek/dev/bug-35375
[reflection] Fix for  35375 - explicit interface implementation using a generic type instance
2015-11-11 14:42:40 -05:00
Mark Probst 8b10aac753 Merge pull request #2198 from BrzVlad/feature-concurrent-work
[sgen] Fix memory use of the concurrent collector
2015-11-11 11:26:25 -08:00
Rodrigo Kumpera 229e4d8823 Merge pull request #2217 from rcruzs00/master
El Capitan fix : system integrity protection compatibility
2015-11-11 12:05:07 -05:00
Aleksey Kliger 9450821dae [runtime] mono_class_init() - don't look for metadata if the dynamic image doesn't have it. 2015-11-11 11:12:03 -05:00
Aleksey Kliger b503b87a03 Crashing test in mono_class_init() from a MonoGenericClass.
[#35375](https://bugzilla.xamarin.com/show_bug.cgi?id=35375)
2015-11-11 11:09:41 -05:00
David Karlaš 5acd39ef32 [XBuild] If CurrentSolutionConfigurationContents is not set AssignProjectConfiguration can't do much so just pass references
Fixes Bug 35579 - Recent xbuild changes result in breakages to F# compiler tools(This is actual fix on master and not revert as it was on cycle 6)
2015-11-11 13:45:16 +01:00
David Karlaš 5977060b42 [XBuild] If Project Guid is missing on <ProjectReference> don't throw Error(same as MSBuild)
Fixes Bug 35548 - 9 new MSBuild test failures on cycle6(This is actual fix on master and not revert as it was on cycle 6)
2015-11-11 13:43:07 +01:00
Rafael Cruz 2db3c7d767 El Capitan fix : system integrity protection compatibility 2015-11-10 23:31:49 -02:00
Alexander Köplinger 59f8e6a2bf Merge pull request #2216 from akoeplinger/fix-array-sort
[corlib] Fix Array.Sort throwing when fewer keys than items are provided
2015-11-11 00:24:18 +01:00
Rodrigo Kumpera 95f8dedd25 Merge pull request #2215 from kumpera/crash_in_mono_class_get_method_from_name_flags
[runtime] Fix bad assert in mono_class_get_method_from_name_flags.
2015-11-10 18:12:46 -05:00
Zoltan Varga f94637071b [runtime] Fix a few more class->klass cases. 2015-11-10 16:42:34 -05:00
Zoltan Varga aac8eaf948 [runtime] Use 'klass' instead of 'class' to make the code more c++ friendly. 2015-11-10 16:20:36 -05:00
Alexander Köplinger f736f9cda2 [corlib] Fix Array.Sort throwing when fewer keys than items are provided
The `Sort<TKey, TValue> (TKey [] keys, TValue [] items, IComparer<TKey> comparer)` overload in Array throwed when keys.Length != items.Length.
However, on .NET you can pass in a keys array with fewer elements than in items and it'd sort the elements in items up to that point.

Fixed our implementation by only throwing when keys.Length > items.Length.

This was revealed by the coreclr/tests/src/CoreMangLib/cti/system/array/arraysort12.exe test.
I decided to port the test into our testsuite so we catch regressions earlier.
2015-11-10 22:14:47 +01:00
Martin Baulig 02436a1aa1 [Mono.Security]: Add destructor to MonoSslStream.
(cherry picked from commit f158270d86)
2015-11-10 15:48:32 -05:00
mhutch eedf3e9a0d Merge pull request #2124 from mhutch/mono-api-info-forwarders
[mono-api-info] Allow following type forwarders
2015-11-10 12:47:19 -08:00
João Matos b2811ef633 [runtime] Fixed typo. 2015-11-10 12:36:46 -08:00
Martin Baulig e7d9c132c7 [Mono.Security]: 'Mono.Security.Interface.MonoSslStream' needs to implement IDisposable.
(cherry picked from commit 4c1760785a)
2015-11-10 15:31:36 -05:00
Martin Baulig 0d585d53ee [Mono.Security]: Make MonoTlsProviderFactory.CreateHttpListener() take 'X509Certificate' instead of 'X509Certificate2'.
(cherry picked from commit 3d81daf796)
2015-11-10 15:31:21 -05:00
Rodrigo Kumpera babed3bd48 [runtime] Fix bad assert in mono_class_get_method_from_name_flags. 2015-11-10 13:55:30 -05:00
Marcos Henrich 29a02f2b12 Merge pull request #2209 from esdrubal/facades_subdirs
[Facades] Moved subdirs list to subdirs.make
2015-11-10 17:35:58 +00:00
Alex Rønne Petersen b4e8153857 [corlib] Disable FullNameGetTypeParseEscapeRoundtrip test on Android.
This requires the symbol writer which is not available on Android.
2015-11-10 18:34:00 +01:00
Alexander Köplinger 681a5582dc [acceptance-tests] Output Roslyn and ms-test-suite NUNit xml result to current dir
Roslyn used xunit-style xml by default, we hack the cibuild.sh script to output nunit-style
for now until we get an option upstream.

This allows us to catch those test results in Jenkins.
2015-11-10 17:01:07 +01:00
Marek Safar 51e396f5b1 [mcs] Handle using aliases in evaluator. Fixes #32894 2015-11-10 16:55:50 +01:00
Marek Safar 5fdd95ef9d [mcs] Don't store invalid using static expression in evaluator queue. Fixes #35604 2015-11-10 16:38:55 +01:00
Marek Safar 30a63ede22 [System.Web] WebColorConverter from reference source 2015-11-10 16:38:55 +01:00
Rodrigo Kumpera 87571809d6 Merge pull request #2214 from kumpera/fix_enum_get_get_hashcode
[runtime] Fix Enum.GetHashCode when basetype is short or sbyte.
2015-11-10 09:41:09 -05:00
Marek Safar 418707d177 [Mono.Posix] Update incorrect test 2015-11-10 15:07:50 +01:00
Marek Safar 89c3d7c242 [mcs] inherited interface constraints checks on defined interfaces only. Fixes #35535 2015-11-10 14:05:49 +01:00
Marek Safar 8adbe0083f [mcs] Restore local variables state after probing run. Fixes #35674 2015-11-10 11:59:34 +01:00
Marek Safar ef38127aca Merge pull request #2210 from ystr/FromHtml-xxx
ColorTranslator.FromHtml 3-digit codes support (#35664)
2015-11-10 11:38:33 +01:00
Zoltan Varga 0127252e64 [bcl] Add versioning to the TestTasks.dll file name used by the Microsoft.Build.Engine tests since it needs to be compiled against the same xbuild version as the rest of the tests. 2015-11-10 00:14:06 -05:00
Rodrigo Kumpera 6c56f052fa [runtime] Fix Enum.GetHashCode when basetype is short or sbyte.
In addition to fixing the runtime, fix the test suite to correctly detect this problem.

This popped up because, for some reason, those two types have hashcodes that
don't return identity on reference sources.
2015-11-09 22:42:51 -05:00
Vlad Brezae c5e2887354 [sgen] We only use workers when starting the concurrent collection 2015-11-10 03:29:32 +02:00
Vlad Brezae 54081d9fe3 [sgen] Optimize the finishing of the concurrent collection
If we force the finish of the concurrent collection, instead of waiting for the concurrent mark to finish followed by the finishing mark&sweep, we immediately stop the worker thread, change its object operations and drain the remaining gray stack, also following references to the nursery. This way we avoid the cardtable overhead in cases where there are a lot of references from heap to the nursery.
2015-11-10 03:28:54 +02:00
Vlad Brezae 6020c1ff72 [jit] Refactor loading of runtime constants from IL 2015-11-10 01:17:40 +02:00
Vlad Brezae 85581ff1bb [aot] Don't hardcode the nursery size in aot write barriers
It can be passed at runtime in the nursery-size option of MONO_GC_PARAMS environment variable.

Fixes #35414
2015-11-10 01:16:48 +02:00
Alexander Köplinger c765316529 [acceptance-tests] Ensure Roslyn is bootstrapping with Mono
It tried to use CoreCLR but that doesn't work on Jenkins since some of the dependencies are missing there.
We actually want to ensure it's always using Mono so we can catch errors on our side, so we need this
hack until we have an option in the script upstream.
2015-11-09 18:59:07 +01:00
Andi McClure 0217438747 Merge pull request #2200 from xmcclure/image-audit-oops
Fix --with-checked-build build on GCC/Linux
2015-11-09 12:04:57 -05:00
Andi McClure 8124b32431 Fix to checked-build reference auditing
Remove an array idiom which both broke the GCC build (apparently Clang allows some things with variable-length arrays in "gnu99" mode which GCC does not) and wasn't right anyway (there was a typo which caused a read past end of buffer).
2015-11-09 11:08:58 -05:00
ES 1e30bae19c ColorTranslator.FromHtml 3-digit codes support (#35664) 2015-11-09 18:53:00 +03:00
Marcos Henrich 631d194f74 [Facades] Moved subdirs list to subdirs.make
The list of subdirs is useful for maccore build, it was moved to its own file so it can be included in other builds makefiles.
2015-11-09 13:43:52 +00:00
Martin Booth 1844e7343c [mcs] Replaced data annotation error messages with values extracted from corefx resource file 2015-11-09 09:25:20 +11:00
Zoltan Varga 33b8baa99d Revert "[bcl] Mark some System tests which depend on a working dns with InetAccess."
This reverts commit d644cb2ab3.

Revert this, localhost needs to be resolvable.
2015-11-06 21:50:04 -05:00
Zoltan Varga d644cb2ab3 [bcl] Mark some System tests which depend on a working dns with InetAccess. 2015-11-06 21:44:24 -05:00
Alexander Köplinger 2c608c32e7 [acceptance-tests] Fixes for Roslyn integration
We now use our own archive with the few additional pieces that MS added to their copy of
Mono used by Roslyn CI instead of downloading their archive.

Also bump coreclr to get a fix for the GC test that would fail on Jenkins in.
2015-11-07 03:36:07 +01:00
Zoltan Varga 0a12707cd7 [runtime] Add a MonoAotMode entry for llvmonly. 2015-11-06 19:47:48 -05:00
Zoltan Varga 1d6f412b8a [runtime] Add a dummy definition for mono_debug_personality (), aot compiled managed-to-native wrappers refer to it even if its not used. 2015-11-06 19:47:48 -05:00
Martin Baulig 65ccd579eb Merge pull request #2102 from AdamBurgess/master
[System] Fix bug #31209 - HttpConnection infinite loop
2015-11-06 15:49:10 -05:00
Zoltan Varga 2a224bef66 Avoid setting mono_llvm_only when mono_aot_only is set. 2015-11-06 14:47:49 -05:00
Alexander Köplinger da1bc0b8bd [acceptance-tests] Bump coreclr to pick up a8cbbdddfe9923a7f99edf8870842ad373e66b5b
I also fixed the coreclr-gcstress target to check for the expected exit code of the testsuite.
2015-11-06 18:23:48 +01:00
Zoltan Varga e3510080d1 [llvm] Use LLVMArgNormal for scalars passed by value instead of LLVMArgInIReg/LLVMArgInFPReg which is misleading since arguments can be passed on the stack too. 2015-11-05 22:47:07 -05:00
Zoltan Varga 199ce3e9a7 [llvm] Add a 'type' field to LLVMArgInfo, use it to simplify the code a bit. 2015-11-05 22:39:08 -05:00
Zoltan Varga c8ef64bb98 [aot] Reduce the code duplication in the wrapper encoding/decoding code a bit. 2015-11-05 19:53:42 -05:00
Zoltan Varga 3c405f21cb [runtime] Make mono_marshal_get_wrapper_info ()/set_wrapper_info () use a WrapperInfo pointer instead of a generic one. 2015-11-05 19:29:30 -05:00
Zoltan Varga ddecee5dd0 [runtime] Add WrapperInfos for a few wrappers which were missing it. 2015-11-05 18:28:35 -05:00
Zoltan Varga 68ef8dea40 [runtime] Merge the 'AllocatorWrapperInfo' structure into the common WrapperInfo structure. 2015-11-05 17:52:54 -05:00
Martin Baulig db81fa06ec [Mono.Security]: Add API to let MonoTlsProvider provider a custom system certificate validator.
(cherry picked from commit 4364a6b752)
2015-11-05 17:38:56 -05:00
Martin Baulig b96248ec0e [Mono.Security]: Add ICertificateValidator.InvokeSystemValidator().
(cherry picked from commit 35f9501967)
2015-11-05 17:38:48 -05:00
Martin Baulig bf6c6c3b44 [System]: Cleanup SystemCertificateValidator.Evaluate() by passing it the settings instance.
(cherry picked from commit 6837c35527)
2015-11-05 17:38:41 -05:00
Martin Baulig dbec416030 [Mono.Security]: Add CertificateValidationHelper(MonoTlsProvider,MonoTlsSettings).
This is intended to be used by MonoTlsProvider implementations; the ChainValidationHelper
now knows about the provider (unless it's invoked directly from user code).

(cherry picked from commit 2dbf0a0ed1)
2015-11-05 17:38:19 -05:00
Martin Baulig 9a73889ed5 [System/TLS]: Make 'SystemCertificateValidator' a static class with a single Evaluate() method.
(cherry picked from commit fbdb69cfff)
2015-11-05 17:38:12 -05:00
Martin Baulig 5674bdd47b [System/TLS]: Use the official API in SslStream rather than hard-coding MonoDefaultTlsProvider.
(cherry picked from commit 0bcc31e326)
2015-11-05 17:38:05 -05:00
Zoltan Varga 5baeb28248 [runtime] Save the nursery bits used to create wbarrier methods into the aot image, and check it at runtime. 2015-11-05 17:26:43 -05:00
Mark Probst c278ead4d0 Merge pull request #2197 from mono/feature-disable-specific-finalizers
[sgen] Allow disabling finalization of specific classes.
2015-11-05 08:59:52 -08:00
Rolf Bjarne Kvinge acc96bf344 [linker] Provide better error message when an error occurs while processing xml descriptions.
With this mtouch will show:

> error MT2001: Could not link assemblies. Reason: Failed to process XML description: /work/maccore/master/maccore/tests/link sdk/extra-linker-defs.xml
>	Failed to process XML description: /work/maccore/master/maccore/tests/link sdk/extra-linker-defs.xml
>	Failed to resolve assembly: 'MonoTouch, Culture=neutral, PublicKeyToken=null'

instead of:

> error MT2002: Failed to resolve assembly: 'MonoTouch, Culture=neutral, PublicKeyToken=null'

which is a lot less helpful.
2015-11-05 12:35:34 +01:00
Marek Safar 4822ed5b92 Merge pull request #2199 from mhutch/pcl46
[xbuild] Add PCL 4.6 targets
2015-11-05 09:38:00 +01:00
Alexander Köplinger 1836d8b52e [acceptance-tests] Bump coreclr to pick up 65b122151adb6b5ef7c27d8e0c268ef479fbe8b4
+11 more passing tests. At this point I think there are no more false positives left and the rest are real bugs.
2015-11-05 01:40:43 +01:00
Zoltan Varga d8d944c72c [runtime] Implement native-to-managed marshalling of byref delegate arguments. Fixes #35545. 2015-11-04 16:27:35 -05:00
Zoltan Varga 78248f8ee7 [aot] Fix a crash introduced by 51c4e47f2 when the mscorlib aot image is missing. 2015-11-04 16:27:35 -05:00
Martin Baulig 3d172a4b34 Cosmetic; remove unused variable.
(cherry picked from commit a9afeddd80)
2015-11-04 15:11:31 -05:00
Martin Baulig eac6301e92 Cleanup unused usings.
Mono.Net.Security/LegacySslStream.cs is the only file which should
reference the 'Mono.Security.Protocol.Tls' namespace.

(cherry picked from commit 43307ff086)
2015-11-04 15:11:24 -05:00
Michael Hutchinson 4f06dbafa4 [xbuild] Add PCL 4.6 targets 2015-11-04 14:11:02 -05:00
Mark Probst 84f967d05b [sgen] Allow disabling finalization of specific classes. 2015-11-04 10:58:11 -08:00
Alexander Köplinger 94cc4ab942 [acceptance-tests] Sort source files and add a new MONO define when compiling the tests
This allows us to customize test behavior that is different on Mono on purpose.

Sorting the files provides a much nicer output in the test runner.

Bump CoreCLR to include changes from 20789373370fe8f72dde01ad7ffc0816f618197c
2015-11-04 18:48:09 +01:00
Martin Baulig 7d6abe53de [Facades]: Remove 'System.IO.Compression'.
We do not need a 'System.IO.Compression' facade assembly because we
already have a regular assembly with the same name, which contains all
the classes from here - either as actual implementation or as type-forwarders.

(cherry picked from commit fff7805794)
2015-11-04 12:33:58 -05:00
Ludovic Henry 17786e1260 Merge pull request #2196 from alexischr/coop-gc_stackdata-problem
[coop] Make sure 'gc_stackdata' is aligned and properly sized.
2015-11-04 16:03:22 +00:00
Zoltan Varga a0634bb78b [sdb] Add another fastpath to the invoke code to skip more of the single stepping code during invokes. 2015-11-04 03:09:54 -05:00
Zoltan Varga 7336f89c6e [llvm] Get rid of the 'pindexes' array in LLVMCallInfo, store the parameter index in LLVMArgInfo. 2015-11-04 01:50:49 -05:00
Zoltan Varga 3e4c0ddb3e [llvm] Add new llvm argument passing conventions for passing/returning scalar arguments by ref. Not yet used. 2015-11-04 00:08:47 -05:00
Rodrigo Kumpera 7a6fbd1ec5 Merge pull request #2193 from kumpera/loader-error-cleanup2
Get do_mono_metadata_parse_type to use MonoError
2015-11-03 23:51:09 -05:00
Joel Martinez 85bde33bf2 [monodoc] Fixed several issues with .ToEcmaCRef method.
In particular:

- Issues with cref formatting for subtypes.
- Added support for Explicitly implemented members.
- Added support for generic member parameters.

A number of unit tests were added to verify this functionality.
2015-11-03 15:13:51 -05:00
Zoltan Varga f3cc45dec2 Merge pull request #2194 from alexrp/ppdb-status-crash
[ppdb] Fix a crash caused by mono_ppdb_load_file ().
2015-11-03 12:53:07 -06:00
Alexis Christoforides 7ebb60c061 [coop] Make sure 'gc_stackdata' is aligned and properly sized.
The size of the gc_stackdata buffer was not a multiple of 8 bytes on 64-bits, so sgen_conservatively_pin_objects_from () would address invalid memory on its last iteration, as it progresses down the buffer by pointer size. The function also expects memory references to be aligned.

This is still not a guarantee that we are aligning memory references properly as two misaligns will still give the right size, but we can catch some of them here. Proper sizing is a smaller issue because we could always pad.
2015-11-03 10:30:04 -05:00
Alexander Köplinger f2c46dbf7a [acceptance-tests] Bump coreclr to pick up c1f0812bd0f94f085eb29199ef3b5bd69eab24bb: 2015-11-03 16:00:42 +01:00
Ludovic Henry 1a1711625d Merge pull request #2195 from alexrp/tp-ms-io-trace-crash
[threadpool-ms-io] Fix some crashy mono_trace () calls.
2015-11-03 13:54:16 +00:00
Ludovic Henry 334a08dd39 [mini] Add safepoint support for all platforms 2015-11-03 13:50:00 +00:00
Alex Rønne Petersen 9e4a6b484a [threadpool-ms-io] Fix some crashy mono_trace () calls.
The format strings declared a string argument that wasn't being passed so the
underlying format function crashed when trying to retrieve it.
2015-11-03 14:35:16 +01:00
Alex Rønne Petersen 9cde395cfa [ppdb] Fix a crash caused by mono_ppdb_load_file ().
As the `status` variable wasn't being passed along, the image loading code
would crash trying to set it.
2015-11-03 13:26:51 +01:00
Marek Safar b73f81c331 Merge pull request #2190 from Numpsy/AddADNotFoundException
Add stub implementation of ActiveDirectoryObjectNotFoundException
2015-11-03 10:24:10 +01:00
Ludovic Henry dd80d00810 Merge pull request #2192 from kumpera/suspend-crossfire
[suspend] Fix suspend race between mono-threads and sgen suspend when using the posix backend.
2015-11-03 09:11:46 +00:00
Rodrigo Kumpera 7748ab962a [mono-error] Add MonoError to do_mono_metadata_parse_type and remove some of the type parsing scaffolds. 2015-11-03 01:13:03 -05:00
Rodrigo Kumpera 8b43ae37a1 [mono-error] Add MonoError to do_mono_metadata_parse_generic_class. 2015-11-03 01:02:43 -05:00
Rodrigo Kumpera 1534ecf948 [mono-error] Change mono_metadata_parse_generic_inst to use MonoError. 2015-11-03 00:37:09 -05:00
Rodrigo Kumpera b7d5b8fa7a [mono-error] Introduce MonoError into mono_metadata_parse_generic_param. 2015-11-02 23:11:14 -05:00
Alexander Köplinger 0a21d32286 [acceptance-tests] Make sure the latest version of coreclr-testlibrary.dll is in test directory
Also switch to creating symlinks instead of copying the file.
2015-11-03 02:00:37 +01:00
Rodrigo Kumpera 468a6629b3 [suspend] Fix suspend race between mono-threads and sgen suspend when using the posix backend.
The problem happens when a thread is left suspended by mono-threads and sgen tries to suspend it.

The signal mask of sigsuspend call in mono-threads didn't include sgen's suspend signal, making
it impossible for sgen to suspend it.

The fix is to include sgen's suspend signal into mono-threads sigsuspend mask. This way sgen
suspend can nest over mono-thread's.

The opposite is not needed as sgen never leaves threads suspended when it finishes and it holds
the suspend lock the whole time, making it impossible for mono-threads to initiate any suspend operation.
2015-11-02 19:19:56 -05:00
Vlad Brezae 7b05a82b56 [sgen] Finish concurrent collection if the heap grows too much
In order to achieve this, when asked to do a major collection, we finish the concurrent collection immediately, regardless if we are explicitely requested or not to wait_to_finish.
2015-11-03 02:07:28 +02:00
Vlad Brezae d579f812fb [sgen] Create constant for heap growth allowance 2015-11-03 01:33:30 +02:00
Vlad Brezae 624b8764d7 Merge pull request #2081 from BrzVlad/feature-concurrent-work
Concurrent sgen improvements
2015-11-03 01:05:50 +02:00
Alexander Köplinger e9e2ffd765 [acceptance-tests] Output test list to file in chunks
On Jenkins we get a "make: execvp: /bin/sh: Argument list too long" error while executing the coreclr-runtest-basic target.
Since the shell doesn't like echoing our (very) big list of CoreCLR tests in one go, we need to split it up into chunks of
100 entries to hopefully avoid that.
2015-11-02 22:44:56 +01:00
João Matos 3adcd34f78 Merge pull request #2191 from LogosBible/mono_amd64_have_tls_get
Add support for version of pthread_getspecific when launching from Xc…
2015-11-02 21:10:41 +00:00
Martin Potter 061f993b68 Add support for version of pthread_getspecific when launching from Xcode with LLDB attached. 2015-11-02 12:02:01 -08:00
Ludovic Henry e161b61b3d [trace] Synchronize output 2015-11-02 18:47:12 +00:00
Alexander Köplinger 7f5aca14d2 [mono] Rename NUnit xml result files to TestResult-{0}.xml convention
This is the convention used in other parts of the repo like mcs/, so we should try to be consistent here.
2015-11-02 19:21:01 +01:00
Alexander Köplinger 922d4e2150 [acceptance-tests] Remove some tests that were removed upstream
Also bump coreclr to pick up latest commit.
2015-11-02 19:21:01 +01:00
Ludovic Henry dbe9e55cac [threads] Remove assertion on info for socket syscall abort
This would trigger a crash with XS on clean process exit, due to the
assertion at socket-io.c:2757.

This fixes bug 35429
2015-11-02 18:17:48 +00:00
Alexander Köplinger 6329627590 [System.Core] Make sure DateTime.AddDays() is preserved by the linker in a test
We use the method in the code instead of just via reflection.
This allows the test to work on iOS device builds.
2015-11-02 18:11:45 +01:00
Richard Webb c5216a035f Add stub implementation of ActiveDirectoryObjectNotFoundException
largely copied from ActiveDirectoryOperationException
2015-11-02 16:32:44 +00:00
Marek Safar e1a33279d4 [mcs] Add codegen for try-finally block with unreachable closing brace. Fixes #35401 2015-11-02 14:45:28 +01:00
Marek Safar 3acfdddfa6 Merge pull request #2186 from ruediger-stevens/master
Exception serializes the InnerException as System.Exception
2015-11-02 14:22:00 +01:00
Alexander Köplinger 382b6f0622 [acceptance-tests] Reenable some tests now that #35410 is fixed 2015-11-02 12:30:54 +01:00
Marek Safar 12b806a08a [mcs] add new test 2015-11-02 11:07:27 +01:00
Marek Safar 31a147d5ad [mcs] Add sbyte type to the list of valid cast tokens. Fixes #35410 2015-11-02 11:07:26 +01:00
[email protected] cf7f5272e2 Exception serializes the InnerException as System.Exception not as it's run-time type.
This makes serialization consistent with deserialization (where the InnerException is already retrieved as System.Exception explicitly).
Additionally it may allow serializers more options in serializing inner exceptions (i.e. fall back to System.Exception if the specific exception is not serializable itself).
2015-11-02 11:04:25 +01:00
Marek Safar 8cea0931f9 Merge pull request #2185 from akoeplinger/json-move
[System.ServiceModel.Web] Remove old copy of S.R.Serialization.Json
2015-11-02 08:40:04 +01:00
Zoltan Varga 67d2defa3d Fix an obsolete comment. 2015-10-31 23:06:19 -04:00
Alexander Köplinger 308d25f67f [System.ServiceModel.Web] Move System.Runtime.Serialization.Json tests into System.Runtime.Serialization assembly
That's where they belong on .NET 4.5+

Additionally, add a test case from https://bugzilla.xamarin.com/show_bug.cgi?id=4230
2015-10-31 01:10:35 +01:00
Alexander Köplinger 8c634bacbf [System.ServiceModel.Web] Remove old copy of System.Runtime.Serialization.Json
We don't need this here anymore since it moved to System.Runtime.Serialization.dll in
.NET 4.5 and 54f7c82d2b.

This copy is just confusing and not even built anymore, so delete it.
2015-10-31 01:01:15 +01:00
Martin Baulig d1b4e3adb9 [Mono.Security]: Add 'MonoTlsSettings.TrustAnchors' and 'CertificateValidationHelper.SupportsTrustAnchors'.
This is currently only supported on iOS and Mac (check 'CertificateValidationHelper.SupportsTrustAnchors')
and will pass a set of trusted root certificates to the OS validation function.  Use for self-signed
certificates instead of providing a custom callback.
2015-10-30 16:42:44 -04:00
Alexander Köplinger 18b9eb403f [acceptance-tests] Pull in new CoreCLR tests added upstream
A bunch of tests were added in the upstream repo, add those to the source listings.

There's a suite of tests in the CoreMangLib folder which are mostly testing corelib,
added a separate target "coreclr-runtest-coremanglib" for it and renamed the existing
target to "coreclr-runtest-basic".

Build and link all cs testcases with the coreclr-testlibrary.dll which enables a
few more tests to run.
2015-10-30 21:21:59 +01:00
Alexander Köplinger 68ea7c01b8 [acceptance-tests] Bump coreclr to pick up 3b2969dffe191b03f1ac85a9c1e62417c9b7833b: 2015-10-30 21:21:59 +01:00
Alexander Köplinger d206710c6f [acceptance-tests] Add prefix in commit message for the bump commit helper
Additionally remove 'git pull', it doesn't work when no tracking branch is set and I can easily pull myself if I want to.
2015-10-30 21:21:58 +01:00
Martin Baulig a4b77da187 Put back "[Mono.Security.Providers.OldTls]: Include all the sources from the old TLS implementation here."
The build problem should now be fixed.

This reverts commit 5a7c0a0d4c.
2015-10-30 14:33:28 -04:00
Martin Baulig 1ea0a0e2bb [System/TLS]: In ChainValidationHelper, remove the overloads taking 'Mono.X509' certificates. 2015-10-30 14:33:27 -04:00
Martin Baulig 71a74c068b [Mono.Security]: On mobile, 'Mono.Security.Interface.CertificateValidationHelper' becomes public in System.dll. 2015-10-30 14:19:52 -04:00
Martin Baulig 5a7c0a0d4c Revert "[Mono.Security.Providers.OldTls]: Include all the sources from the old TLS implementation here."
This does not build on Mobile yet.

This reverts commit 9147778ee8.
2015-10-30 14:05:34 -04:00
Martin Baulig 9147778ee8 [Mono.Security.Providers.OldTls]: Include all the sources from the old TLS implementation here. 2015-10-30 13:16:23 -04:00
Martin Baulig 10c67fe6bd [System]: Cleanup 'ChainValidationHelper', moving the actual validation code into a new class.
The actual validation code now lives in 'SystemCertificateValidator', whereas
'ChainValidationHelper' contains all the glue code which deals with 'ServicePointManager',
user-supplied callbacks, etc.
2015-10-30 12:41:09 -04:00
Rodrigo Kumpera bb4339cc16 [mono-error] Introduce MonoError into mono_metadata_parse_array_internal. 2015-10-30 11:29:34 -04:00
Jonathan Pryor 0eb394dab5 Merge pull request #2152 from joelmartinez/mdoc-preserver
[mdoc] Marking `MDocPreserve` Obsolete.
2015-10-30 10:13:56 -04:00
Zoltan Varga 3be72d90bf [sdb] Add a fastpath to process_single_step_inner () for single stepping during invokes. 2015-10-30 00:16:41 -04:00
Zoltan Varga c8b29395b5 [llvm] Add names for some temporary variables representing got slots. 2015-10-30 00:16:41 -04:00
Martin Baulig 8c1d0d4efe [System/TLS]: On desktop, allow dynamic loading of the TLS Provider at runtime.
To do this, set the MONO_TLS_PROVIDER environment variable to either "default",
"newtls", "oldtls" or the full assembly-qualified type name of the MonoTlsProvider
(in this case, the class needs to derive from MonoTlsProvider and have a public
parameterless constructor and it needs to be installed in the GAC).
2015-10-29 17:41:35 -04:00
Ludovic Henry fe3063c464 [coop] Fix typo for gc unsafe region enter/exit
The idea is to get the address of the top of the stack, so passing a
value is meaninless. This was a typo. It also fixes libtest.c which
used an outdated signature.
2015-10-29 20:38:29 +00:00
Martin Baulig 3fda636ef7 [Mono.Security]: Add new MonoTlsProviderFactory.CreateHttpListener() API to create a HttpListener.
This new method lets you create a 'HttpListener' and specify the X509Certificate2 to use
(so you don't have to put it into ~/.config/.mono/httplistener) as well as an optional
'MonoTlsProvider' and optional 'MonoTlsSettings'.
2015-10-29 15:55:36 -04:00
Rodrigo Kumpera 2db8d363f3 Merge pull request #2180 from kumpera/loader-error-cleanup
This is a small batch of MonoError cleanups.
2015-10-29 15:53:01 -04:00
Martin Baulig 0e956c0902 [System]: Use the new 'MonoTlsProvider' framework in 'HttpListener'.
This makes 'HttpListener' use 'SslStream', which can now switch the
TLS implementation at runtime.
2015-10-29 15:52:31 -04:00
Martin Baulig 790a6380be [System/TLS]: In LegacySslStream, call SslServerStream's .ctor and request, but not require a client certificate.
In SslStream.AuthenticateAsServer(), setting 'clientCertificateRequired' to true will ask for a client
certificate and - if the client does not provide one - invoke the 'RemoteCertificateValidationCallback'
with null and 'SslPolicyErrors.RemoteCertificateNotAvailable' - but resume the handshake if this callback
returns true.
2015-10-29 15:52:31 -04:00
Rodrigo Kumpera 49e58bad2a Fix windows build. 2015-10-29 15:51:58 -04:00
Zoltan Varga 9d9a3ed290 [llvm] Cleanup the code in process_call () a bit. 2015-10-29 15:47:37 -04:00
Martin Baulig 3fe564b459 Oops, also need to set it when cloning. 2015-10-29 15:35:15 -04:00
Martin Baulig ad982a5ceb [Mono.Security]: Add 'MonoTlsSettings.EnabledProtocols' property.
This is currently only used by the new TLS code, but allows to override
the protocol.
2015-10-29 15:17:15 -04:00
Martin Baulig f2aedc29ed [NewSystemSource]: Pass down the 'IMonoTlsProvider' to SSPIWrapper.
This should fix the issue where you pass 'NewTlsProvider' as custom provider
without installing it as the default.
2015-10-29 15:05:21 -04:00
João Matos 161aa4387b Merge pull request #2182 from lewurm/fix-arm-build
mini-llvm: fix wrong usage
2015-10-29 18:36:36 +00:00
Bernhard Urban 3c51ad2e21 mini-llvm: fix wrong usage 2015-10-29 11:31:19 -07:00
Ludovic Henry 5fb2e37f0c [tests] Adjust MathTest double epsilon value
The double.Epsilon value represent the smallest value that double is
able to represent. And that is diferent from the machine epsilon, which
is the smallest difference between two double values.

The second is equal to 2 ^ (-52), because there are 52bits to
represent the mantissa in a IEEE 754 double.
2015-10-29 18:17:54 +00:00
Zoltan Varga 98222ba10c [llvm] Split sig_to_llvm_sig () into two versions, one which takes an LLVMCallInfo argument, and one which doesn't. 2015-10-29 13:40:25 -04:00
Martin Baulig 7a38dad045 Comment-out [HostProtection] attribute in SslStream.cs, it seems to be causing problems. 2015-10-29 13:08:18 -04:00
Zoltan Varga 13b5202890 [runtime] Disable the -Wreturn-stack-address clang warning. 2015-10-29 13:07:02 -04:00
Ludovic Henry 45fffb5201 [threads] Fix warning on Linux 2015-10-29 16:37:49 +00:00
Neale Ferguson 7471d303d3 s390x-codegen.h - Initial SIMD support
cpu-s390x.md - Add gc-safe-point instruction
mini-ops.h - Add TARGET_S390X for gc-safe-point
mini-s390x.c - Initial SIMD support; Fix floating point conversion
mini-s390x.h - Initial SIMD support
2015-10-29 10:31:24 -04:00
Rodrigo Kumpera df4951fc2d [mono-error] Introduce mono_metadata_parse_type_checked variant that uses MonoError. 2015-10-29 02:25:06 -04:00
Rodrigo Kumpera 8ee9b71381 [mono-error] Introduce MonoError in compare_type_literals. 2015-10-29 02:25:06 -04:00
Rodrigo Kumpera edaf5b692a [metadata] Remove dead MonoParseTypeMode argument from non public functions. 2015-10-29 02:25:05 -04:00
Rodrigo Kumpera 2780a0ca70 [loader-error] mono_metadata_parse_method_signature is no longer used by the runtime, so remove loader error handling from it. 2015-10-29 02:25:05 -04:00
Zoltan Varga 385722223b [llvm] Clean up the naming convention in the backend. 'module' refers to a MonoLLVMModule while 'lmodule' refers to a LLVMModuleRef. Some other small cleanups. 2015-10-28 20:56:12 -04:00
Zoltan Varga 13bdaa17f7 [llvm] Merge LLVMCallInfo and LLVMSigInfo. 2015-10-28 20:38:56 -04:00
Martin Baulig 980ecc2c79 [System]: Replace the 'SslStream' implementation with a proxy that's using the 'MonoTlsProvider' layer.
This allows consumers of the 'SslStream' class to take full advantage of
the new TLS switcher code.
2015-10-28 20:28:09 -04:00
Martin Baulig 0d848ee397 [Mono.Security]: It is legal for a TlsClientCertificate message to contain no certificates. 2015-10-28 19:12:48 -04:00
Zoltan Varga c4ee855204 Fix the build, the stub for mono_llvm_cpp_throw_exception () was inside a DISABLE_JIT ifdef block. 2015-10-28 18:45:25 -04:00
Martin Baulig 82b0741f35 Fix my last commit. 2015-10-28 18:38:43 -04:00
Martin Baulig a76f2dcb0c [Mono.Security]: Rename 'MonoTlsSettings.ServerCertificateValidationCallback' into 'RemoteCertificateValidationCallback'.
This callback is also used to validate client-certificates when using SslStream in server-mode.
2015-10-28 18:26:55 -04:00
Martin Baulig 161997beb4 Don't pass a 'null' hostname to the system validator as it would crash. 2015-10-28 18:20:28 -04:00
Martin Baulig 799361d19f Kill dead code. 2015-10-28 18:20:28 -04:00
Zoltan Varga c222e037c0 [runtime] Handle the conditional compilation of llvm-runtime.cpp at the automake level since including a c++ file into a c project seems to cause linking problems on some platforms. 2015-10-28 17:31:19 -04:00
Zoltan Varga a02b62eba8 [runtime] Add a configure check for unwind.h 2015-10-28 17:22:11 -04:00
Zoltan Varga 97d6e5bb33 [profiler] Avoid a crash at shutdown by installing the assembly unload hook for the 'start_unload' event instead of the 'end_unload' event, the latter receives a mostly freed assembly. 2015-10-28 15:05:02 -04:00
Ludovic Henry a4ac636499 [threads] Use runtime flag to enable cooperative suspend
To enable cooperative suspend, simply set the MONO_ENABLE_COOP
environment variable.
2015-10-28 18:46:29 +00:00
Ludovic Henry b6ae9f231a Merge pull request #2179 from BogdanovKirill/enummodulesfix
[Processes] Memory leak fix in EnumProcessModules function
2015-10-28 18:27:52 +00:00
Zoltan Varga f538588ed1 Fix the build. 2015-10-28 14:27:23 -04:00
Martin Baulig 29531a29a5 Use 'using SD = System.Diagnostics' to avoid ambiguous references. 2015-10-28 14:14:48 -04:00
Ludovic Henry 39508e2285 [test-runner] Improve output 2015-10-28 17:11:21 +00:00
Ludovic Henry 76a1b2fbff [Process] Catch the closing of handle 2015-10-28 17:11:21 +00:00
Ludovic Henry 0d7364c4e4 [Process] Do not count the output/error wait in the timeout of WaitForExit 2015-10-28 17:11:20 +00:00
João Matos 0a59fc580e [runtime] Fixed the non-LLVM build. 2015-10-28 16:30:54 +00:00
Zoltan Varga 2829922474 Fix the windows build. 2015-10-28 11:07:42 -04:00
Ludovic Henry 5e52db585e [threads] Fix race between async suspend and compensation
The race only happens on Posix with unified suspend.

The chain of event is the following:
- T1 suspend the world (calls `sgen_unified_suspend_stop_world`)
- T2 is async suspended
- T2 execute suspend_signal_handler:
 - T2 finish async suspend
 - T2->suspend_can_continue is set to FALSE as the thread is detaching
 - T2 notify T1 via `mono_threads_notify_initiator_of_suspend`
 - T2 is yielded (via the OS scheduler, or forced via a `sleep`)
- T1 returns from `mono_threads_wait_pending_operations`
- T1 does its stuff
- T1 restart the world
- T1 (or any another thread, except for T2) suspend the world (it does not
  necessarily uses `sgen_unified_suspend_stop_world`)
- T2 is async suspended: incrementation of T2->suspend_count to 2, but it is
    not signalled because it is already in ASYNC_SUSPENDED state
- T2 wakes up (for any reason) and execute compensation <- ERROR: suspend_count != 1

This race can happen because when async suspending, we notify the
suspendor before executing the compensation, in this case for a thread
which is detaching. By simply post-ponning the notification, just after
the compensation, we eliminate this race.
2015-10-28 14:34:56 +00:00
Alex Rønne Petersen 6d15e070af [runtime] Actually clean up context-static data segments. 2015-10-28 15:31:28 +01:00
Alexander Köplinger 2684e2fc3c [acceptance-tests] Write list of CoreCLR tests into file and pass it to test-runner
This shaved about 30 seconds off the time until the test-runner started on my machine compared to
passing the tests in the command line directly (we have *lots* of CoreCLR tests).
2015-10-28 14:37:14 +01:00
Alexander Köplinger f081757742 [test-runner] Add a new --input-file option for reading the test list from a file 2015-10-28 14:37:14 +01:00
Alexander Köplinger ae671ad548 [test-runner] Fix bug in commandline option parsing
i+i doesn't make sense, it should be i+1 (the next argument after the current one).
2015-10-28 14:37:13 +01:00
Ludovic Henry 45ba0107ea [tests] Add coreclr GC stress tests 2015-10-28 13:18:10 +00:00
Ludovic Henry b58fc1009b [tests] Try to fix finalizer-wait 2015-10-28 13:13:48 +00:00
Ludovic Henry c2743ba703 [tests] Fix Math.Pow precision bug on Android 2015-10-28 11:17:39 +00:00
BogdanovKirill fbf4295a9b [Processes] Memory leak fix in EnumProcessModules function
The main point is that get_process_name_from_proc's result string is never released.

This change is released under the MIT license.
2015-10-28 16:15:08 +05:00
Alex Rønne Petersen 096a78ef24 [profiler] Disable 'time went backwards' debug message.
While this would have indicated a bug in the past, it's perfectly normal now
due to how we synthesize TYPE_JIT events to ensure sane event ordering.
2015-10-28 11:25:28 +01:00
Zoltan Varga e7536f6e29 [runtime] Use Unwind_Backtrace only on platforms which support it. 2015-10-27 21:04:01 -04:00
Zoltan Varga af8a03e25c [llvmonly] Add support for direct calls to icalls. 2015-10-27 20:57:16 -04:00
Martin Baulig 6d7a1e4a09 [System/TLS]: Don't crash when we're called without user-supplied certificate validator. 2015-10-27 17:39:10 -04:00
Alexander Köplinger c9dff536ad [acceptance-tests] Move CoreCLR submodule reference to Mono fork 2015-10-27 22:22:45 +01:00
Martin Baulig c3f236a79d Oops, there is no README.md 2015-10-27 15:47:40 -04:00
Martin Baulig 54d4cfaf60 Oops, forgot to add to the top-level Makefile for mobile. 2015-10-27 15:45:27 -04:00
Alexander Köplinger 36a89209fe [test-runner] Filter out invalid XML chars before writing to XML
The test-runner crashed sometimes when running the CoreCLR testsuite with the following exception:
"System.ArgumentException: '', hexadecimal value 0x0F, is an invalid character." when trying to
emit the NUnit xml.

The stacktrace of one of the failing tests contained the character 0x0F which is invalid in XML,
we now filter out those invalid chars.
2015-10-27 20:37:34 +01:00
Martin Baulig 1c248829d4 [Mono.Security.Providers.OldTls]: New assembly.
This provides a 'MonoTlsProvider' for Mono's existing TLS implementation.

It's simply a public frontend for the internal 'LegacySslStream' class.
2015-10-27 14:29:07 -04:00
Martin Baulig 1367b2e744 [System]: Make internals visible to Mono.Security.Providers.OldTls. 2015-10-27 14:29:07 -04:00
Vlad Brezae a53462999d [sgen] Fix marking of cards on 64bit 2015-10-27 20:25:05 +02:00
Mark Probst 7f84c3c9e7 [sgen] Fix call to InterlockedCompareExchange().
This fixes random crashes on `sgen-weakref-stress.exe`.
2015-10-27 10:56:03 -07:00
Radek Doulik 0bebfa7eba [linker] match type pattern with nested types
- this way the following xml will match all the types in the assembly
   MyAssembly

    <linker>
        <assembly fullname="MyAssembly">
            <namespace type="*" />
        </assembly>
    </linker>

   before this change it will only match the types defined in main
   module and none of the nested types
2015-10-27 18:32:28 +01:00
Alexander Köplinger 825033f5b0 [acceptance-tests] Append a suffix to the CoreCLR IL tests
Some of the tests have both a test.il and test.cs in the same folder, which means we would
generate an .exe with the same name and overwriting one of them.

This is avoided by appending a _il suffix to the IL tests.
2015-10-27 18:19:58 +01:00
Andi McClure 7de63f4d2e Merge pull request #2163 from xmcclure/image-audit
Mempool reference-auditing feature in checked builds
2015-10-27 11:49:36 -04:00
"Andi McClure ext:(%22) 4c0b47d580 This introduces three macros, to be used in place of a simple pointer assignment when working with images or imagesets:
CHECKED_METADATA_WRITE_PTR - Use this to assign a pointer when it points from memory hosted by an image or imageset to another.
CHECKED_METADATA_WRITE_PTR_LOCAL - Use this to assign a pointer when it points from memory noted by an image or imageset to itself.
CHECKED_METADATA_WRITE_PTR_EXEMPT - Use this to assign a pointer in memory hosted by an image or imageset, but which the audit feature cannot correctly check at this time (this is the case when an image must contain a pointer to something that is not located in a mempool, such as a constant string). This is so that at least we know where these exceptions to the audits are.

In non-checked mode, each of these is a simple assignment. In checked mode, they walk the graph of references between images to make sure invariants related to ref_count are not violated.
2015-10-27 11:41:41 -04:00
João Matos 173b4bce54 [runtime] Normalize include style. 2015-10-27 14:38:44 +00:00
Andi McClure b5ec396a79 Merge pull request #2175 from xmcclure/pre-image-audit
Mempool reference-auditing feature in checked builds (prep work only)
2015-10-27 10:20:33 -04:00
"Andi McClure ext:(%22) b2f532b354 Simplify function interface for rework of image.c hashes, based on PR comments 2015-10-27 09:35:57 -04:00
João Matos 13262d3bad [runtime] Fixed cross-compile LLVM build. 2015-10-27 11:48:41 +00:00
Ludovic Henry 29e84f47af [test-runner] Make sure to close resources hold by Process 2015-10-27 11:48:14 +00:00
Ludovic Henry 85299820fd [Process] Use output/error stream instead of naked handle
This is to make sure the handle is closed, whenever we close the streams
2015-10-27 11:48:13 +00:00
Alexander Köplinger b1bddffb50 [test-runner] Make the --testsuite-name option required
Defaulting to a value doesn't make sense since the NUnit xml would be overwritten if multiple tests used the same default.
2015-10-27 12:46:31 +01:00
João Matos 46f353a289 [runtime] Added --with-cross-offsets configure option for including an explicit AOT cross offsets file.
This option will define MONO_OFFSETS_FILE which will be used by the rest of the code to include the right file when looking for cross offsets.
2015-10-27 11:40:56 +00:00
Marek Safar 6262c487d3 [mcs] Declared fields cannot have unmanaged check done before all types are defined. Fixes #35269 2015-10-27 10:19:58 +01:00
Zoltan Varga 639f1f6527 [llvmonly] Fix EH when llvm is disabled. 2015-10-27 00:31:34 -04:00
Vlad Brezae 5d6f1d6d82 [sgen] Add optimized drain stack functions for the concurrent collector 2015-10-27 00:32:35 +02:00
Vlad Brezae 194e86b53f [sgen] Simply the usage of the optimized drain stack function
If we support an optimized drain stack function we provide it in the object operations structure.
2015-10-27 00:32:35 +02:00
Vlad Brezae 2bddf1cf6a [sgen] Remove dead defines 2015-10-27 00:32:35 +02:00
Vlad Brezae 3137468f10 [sgen] Simplify prototype of drain gray stack function
The function only needs the gray queue since it is tied to the object operations.
2015-10-27 00:32:35 +02:00
Vlad Brezae 5f40205bdb [sgen] Finish the concurrent collection only on the gc thread
For now, there is no benefit in using worker threads, just added complexity
2015-10-27 00:32:35 +02:00
Vlad Brezae d3b947125b [sgen] Explicitly indicate if we run jobs on the worker thread 2015-10-27 00:32:34 +02:00
Vlad Brezae f4a472d780 [sgen] Remove unused object operations 2015-10-27 00:32:34 +02:00
Zoltan Varga 9c4371dbc3 [llvmonly] Fix an assertion for methods with many arguments. 2015-10-26 18:32:13 -04:00
Zoltan Varga a6b766f061 [llvmonly] Fix the computation of the generic context used to initialize shared methods, previously we would be using the context of the class of the receiver, but that wouldn't work when its a non-generic class inheriting from a generic class. Use the context of the method which was used to lookup the shared method in the first place instead. 2015-10-26 18:28:50 -04:00
Mark Probst eee225412a [sgen] Fix binary protocol limit default.
`size_t` is unsigned, so using `-1` by default will always impose a
limit, and make binary protocol file names numbered, which is not
usually what you want or expect.
2015-10-26 15:04:59 -07:00
Ludovic Henry 839d6fcf79 [Process] Close process in/out/err handle on Process dispose
This would lead to leaked handle, and that would be visible when running
the test suite on Jenkins, with a "Too many open files" exception.

That also reverts the behavior to before 789808b507
2015-10-26 22:02:36 +00:00
"Andi McClure ext:(%22) 596558054c Rework “image hashes” in image.c to segregate by-path and by-name lookups into two hashes
This is part of the continued cleanup work for the mempool reference auditing feature. Separating the hashes prevents redundant work when iterating over hashes, something the reference auditor does a lot. External interface to image.c still behaves the same.
2015-10-26 16:04:28 -04:00
"Andi McClure ext:(%22) e2ebba38eb Continued cleanup in preparation for mempool reference auditing feature
- Fixes to comments and the mempool rework, based on pull request comments
- Additional comments overall
2015-10-27 09:37:44 -04:00
Zoltan Varga d9555d36e2 [llvm] Fix aot support in non-llvmonly mode. 2015-10-26 15:17:50 -04:00
Zoltan Varga 6400b43ff8 [llvmonly] Avoid disabling llvm for methods with pinvoke signatures in llvmonly mode. 2015-10-26 14:58:11 -04:00
Zoltan Varga ba3f04a3a0 [llvm] Register the llvmonly icalls even if llvm is not enabled. 2015-10-26 14:57:45 -04:00
Zoltan Varga 6fbbad9506 Fix the non-llvm build. 2015-10-26 13:52:29 -04:00
Ludovic Henry a92a2ea392 [tests] Add timeout before failing 2015-10-26 16:35:14 +00:00
Ludovic Henry f8ea020356 [tests] Increase timeout before failing 2015-10-26 15:50:25 +00:00
Marek Safar ef164ac483 [mcs] Support auto-property with private setter with member definition from external assembly. Fixes #35236 2015-10-26 16:45:36 +01:00
Ludovic Henry 23a11611ec [tests] Increase timeout before failing 2015-10-26 14:13:03 +00:00
Ludovic Henry ba5f03e4ab [tests] Add --testsuite-name to avoid overwritting test result XML files 2015-10-26 12:30:34 +00:00
Ludovic Henry 9928ba3070 [tests] Use test-runner to run unhandled-exception tests 2015-10-26 10:58:51 +00:00
stukselbax fccd4b01a7 Make "https" scheme only when Transport security mode is ON
The behavior of the WebHttpBinding in case of SecurityMode ==
WebHttpSecurityMode.TransportCredentialOnly must use the http scheme, in
order to allow authentication of the client based on the standard HTTP
headers, like WWW-Authenticate: Scheme realm="" and so on. This behavior
is the default in .net;
2015-10-26 13:29:35 +03:00
stukselbax 9f333557cc Merge remote-tracking branch 'refs/remotes/mono/master' 2015-10-26 13:22:55 +03:00
Zoltan Varga 53a79d1b6b Add another missing file. 2015-10-25 22:17:01 -04:00
Zoltan Varga 78ddbe562a Add a missing file. 2015-10-25 22:16:38 -04:00
Zoltan Varga 3b42c2d45d [llvm] Move the EH support code into mini-exceptions.c, and the c++ functions used by it into a new llvm-runtime.cpp file so llvmonly code works in a runtime which doesn't have llvm enabled. 2015-10-25 22:15:39 -04:00
Zoltan Varga 992e9b0349 [llvm] Fix support for asmonly+llvmonly by emitting the bitcode into the file given by the llvm-outfile aot option. 2015-10-25 22:15:38 -04:00
Zoltan Varga 8ba60facb7 Merge pull request #2166 from ermshiperete/FontHeight
[WinForms] Check for null font Height
2015-10-24 01:09:51 -04:00
Zoltan Varga 51f42669b2 [profiler] Create a static version of libmono-profiler-log which doesn't link against eglib, to prevent duplicate symbols errors when its linked with the runtime. Fixes part of #29745. 2015-10-23 23:20:31 -04:00
Zoltan Varga b6ca4765ef [arm] Add a comment for a hack. 2015-10-23 20:53:50 -04:00
Zoltan Varga 348c46afce [arm64] Implement mono_threads_core_begin_async_resume () for arm64. 2015-10-23 19:22:54 -04:00
Aleksey Kliger (λgeek) 74020f8e44 Merge pull request #2171 from lambdageek/dev/fix-marshal
[coop] One more pair of coop gc marshal fixes.
2015-10-23 18:38:41 -04:00
Mark Probst d53d83c40f [sgen] Documentation about future-proofing the binary protocol.
We want to use the binary protocol to measure GC pause times in the
benchmarking suite.  To make that easier and be able to go back and
(re-)benchmark older versions, we'd like the binary protocol format to
be backwards compatible.
2015-10-23 15:17:41 -07:00
Zoltan Varga e2f28334c9 Add a new Moono_GetStackTraces method to Thread which can be used to obtain stack traces for all running threads. 2015-10-23 17:07:06 -04:00
Aleksey Kliger 49fc72f0a8 [coop] One more pair of coop gc marshal fixes.
Missed a pair of
`mono_threads_reset_blocking_start`/`mono_threads_reset_blocking_end`
calls in 991e3ef3e4
2015-10-23 16:15:57 -04:00
Martin Baulig 35411c095d Remove a few more 'using System.Reflection's. 2015-10-23 16:05:19 -04:00
Martin Baulig 96b35a3b8c [Mono.Security]: Use the new 'NoReflectionHelper' instead of reflection in 'MonoTlsProviderFactory'. 2015-10-23 16:03:05 -04:00
Mark Probst 480a083eef [sgen] Add some bridge documentation. 2015-10-23 12:54:23 -07:00
Zoltan Varga 97c49c90aa Merge pull request #2170 from alexanderkyte/mini_llvm_archfix
[runtime] Fix support for amd64 in mini-llvm-cpp.cpp
2015-10-23 15:10:43 -04:00
Alexander Kyte b7476c8a53 [runtime] Fix support for amd64 in mini-llvm-cpp.cpp 2015-10-23 15:01:43 -04:00
Martin Baulig 9da940dd64 [System]: Add internal 'Mono.Net.Security.NoReflectionHelper' class to avoid reflection use. 2015-10-23 14:20:46 -04:00
Martin Baulig f1315fad37 Remove 'using System.Reflection'. 2015-10-23 13:58:31 -04:00
Martin Baulig 55dfc6be38 [Mono.Security]: Access System.dll's internals directly instead of using reflection. 2015-10-23 13:57:15 -04:00
Martin Baulig e236462f1b [System]: Make internals visible to Mono.Security. 2015-10-23 13:57:15 -04:00
Alexander Köplinger ad7c70850e [test-runner] Fix a few more hardcoded test suite names
Missed those in 04bdf3b933
2015-10-23 19:34:35 +02:00
Ludovic Henry 49f6d88894 [test-runner] Wait synchronously for process exit
There was still a race for the last processes, where we could not
correctly wait for them to exit, before closing the StreamWriter for
stdout and stderr.
2015-10-23 18:04:45 +01:00
João Matos c050b0aecc Merge pull request #2168 from BillSeurer/llvm
[ppc] Activate llvm for power
2015-10-23 16:59:12 +01:00
Bill Seurer cdfa7d69fa [ppc] Activate llvm for power 2015-10-23 10:53:07 -05:00
Rodrigo Kumpera e4546727d3 Merge pull request #2165 from lambdageek/dev/marshal-fix
[coop] update native call marshalling to pass thread state transition functions a stack ptr arg.
2015-10-23 10:51:12 -04:00
Ludovic Henry c52b5f88d3 [socket] Use syscall abort mechanism properly
The crash only occurs on Posix platforms.

The assertion error in `mono_threads_begin_global_suspend`
"pending_suspends != 0" arised because of a unproper use of the syscall
abort mechanism.

The signal would have to be send out of a global suspend context, but
in case the call to `mono_threads_pthread_kill` would fail in
`mono_threads_core_abort_syscall`, then we would add a pending
operation, thus increasing the `pending_suspends` counter. But as we
wouldn't call for `mono_threads_wait_pending_operations`, we would never
have a chance to decrement this counter. So next time we would try to
call `mono_threads_begin_global_suspend` we would hit this assertion
error.

The fix is simply to call the abort from inside a global suspend
context, and making sure to wait on pending operations afterwards.
2015-10-23 13:44:16 +01:00
Ludovic Henry 18f06f331e [socket] Enable Shutdown on socket disposal only on specific platforms
This breaks Linux, because a shutdown will cause a recv/recvfrom on the
remote host to return without an error.

This would trigger in System.Net.Sockets.SocketTest.ConnectedProperty.
2015-10-23 13:09:59 +01:00
Jo Shields 49745ffe58 [msvc] Manually update .defs, don't use update-defs Make target 2015-10-23 12:25:28 +01:00
Jo Shields c8f925e898 Revert "[msvc] Update the DLL export definition files."
This reverts commit 90cb172eb8.
2015-10-23 12:24:29 +01:00
Jo Shields 90cb172eb8 [msvc] Update the DLL export definition files. 2015-10-23 12:06:13 +01:00
Brent McCarthy 8528a5d273 [WinForms] Check for null font Height
DrawButtonText was throwing ArgumentException when
button.Font.Height was invalid.
2015-10-23 09:12:57 +02:00
Aleksey Kliger 991e3ef3e4 [coop] update native call marshalling to pass thread state transition functions a stack ptr arg.
mono_threads_prepare_blocking, mono_threads_finish_blocking,
mono_threads_reset_blocking_start, mono_threads_reset_blocking_end all
take a stack pointer argument.  Update the native and managed wrappers
to pass it to them.
2015-10-22 19:11:27 -04:00
Zoltan Varga b76847e195 [runtime] Add a check for PE images to mono_method_body_get_object(). 2015-10-22 18:35:05 -04:00
Zoltan Varga 0da9e0d4a2 Fix the build. 2015-10-22 18:32:53 -04:00
Zoltan Varga 8593c4dddc [runtime] Move the MONO_ENV_OPTIONS parsing code to driver.c 2015-10-22 17:38:18 -04:00
Zoltan Varga 4c6e0df59e Export mono_image_load_cli_header/load_metadata from image.c 2015-10-22 16:48:31 -04:00
Alex Rønne Petersen 0c5b73495c Merge pull request #2162 from alexrp/master
[profiler] Disable the hack to attempt to get code start/size info.
2015-10-22 22:17:38 +02:00
mlancione bd0334c68c Locking Window Handle List
A lock to the EventQueue Window Handle List is required to prevent
multiple threads from modifying the list;
2015-10-22 16:17:32 -04:00
Marek Safar 53980ae648 [corlib] Add non-overlapping buffer MemoryCopy implementation 2015-10-22 21:08:38 +02:00
"Andi McClure ext:(%22) 5fca9da6c7 Cleanup in preparation for mempool reference auditing feature in checked builds
- Rework in mempool.c: Have USE_MALLOC_FOR_MEMPOOLS work by tweaking existing rather than using an entire different path. Remove unused mempool field “rest”, stop assigning fields “pos” and “end” where unused. Removed unused function mono_mempool_empty. Fix off-by-one bug (>= vs >) in mono_mempool_contains_addr.
- Fix misc bug spotted by Rodrigo in aot-runtime.c: image of MonoGenericParam was always being set to corlib instead of proper image
- Add comments and replace inline constants with named constants in various places
2015-10-22 14:15:33 -04:00
Alex Rønne Petersen 355b2979ef [profiler] Disable the hack to attempt to get code start/size info.
This is causing crashes by poking into runtime internals, and since we no
longer need this for anything critical, disable it.

https://bugzilla.xamarin.com/show_bug.cgi?id=35171
2015-10-22 19:49:12 +02:00
João Matos 6e6242b6f7 Merge pull request #2158 from akoeplinger/fix-winforms-tests
[WinForms] Update tests to match recent changes to Control Foreground+Background
2015-10-22 12:37:52 +01:00
João Matos be1d9a7fe2 Merge pull request #2154 from BrennanConroy/bug_30018
More robust get_address_info
2015-10-22 12:37:29 +01:00
Ludovic Henry cbb0f8a26d [threads] Print more information in case of error in global suspend 2015-10-22 11:40:43 +01:00
Jo Shields 7b27732409 Merge pull request #2149 from directhex/absolute-path-for-xcopy
[msvc] Use fully qualified path for xcopy
2015-10-22 08:57:39 +01:00
Alexander Köplinger 19a0488f3a [WinForms] Update tests to match recent changes to Control Foreground+Background
The colors were updated in https://github.com/mono/mono/commit/f412b5529e560bca594e0c29a47f32dcfb252820,
but the tests weren't. This fixes them.
2015-10-22 02:12:39 +02:00
Martin Baulig 587ae60d01 [Mono.Security]: Mark 'HttpsClientStream' as obsolete. 2015-10-21 16:15:57 -04:00
Martin Baulig 5356284e49 [System]: Remove some dead internal code. 2015-10-21 16:13:29 -04:00
Rodrigo Kumpera 5fe98cbad4 Merge pull request #2122 from lambdageek/dev/bug-26384
In Type.FullName, escape ,+&@*[]\ with blackslash. Closes #26384
2015-10-21 16:09:25 -04:00
Marek Safar 2fc03eb1a2 Merge pull request #2155 from akoeplinger/bug-34334-pr
[interpreter] Relax check for forcing compilation for built-in structs
2015-10-21 21:47:38 +02:00
Martin Baulig 87ecbc9ce1 [System]: Use MonoTlsProvider API in WebConnection. 2015-10-21 14:45:26 -04:00
Martin Baulig dd3e9ab28c [System]: Use MonoTlsProvider API in FtpWebRequest and SmtpClient. 2015-10-21 14:36:06 -04:00
Alexander Köplinger 8421ea6a46 [interpreter] Relax check for forcing compilation for built-in structs
Method calls on structs like DateTime wouldn't work before,
even though we know we don't have self mutating structs in mscorlib.

Fixes part 2 of https://bugzilla.xamarin.com/show_bug.cgi?id=34334
2015-10-21 19:38:27 +02:00
Aleksey Kliger 0998ee7128 [reflection] Test for ModuleBuilder.GetType(String) with escaped names 2015-10-21 13:11:35 -04:00
Aleksey Kliger f127f7ea07 [reflection] ModuleBuilder, TypeBuilder escaped type identifiers patch
1. Use the System.TypeSpec parser to parse components of the type name,
then call out to native code to apply the modifiers, as before.

2. TypeName and TypeIdentifier abstractions to hide display name / internal name strings

Update ModuleBuilder and TypeBuilder to use TypeIdentifier and TypeName
internally in all places that don't need to talk to native code.

3. Change ModuleBuilder.name_cache from Hashtable to Dictionary<TypeName, TypeBuilder>
2015-10-21 13:11:34 -04:00
Aleksey Kliger 4bcf555959 [corlib] Test Type.FullName and Type.GetType() with special characters.
Make sure that type names that include +,&*[]\ are properly escaped and
unescaped when displaying and parsing.
2015-10-21 13:11:34 -04:00
Aleksey Kliger 43454a57bb [corlib] ves_icall_Type_GetNestedTypes unescape special chars in wanted nested type name. 2015-10-21 13:11:34 -04:00
Aleksey Kliger d60b224c33 [corlib] System.TypeSpec.Parse unclosed square brackets wrong exn.
Throw ArgumentException on "Foo[," instead of ArrayIndexOutOfBoundsException.
2015-10-21 13:11:34 -04:00
Aleksey Kliger 0e6d11ea6b [corlib] System.TypeSpec.Parse escaped characters 2015-10-21 13:11:33 -04:00
Aleksey Kliger 4a2016452c [corlib] handle special characters in Type.FullName and Type.GetType(string)
Type.FullName escapes ,+&*[]\ with a leading backslash.
Type.GetType(typeName) strips escaping backslashes from typeName during parsing.
2015-10-21 13:11:33 -04:00
Joel Martinez 9f701df9be [mdoc] Marking MDocPreserve Obsolete.
This was functionality that changed mid-way through an implementation, and
was never removed. The underlying functionality changed direction and is now
a part of the `mdoc update`, and doesn't work in any way as originally planned ...
so I'm marking it as obsolete, and will completely remove it in a future release.
2015-10-21 07:05:48 -04:00
Jonathan Pryor 14c3c74b1e [tuner] Properly preserve AesCryptoServiceProvider.
[merged by rodo from monodroid - the mentioned test is not included here]

Fixes: https://xamarin.desk.com/agent/case/35534

Commit 5ca3cb4b wasn't propertly tested (doh!).

The problem with Aes and AesCryptoServiceProvider is that there's a
cross-assembly dependency: Aes is in mscorlib, while
AesCryptoServiceProvider is in System.Core. The
PreserveCrypto.ProcessSystemCore() method didn't properly handle this
setup.

Fix the linker, and add a test to Hello.

WARNING: The test sucks. In particular, to "test" this fix you need to
run the app and then grep the `adb logcat` output for:

	# DownloadDataTaskAsync complete; status=RanToCompletion; exception=

If the status is anything else, or the exception is non-null, it's
busted.

FURTHERMORE, it's only useful in Release apps, not Debug apps.
(No linker in Debug apps.)

The reason for the need to grep is that there's no sane mechanism to
wait until the Task has completed before checking the status of the
Task, and throwing an exception from within the continuation wouldn't
do anything.

FIXME: The real problem is that Task.Wait() blocks forever and never
returns. This needs further investigation.

	https://bugzilla.xamarin.com/show_bug.cgi?id=12681
2015-10-21 10:27:38 +02:00
Radek Doulik 8eae19473d [tuner] handle the case with multiple "preserve" attributes
- when more than one "preserve" attribute is set (see IsPreservedAttribute),
   make sure we handle all of them and not just last one
 - fixes https://bugzilla.xamarin.com/show_bug.cgi?id=19391
 - example code which suffered from this issue:

    [Preserve(AllMembers=true)]
    [DataContract]
    public class TestClass
    {
      ...
    }

  later when a method from this class was queried using the reflection,
  it wasn't available as it was linked out
2015-10-21 10:27:30 +02:00
Zoltan Varga e64bc66010 [runtime] Factor out the PE image loading code into a separate MonoImageLoader object. 2015-10-20 19:19:37 -04:00
Marek Safar 3009b72cfe [mcs] Fix inference of dynamic type used as a constructed type. Fixes #34898 2015-10-21 00:03:31 +02:00
Zoltan Varga 042ddd504c [runtime] Fix a possible buffer overflow in get_process_module (). 2015-10-20 14:30:43 -04:00
Zoltan Varga ee4f16e11d [amd64] Remove some dead code. 2015-10-20 14:25:42 -04:00
Zoltan Varga 313e422513 Revert "[amd64] Allow returning of structs in register pairs."
This reverts commit c41b5a47ad.

Revert this as it breaks IronJS tests:

https://bugzilla.xamarin.com/show_bug.cgi?id=35102
2015-10-20 14:12:46 -04:00
Marek Safar 844fc33437 [mcs] Add additional doc reset after property initializers. Fixes #35087 2015-10-20 18:39:25 +02:00
Alexander Köplinger ed2224dd51 [acceptance-tests] Fix tarball build and rename "check" target to "check-full"
The acceptance-tests folder wasn't getting included in the tarball, adding the folder
to the SUBDIRS in the top-level Makefile.am fixes this. Additionally, EXTRA_DISTFILES
doesn't work outside of mcs/ so rename it to EXTRA_DIST.

Since we don't want a top-level "make check" to recurse into acceptance-tests just yet,
rename the check target to check-full so nothing gets run by default.
2015-10-20 15:14:54 +02:00
Marek Safar 35a0f8b5c3 Fixes mobile build 2015-10-20 14:53:44 +02:00
Marek Safar c34f1c2192 [mdoc] Update expected test results after private members change in mscorlib 2015-10-20 12:01:25 +02:00
Marek Safar 5b0e77be18 [System.Runtime.Caching] Update test due to .net fixes 2015-10-20 11:47:06 +02:00
Marek Safar 5dad4266e3 [system.componentmodel.dataannotations] Fix incorrect IsValid_Object_ValidationContext_CrossCallsWithNIEX test 2015-10-20 11:36:52 +02:00
Jo Shields 05ddf5869a [msvc] Use fully qualified path for xcopy
There are still nasty issues with $PATH vs %PATH% for builds spawned by a system service, this should hopefully fix the last one
2015-10-20 10:06:10 +01:00
Marek Safar 1907fcd730 [system.data] Remove empty ending character from resource constants 2015-10-20 10:03:40 +02:00
Zoltan Varga 99d732d4d5 [gsharedvt] Inflate methods properly in one case. Fixes #34926. 2015-10-19 22:58:52 -04:00
Alexander Köplinger 150e8a86b7 Merge pull request #2148 from akoeplinger/remove-old-runtime-versions
[runtime] Remove explicit support for v4.0.30128 and v4.0.20506
2015-10-19 22:26:18 +02:00
Alexander Köplinger 7191313eb3 [runtime] Remove explicit support for v4.0.30128 and v4.0.20506
These versions were still binding to the 4.0 mscorlib, which is a reference-only assembly now
and isn't intended for being used at runtime.

This issue manifested itself when someone used e.g. <supportedRuntime version="v4.0.20506"/> in
the app.config, causing the runtime to try loading that version and then bailing out with
"Corlib not in sync with this runtime: expected corlib version 117, found 111." (with 111 being
the corlib version at the time the reference assemblies were generated).

The fix is to remove the specific versions from the supported_runtimes array, causing programs
to automatically use the newest version instead.

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

Other reports:

https://youtrack.jetbrains.com/issue/TW-42700
https://youtrack.jetbrains.com/issue/TW-41337
http://stackoverflow.com/questions/29988698/teamcity-nunitlauncher-running-on-linux-mono-gives-corlib-not-in-sync-with-th
2015-10-19 21:52:39 +02:00
Zoltan Varga 2b64a7d0c4 [llvm] Fix the handling of r4 arguments during calls. Fixes #35044. 2015-10-19 15:47:17 -04:00
Martin Baulig 083a62ad51 Bump reference source. 2015-10-19 13:59:08 -04:00
João Matos 4d78296980 [runtime] Remove unused MONO_IS_CROSS_COMPILE define. 2015-10-19 17:44:29 +01:00
Alexander Köplinger 51f95c3b91 [acceptance-tests] Convert Ruby script to Python
Most of the other scripts in the repo use Python and we decided to converge on that one.
2015-10-19 17:14:47 +02:00
Alexander Köplinger 0ec96b1241 [acceptance-tests] Integrate Roslyn, CoreCLR and ms-test-suite into acceptance-tests
This commit integrates the CoreCLR, Roslyn and ms-test-suite (which is Xamarin-internal, but should just print a warning for someone without access).
Running the tests suites can be done with 'make check-coreclr', 'make check-roslyn' and 'make check-ms-test-suite', or all of them with make check in the acceptance-tests folder.
They won't run on a top-level make check though, which is intended until every test suite is fixed.

This uses a custom submodule system that doesn't rely on git submodules (which are annoying when the repo is large and we only need them for tests). Instead we can fetch repositories on demand.

History (before squashing into smaller chunks):

- Rename check-{testsuite} make target to validate-{testsuite}. The former can be easily confused with the "check" target that runs the tests.
- Move acceptance-tests Makefile to automake, so we can avoid hardcoding paths
- Copy System.Console facade to CoreCLR IL test directories. Otherwise most of the IL tests fail as they rely on the System.Console assembly reference.
- Update README.md to mention the tests
- Use $(MAKE) instead of plain make and pass -C instead of cd'ing to directory
- Exit when the repository can't be cloned and print a note about the ms-test-suite repo. The ms-test-suite repo is Xamarin-internal so it'll error out in public.
- Integrate MS CoreCLR runtime tests into Mono's test infrastructure
- Get rid of intermediate msg file and pipe straight to git
- Rename README to CONFIG since we don't store metadata in readme.md anymore
- Fix comparison in versions.mk to be sh compliant. It relied on bashism before.
2015-10-19 17:14:45 +02:00
Zoltan Varga 9f626c29bc [acceptance-tests] Add code from xamarin/mono extensions branch
This provides a "git submodule"-like tool which can be used to
checkout optional repositories.
2015-10-19 16:37:17 +02:00
Alexander Köplinger 04bdf3b933 [tests] Add a new --testsuite-name parameter to managed test runner
Use it for the gshared tests, they were all (over-)writing the same TestResults_runtime.xml before.
2015-10-19 16:37:16 +02:00
Alexander Köplinger 623a3f1c04 [tests] Add a new --expected-exit-code option to the managed test-runner 2015-10-19 16:34:05 +02:00
Marcos Henrich a1d39d9b02 Merge pull request #2136 from esdrubal/uridotsegment
[System] Fixed dots trimmed from segments.
2015-10-19 14:01:30 +01:00
Zoltan Varga 919d67147d jit] Replace a few more #ifdefs with flags. 2015-10-18 23:48:45 -04:00
Zoltan Varga 09de76dbf3 Fix the build. 2015-10-18 19:59:19 -04:00
Zoltan Varga 667df0df1e [jit] Add a new MonoBackend structure which will contain backend constants/functions. Move the arch specific flags from MonoCompile to this structure. 2015-10-18 19:03:07 -04:00
Zoltan Varga b7e26580e7 jit] Replace a few more #ifdefs with MonoCompile flags. 2015-10-17 23:24:07 -04:00
Zoltan Varga 2fef405571 [jit] Replace a few more #ifdefs with MonoCompile flags. 2015-10-17 21:13:26 -04:00
Zoltan Varga a701751274 [jit] Replace a few arch-specific #ifdef blocks with MonoCompile flags. 2015-10-17 20:55:24 -04:00
Zoltan Varga 53991bf367 [jit] Add flags to MonoCompile to allow the removal of arch-specific ifdefs from the jit code. Add a mini_init_cfg () function to initialize them using the arch defines. 2015-10-17 20:46:02 -04:00
Alexander Köplinger 977083f29a [threads] Fix another sleep compilation error on win32
One case was missed in 2ad1993b51
2015-10-17 21:54:54 +02:00
Zoltan Varga e37a4cc883 Make the thread dump code safe by doing only async safe operations when a thread is suspended. 2015-10-17 14:13:37 -04:00
Ludovic Henry 2ad1993b51 [threads] Fix sleep compilation error on win32 2015-10-17 18:56:27 +01:00
Marcos Henrich e3665223b7 Merge pull request #2139 from akoeplinger/symbolicate-test-fix
[mono-symbolicate] Skip tests if AOT isn't supported by the current arch
2015-10-17 16:57:10 +01:00
Marek Safar 264c541150 Fixes build 2015-10-17 09:17:01 +02:00
Zoltan Varga ef57a5a30d Merge pull request #2144 from dlech/patch-1
Fix filename in header
2015-10-17 00:29:03 -04:00
David Lechner ba1c1bd8f2 Fix filename in header 2015-10-16 21:09:36 -05:00
Zoltan Varga c41b5a47ad [amd64] Allow returning of structs in register pairs. 2015-10-16 20:05:21 -04:00
Zoltan Varga ddca9a9bd5 [llvm] Fix returning of values in a register pair. 2015-10-16 20:05:21 -04:00
Zoltan Varga 2f72b70ab7 [llvm] Fix JIT support. 2015-10-16 20:05:21 -04:00
Zoltan Varga b9283e79b4 [runtime] Disable the emission of stubs debug info on apple, its no longer supported by clang. 2015-10-16 20:05:21 -04:00
Alexander Köplinger 63403ca0c7 Merge pull request #2143 from akoeplinger/refactor-mono-security-providers
[Mono.Security.Providers] Refactor providers into distinct folders
2015-10-17 00:14:47 +02:00
Marek Safar c6e81903c9 Bump reference source 2015-10-17 00:10:23 +02:00
Marek Safar 748e4b9ae4 [corlib] Implement UnsafeEnumCastLong 2015-10-17 00:08:30 +02:00
Marek Safar 27f07c8095 [bcl] Update to 4.6 referencesource 2015-10-16 23:33:32 +02:00
Alexander Köplinger 31321be9ea [Mono.Security.Providers] Refactor providers into distinct folders
Build the two libraries Mono.Security.Providers.DotNet and Mono.Security.Providers.NewSystemSource just like
every other class library instead of duplicating the logic into the subfolders.

This also fixes "make dist".
2015-10-16 22:31:15 +02:00
Marek Habersack f412b5529e [WinForms] ComboBox, ListBox and TextBox should use Control Foreground+Background
They have been using Window Foreground+Background so far which make them unreadable
on systms with dark themes. This change makes them behave.
2015-10-16 21:41:26 +02:00
Martin Baulig 973f63f32a [TLS]: Make ValidationResult.MonoSslPolicyErrors nullable.
(cherry picked from commit abfac54c47312c00f22fffef821f8889cbc67098)
(cherry picked from commit ccb7bfc930f4265b685eada8e73ee81acaae5963)
2015-10-16 15:14:34 -04:00
Martin Baulig f5b668e345 [System]: Remove the TrustEvaluateSsl(MX.X509CertificateCollection...) overloads.
We now use SSCX.X509Certificate2Collection in ChainValidationHelper.
2015-10-16 14:31:37 -04:00
João Matos 9084455c0b Merge pull request #2141 from akoeplinger/fix-wrong-disableaot-define
[runtime] Rename DISABLE_AOT_COMPILER back to DISABLE_AOT
2015-10-16 19:25:57 +01:00
Ludovic Henry 7c5c5f4940 [Process] Do not use Exited as it's racy with Start and BeginOutputReadLine/BeginErrorReadLine
The issue can arise if the Process is going to run faster than the call
between Start and BeginOutputReadLine/BeginErrorReadLine. To increase
the chance of the race happening, insert a Thread.Sleep (1000) between
Start and BeginOutputReadLine/BeginErrorReadLine.

This race exists because the WaitForExit in the background thread in the
Process, will first wait the process to finish, then try to wait for the
output to finish, but it will be null as BeginOutputReadLine has not been
called yet, then try to wait on error (same issue as output), and finally
call the Exited event, which will close the stdout and stderr TextWriter.
The call to BeginOutputReadLine and BeginErrorReadLine will finally happen
(which is still correct as the output and error of the Process has not
been closed yet), then calling the OutputDataReceived and ErrorDataReceived
callbacks which will try to write to the closed stdout and stderr
TextWriter.

Simply enqueuing a ThreadPool work item, which will wait for the process
to exit manually, simply resolve this issue, as we guarantee that the
call to WaitForExit happens after BeginOutputReadLine/BeginErrorReadLine,
and is not racing with it.
2015-10-16 18:41:45 +01:00
Marek Safar 372658a28e [corlib] Add few reference source dependencies 2015-10-16 18:43:05 +02:00
Martin Baulig ec554d0410 All MARTIN_FIXME's have been taken care of. 2015-10-16 12:33:02 -04:00
Martin Baulig abc19e228d [Mono.Security]: Check 'CertificateValidationHelper.SupportsX509Chain' before attempting to compute the chain.
Computing the X509Chain is not supported on OS X and iOS because the OS does
not give us access to the root certificates - this would throw an Exception
at runtime.

(cherry picked from commit 44d34a17c1bf305e39bcfc277cc7add48560d899)
(cherry picked from commit 504328ec43d9d917c1f140ecf89f253ab2be39ec)
2015-10-16 12:17:17 -04:00
Martin Baulig 6a904e6315 Forgot to remove one MARTIN_FIXME. 2015-10-16 12:12:19 -04:00
Alexander Köplinger a353efb8bb [msvc] Remove left over project guid from mono.sln
The project was removed from the solution in 735fc51cc0, but one instance was missed.
This should fix the Windows build on Jenkins.
2015-10-16 16:14:14 +02:00
Alexander Köplinger 982bbc0e05 [mono-symbolicate] Skip AOT tests if AOT isn't supported by the current arch
This fixes Jenkins errors on architectures like s390x which don't support AOT.
2015-10-16 15:46:34 +02:00
Alexander Köplinger db1a898440 [runtime] Rename DISABLE_AOT_COMPILER back to DISABLE_AOT
The original rename in c4aa103e48 was done by accident,
the rest of the codebase still used the old name so disabling AOT didn't actually work.

Renaming this back to the original name and fix a few instances where methods weren't added
in the DISABLE_AOT case.

This allows a `--enable-minmal=aot` build to succeed and actually work.
2015-10-16 15:38:45 +02:00
Ludovic Henry 1720c3bacd Revert "[process] Use same behavior as .NET"
It broke the android build

This reverts commit c688b8c84c.
2015-10-16 11:01:22 +01:00
Zoltan Varga 464ec0063e [runtime] Simplify the caching of gshared generic params now that they point to their parent gparam. 2015-10-16 04:07:01 -04:00
Zoltan Varga 18e7445b41 [runtime] Add a new MonoGSharedGenericParam structure as an extension of the MonoGenericParamFull structure, put the 'parent' field there. 2015-10-16 03:58:31 -04:00
Zoltan Varga 01c6d2e3fa [amd64] Split the valuetype argument passing code into win64 and non-win64 versions to simplify both. 2015-10-15 23:11:20 -04:00
Zoltan Varga 6948689cf6 [aot] Create constrained gparams using the same mini_get_shared_gparam () function used by the rest of the code, so its properly unique-ed. 2015-10-15 20:14:11 -04:00
Ludovic Henry 3572dc9101 [io-layer] Remove Sleep and SleepEx 2015-10-15 16:45:31 -04:00
Ludovic Henry 8cfef6d190 [io-layer] Remove GetCurrentThreadId 2015-10-15 16:45:25 -04:00
Ludovic Henry dc04f3f0ae [runtime] Remove dead code 2015-10-15 16:43:25 -04:00
Rodrigo Kumpera 86a15b2059 [sdb] Fix state initialization of suspended threads to work when the debugger thread is not attached. Fixes #34750
The problem happens because thread_interrupt runs in the debugger thread (suspend initiator).

thread_interrupt then calls mono_thread_state_init_from_monoctx which collects the state of the current thread
which is definitely not what we wanted.

There used to be some compensation code after calling mono_thread_state_init_from_monoctx to actually init the state properly.
This is why it worked, at all.

Thew problem is that the debugger thread now might not attach at all under some circumstances, which would trigger
mono_thread_state_init_from_monoctx to return FALSE and trip into the assert.

The fix is to simply not use mono_thread_state_init_from_monoctx at all, just copy the state from data. This fix has the
bonus of getting the domain correctly.
2015-10-15 16:42:53 -04:00
Rodrigo Kumpera 714ace0119 Merge pull request #2113 from ludovic-henry/coop-socket-abort
[socket] Make blocking syscall abortable on signal-less platforms
2015-10-15 14:56:40 -04:00
Rodrigo Kumpera f1a8fb7179 Merge pull request #2123 from kumpera/verifier-fix
[verifier] Fix the verifiers to handle Roslyn style fixed blocks.
2015-10-15 14:53:28 -04:00
Alexis Christoforides 735fc51cc0 Fix MSVC build after 1657026514 2015-10-15 14:38:26 -04:00
Miguel de Icaza bbeb09a442 Merge pull request #2127 from joelmartinez/mdoc-multiassembly-squashed
[mdoc] `multiassembly` option for duplicated types
2015-10-15 14:00:16 -04:00
Ludovic Henry c688b8c84c [process] Use same behavior as .NET 2015-10-15 17:49:20 +01:00
João Matos a1a252e69e Merge pull request #2137 from fplucas/patch-1
Fixing the broken icon of centos-s390x
2015-10-15 15:36:00 +01:00
Lucas becc336d4a Fixing the broken icon of centos-s390x 2015-10-15 11:32:17 -03:00
Marcos Henrich cc9bf6f825 [System] Fixed dots trimmed from segments.
Before .NET 4.5 dots were trimmed from the end of uri path segments.

In .NET 4.5 IRI parsing is enabled by default and dot are no longer
trimmed from the end of path segments.

This commit disables dot trimming when Uri.IriParsing is true.

Fixes #29864.
2015-10-15 15:01:27 +01:00
Alexander Köplinger ae20123261 Merge pull request #2134 from akoeplinger/bug-34334
[interpreter] Implement comparing string values in (Not)EqualInstruction
2015-10-15 15:44:04 +02:00
João Matos 02d9415929 [runtime] Switch ARM backend use to use g_print instead of printf.
Sorry about the churn, the previous commit contained an unintended chunk.
2015-10-15 14:34:53 +01:00
João Matos 0af9f2b715 Revert "[runtime] Switch ARM backend use to use g_print instead of printf."
This reverts commit 8e9f93be24.
2015-10-15 14:26:19 +01:00
João Matos 8e9f93be24 [runtime] Switch ARM backend use to use g_print instead of printf. 2015-10-15 14:24:10 +01:00
João Matos 3219392b92 [runtime] Simplify ARM mono_arch_flush_icache.
We do not support compiling with older versions of GCC anymore so most of this should be just dead code.
2015-10-15 14:12:50 +01:00
Zoltan Varga d2acc1d780 [amd64] Remove the special casing of TYPEDBYREF in the amd64 backend, its not needed. 2015-10-15 00:28:56 -04:00
Zoltan Varga 698131bece [llvmonly] Call methods in the same assembly directly. 2015-10-14 22:11:21 -04:00
Zoltan Varga 9b4a40cc7c [llvmonly] Update comments. 2015-10-14 20:42:32 -04:00
Zoltan Varga 46bc8e954b [llvmonly] Use the PreserveAll calling convention for the init functions. 2015-10-14 20:42:06 -04:00
Zoltan Varga 212e56e6f0 [llvmonly] Factor out the initialization code into separate helper functions to save space. 2015-10-14 20:22:11 -04:00
Zoltan Varga 9e6e56b5e6 [ppdb] Check that PE file timestamp as well when matching assemblies and pdb files. 2015-10-14 20:22:11 -04:00
Martin Baulig 9af4b08290 Revert "[System]: WebConnection: improve chunked reads and async callbacks."
This reverts commit 9027f0ad28bf733ebb8ac9964c78c22853ca93c7.
2015-10-14 19:26:06 -04:00
Martin Baulig 25a206c6da [System/TLS]: Switch to the new ChainValidationHelper.
* Removed Mono.Security.Protocol.Tls.ValidationResult, use
  Mono.Security.Interface instead.  This is an API breaking
  change, but you can fix your application by simply adding
  the new using directive.

  The rationale behind this is to avoid a dependency on the
  Mono.Security.Protocol.Tls namespace when building and
  related classes when building the new TLS stack.

* Enable ChainValidationHelper in WebConnection, LegacySslStream
  and SslStream.

  The custom conditionals that were previously required for the
  mobile profiles are now gone as ChainValidationHelper already
  handles that internally.

* This is an internal API, the public front-end is
  Mono.Security.Interface.CertificateValidationHelper.

  CertificateValidationHelper can be used to access the system
  certificate validator on OS X and iOS; we do not compute the
  X509Chain on these platforms as it's not supported by the OS.

(cherry picked from commit 9713f35878dd90fe87423b5052b4f82ddc0b87f0)
2015-10-14 19:26:06 -04:00
Zoltan Varga 4ef71c7663 [llvmonly] Add more preinitialized got slots, refactor the code which emits them a little. 2015-10-14 17:54:34 -04:00
Zoltan Varga 8b619c6b73 [ppdb] Update to spec version v1.0. Fix decoding of line number info. 2015-10-14 16:25:29 -04:00
Zoltan Varga 7833c3ef6c [ppdb] Update the code which checks whenever the assembly and the pdb files match to spec v1.0. 2015-10-14 15:55:45 -04:00
Martin Baulig 815ea22b88 [System/TLS]: Add obsolete ChainValidationHelper.ctor(HttpWebRequest).
This will be removed again laster, but allows us to do a two-step switch
by first switching to the new ChainValidationHelper, then switching to
MonoTlsProvider and friends.

(cherry picked from commit f2e98e82f04dbaa72e48c37d72407000c197fbcb)
2015-10-14 15:29:13 -04:00
Martin Baulig 92adfe413f [System]: API cleanup; make MonoTlsStream.SelectClientCertificate() private static.
(cherry picked from commit 8a79bdc2add36cb3da2834dc371499fd94d1737f)
(cherry picked from commit 13168150a77f722afee51df86ba029c91f21ee0c)
2015-10-14 15:29:06 -04:00
Alexander Köplinger b72ee9135d [interpreter] Implement comparing string values in (Not)EqualInstruction
When comparing a string with null the other checks in the interpreter for type equality didn't catch this case
and this ultimately resulted in a NotImplementedException in EqualInstruction and NotEqualInstruction.

The fix is to handle the TypeCode.String case in those instructions.
We don't need to do it for CreateLifted() as that method only applies for Nullable<T> types which doesn't make sense for string.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=34334
2015-10-14 21:23:11 +02:00
Martin Baulig 77e1889d20 [System]: WebConnection: improve chunked reads and async callbacks.
Make sure we always complete the async operations on error and
also send callbacks outside the lock.

(cherry picked from commit 9027f0ad28bf733ebb8ac9964c78c22853ca93c7)
2015-10-14 15:18:27 -04:00
Zoltan Varga 2de86c3cee Fix the build. 2015-10-14 15:17:44 -04:00
Zoltan Varga 551cdbeb2e [runtime] Fix the configure check for stdc++/c++. 2015-10-14 14:46:50 -04:00
Zoltan Varga 679c904e41 [aot] Fix the build when llvm is not enabled. 2015-10-14 13:08:21 -04:00
João Matos 610ac817e2 [runtime] Reworked coop GC stack handling in platforms with restricted access to register contexts. 2015-10-14 17:26:58 +01:00
João Matos 97ad88dadc Merge pull request #2106 from lambdageek/dev/bug-29108-part1
GetCallingAssembly() skip past reflection. Fix #29108 - part 1
2015-10-14 16:34:31 +01:00
Aleksey Kliger 92a5499b8f Test that Assembly.GetCallingAssembly() skips MethodBase.Invoke() 2015-10-14 11:02:21 -04:00
Aleksey Kliger 14b270cb09 GetCallingAssembly() skip past reflection. Fix #29108 - part 1 2015-10-14 10:54:37 -04:00
João Matos b81f6a99ea [runtime] Workaround signal() configure check in Android.
So, I broke this on Android back in https://github.com/mono/mono/commit/d3726dcde9ef373157cd533ce8091cdde89dfa8e.

Turns out signal() is defined inline in Android:

static __inline__ __sighandler_t signal(int s, __sighandler_t f)
{
    return bsd_signal(s,f);
}

So we need to hardcode the define in case we're on an Android platform.

Fixes BclTests on Android:

I/mono-stdout( 1200): UnixSignalTest
F/        ( 1200): signal() is not supported by this platform
F/libc    ( 1200): Fatal signal 6 (SIGABRT) at 0x000004b0 (code=-6), thread 1215 (Instrumentation)
2015-10-14 15:24:45 +01:00
Zoltan Varga 1a81eb723f [llvmonly] Fix the build. 2015-10-14 01:54:01 -04:00
Zoltan Varga 51c4e47f22 [aot] Rework the handling of preinitialized got slots, instead of hardcoding their offsets into the code, initialize them the same way the other got slots are initialized, by decoding a MonoJumpInfo structure for them, and resolving them using mono_resolve_patch_target (). 2015-10-14 01:45:23 -04:00
Miguel de Icaza 948d79daba [mscorlib] DateTime, DateTimeOffset, bring Unix time APIs from CoreCLR 2015-10-13 23:05:32 -04:00
Zoltan Varga 9846d759fe [llvmonly] Skip initalization of methods if they only reference shared got entries. 2015-10-13 22:07:11 -04:00
Zoltan Varga da0ccf07f0 [llvmonly] Emit initialization code for a method only if it uses got slots or its type has a cctor. 2015-10-13 21:14:55 -04:00
Ludovic Henry e5fbaa4190 [process] Wait for process completion before waiting for stdout/stderr
This fixes a race condition between the calls to Start and
BeginOutputReadLine/BeginErrorReadLine. This was triggered by the fact
that the call to WaitForExit (in StartBackgroundWaitForExit called by
Start_noshell) could be faster that the call to
BeginOutputReadLine/BeginErrorReadLine, leading to a null async_output,
which would make the WaitForExit call not wait for the output to finish.
This could make the call to Exited happen before a call to
OutputDataReceived/ErrorDataReceived.

To trigger this issue more reliably, you can simply add a sleep at the
beginning of AddInput in ProcessAsyncReader.
2015-10-13 20:35:59 -04:00
Zoltan Varga f7d03df3bf [runtime] Link against the same c++ standard library as used by llvm. 2015-10-13 20:32:39 -04:00
Martin Baulig 07012a1246 Remove another MARTIN_FIXME.
(cherry picked from commit 9737322c86939f1b5e0da085697bddb7827cc06d)
2015-10-13 18:52:45 -04:00
Martin Baulig bf0cff0dc1 [System]: Remove two MARTIN_FIXME's.
This adds ChainValidationHelper to the build, but it's not
actually used yet.

(cherry picked from commit 214bf577d36808fc8ffc050027376c37b8920346)
2015-10-13 18:52:45 -04:00
Martin Baulig 453cbf3119 [System]: Add AndroidPlatform.TrustEvaluateSsl(X509Certificate2Collection...) overload.
(cherry picked from commit 34eefeb172055f10d8d6ca7b91cb719cfe812b64)
2015-10-13 18:52:44 -04:00
Martin Baulig a88f797cc3 [System]: Add OSX509Certificates.TrustEvaluateSsl(X509Certificate2Collection,string) overload.
When switching to Mono.Net.Security.ChainValidationHelper, we will use
X509Certificate2Collection instead of MSX.X509CertificateCollection; keep
both version for the moment.

(cherry picked from commit 1f004d8e7a8391785d4ae8fcb0270f9be9d522c8)
2015-10-13 17:04:31 -04:00
Martin Baulig 47efc2461e [System]: Use 'ServerCertValidationCallback' in ServicePointManager.
This is a new internal wrapper class defined in
external/referencesource/System/net/System/Net/ServicePointManager.cs

It wraps the RemoteCertificateValidationCallback, capturing the
current ExecutionContext.

(cherry picked from commit c1695a55dc9a55f6b344bfc4c91991bd1f04c046)
2015-10-13 16:25:41 -04:00
Martin Baulig 001cea64a2 Put back "[Mono.Security.Providers]: Add to the top-level build."
This reverts commit f05603553e.
2015-10-13 16:25:31 -04:00
Martin Baulig d87fafd44c [Mono.Security/build]: Add custom monodroid_Mono.Security.dll.sources.
Includes everything from Mono.Security.dll.sources except for the
new Mono.Security.Interface APIs, which are built inside System.dll
on mobile.

(cherry picked from commit df1adee67802417381280c097f3f8f17bbd48f66)
2015-10-13 16:25:30 -04:00
Miguel de Icaza cd99d93ffe Add tests for #34598 2015-10-13 14:48:55 -04:00
Sandy Armstrong 21ad685934 Merge pull request #2130 from sandyarmstrong/mt-runtime-updates
[corlib] Use same Console and Environment logic in monotouch_runtime
2015-10-13 10:45:34 -07:00
Sandy Armstrong 4504107d42 [corlib] Use same Console and Environment logic in monotouch_runtime
The `monotouch_runtime` profile is exclusively used for the monotouch
REPL assemblies used by Xamarin Sketches and Inspector. In those cases,
Console and Environment should behave just the same as in the
`monotouch` profile.

The only real difference between the two profiles should be the presence
of SRE in `monotouch_runtime`.
2015-10-13 10:30:51 -07:00
Michael Hutchinson d9aeae470d [mono-api-info] Allow following type forwarders
[mono-api-info] Fix Makefile from win32, round 2
2015-10-13 13:27:35 -04:00
Joel Martinez 3a78c7b093 [mdoc] multiassembly option for duplicated types
The new `multiassembly` option lets you run `mdoc update` on assemblies that
contain the same types. This can come into play when you have a set of assemblies
that run on different platforms, with a slightly differing API surface area on
each platform (for example: tvOS, watchOS, iOS); in this case you can maintain
all of the documentation in a single set of XML documents.

With this option enabled, an `AssemblyInfo` node will be added for every assembly
that a type is found in, in addition to every member. While this may seem verbose,
it's really the only way to capture the information about what assemblies a given
type or member can be found in.
2015-10-13 11:25:15 -04:00
Marcos Henrich 4f714afa7c Merge pull request #2121 from esdrubal/socketreuse
[System] Added icall SupportsPortReuse.
2015-10-13 11:11:20 +01:00
Martin Baulig f05603553e Revert "[Mono.Security.Providers]: Add to the top-level build."
This currently does not build for monodroid, so let's fix that first.

This reverts commit 8a47d504cc.
2015-10-12 17:54:14 -04:00
Martin Baulig bc63406128 [System]: Add HttpWebRequest.ServerCertificateValidationCallback.
Add a new HttpWebRequest.ServerCertificateValidationCallback property
(new .NET 4.5 / 4.6 API, not enabled yet) and read-only internal
ServerCertValidationCallback accessor (defined in the referencesource's
ServicePointManager.cs).

(cherry picked from commit ea9ed03863c730831c6fac393ed4dad3a94fb149)
2015-10-12 17:28:47 -04:00
Martin Baulig ec58a4ab09 [System]: Add new internal HttpWebRequest APIs for MonoTlsProvider / MonoTlsSettings.
The new internal constructor allows a per-request MonoTlsProvider and
related MonoTlsSettings; also expose these as new internal properties.

(cherry picked from commit 31988df75077c11ed87c77ab34e5b77b5913a32b)
2015-10-12 17:28:37 -04:00
Martin Baulig c8677afffb [System]: Add internal ServicePoint.SetClientCertificate() and SetServerCertificate().
The old SetCertificates() will be removed when merging the rest of
the work-newtls changes.

(cherry picked from commit 815731f2b7fd2f7384b8e16fcaf33f54d5ab6cb1)
2015-10-12 17:19:30 -04:00
Martin Baulig 8a47d504cc [Mono.Security.Providers]: Add to the top-level build.
(cherry picked from commit 76db142479)
2015-10-12 17:19:15 -04:00
Martin Baulig f01a88837f [System] Add internal 'ServicePointManager.DisableStrongCrypto'.
It's an internal API that's used by the referencesource.

(cherry picked from commit 7fbd50ab52fc4cdf2fa9282ecd9d286ac48d9ba8)
(cherry picked from commit eb2f282d6f)
2015-10-12 17:19:15 -04:00
Martin Baulig 95e6556b21 [corlib] Add new .NET 4.5 System.Diagnostics.EventSource and EventAttribute APIs.
(cherry picked from commit 7f098fb7424b78f0e1bbde592a9de71209dcc798)
(cherry picked from commit 6c80418313)
2015-10-12 17:19:15 -04:00
Martin Baulig 578f49fb03 [System]: Make internals visible to Mono.Security.Providers.NewSystemSource.
(cherry picked from commit 6414856bf2)
2015-10-12 17:19:14 -04:00
Zoltan Varga 4f88b98dfd [sdb] Print more debug info when a seq point is not found. 2015-10-12 17:10:19 -04:00
Zoltan Varga 9de34d2cf3 [llvmonly] Simplify the handling of init_bb a bit. 2015-10-12 17:10:18 -04:00
Martin Baulig 32779a5c8e [System/TLS]: Add the new Mono.Security.Interface and Mono.Net.Security APIs to the build.
These should be considered internal APIs for the moment, even where the
classes are public (to avoid making internals visible).

(cherry picked from commit bec0257c97)
2015-10-12 16:54:50 -04:00
Martin Baulig 805617f837 Add MARTIN_FIXME conditionals to some of the newly added files in preparation to get them build.
(cherry picked from commit 73a79ac235)
(cherry picked from commit 0d90e727e5)
(cherry picked from commit d60284a02a553fbf0af18d40a3e1018f7d0aa0c9)
2015-10-12 16:53:29 -04:00
Martin Baulig b9b7c9e2c1 [System]: Add the referencesource's ServicePointManager.cs.
This picks up the internal 'ServerCertValidationCallback' class,
not the actual ServicePointManager implementation (we can't switch
to that yet).

(cherry picked from commit f5eeb5597a)
2015-10-12 16:52:00 -04:00
Martin Baulig f338a141ce [System]: Add internal RemoteCertValidationCallback and LocalCertSelectionCallback.
These two internal delegates are defined and used by the referencesource's SslStream
implementation; add them to our SslStream.cs version for compatibility.

(cherry picked from commit 0fbda4c3bd)
2015-10-12 16:52:00 -04:00
Martin Baulig b8e6b1cbac [Mono.Security.Providers]: New internal libraries for the new TLS code.
(cherry picked from commit 90a8836c8d)
2015-10-12 16:52:00 -04:00
Martin Baulig 40f2813ed7 [System/TLS]: Internal additions to some referencesource files.
These won't be build in System.dll until we can switch to the new
TLS implementation.

(cherry picked from commit 39cd3ee44f)
2015-10-12 16:51:59 -04:00
Martin Baulig 49006f0482 [System/TLS]: Add the new Mono.Security.Interface and Mono.Net.Security code.
This is not enabled in the build yet; doing so still requires a few more tweaks.

(cherry picked from commit 8fbc5ba484)
2015-10-12 16:51:59 -04:00
Martin Baulig ec2b344d00 [System/build]: Wrap ReferenceSources/Logging.cs with '!MONO_FEATURE_NEW_TLS'.
(cherry picked from commit 0eb51843e2)
2015-10-12 16:51:59 -04:00
Martin Baulig 2dc99a0e43 [System]: Add missing System.Net.SecurityProtocolType enum values.
(cherry picked from commit 0377d61060)
2015-10-12 16:51:59 -04:00
Martin Baulig 57e39c1d2c [System/build]: Add two MONO_SECURITY_ALIAS and MONO_X509_ALIAS conditionals.
These should be used instead of MOBILE / MONOTOUCH / MONODROID to select
extern alias directives to make them work independently from the mobile profile.

* MONO_SECURITY_ALIAS: whether or not to use 'extern alias MonoSecurity'.

* MONO_X509_ALIAS: whether or not to use

    extern alias PrebuiltSystem;
    using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;

* MONO_FEATURE_NEW_TLS: ignore, this is not enabled in the default build.

(cherry picked from commit 48b95ec304)
2015-10-12 16:51:59 -04:00
Martin Baulig 1437d3a910 [System/build] Use the MOBILE_PROFILE conditional to define INSIDE_SYSTEM.
(cherry picked from commit a3500da8707f64ef5e49cca87f4d732abb0e07ae)
(cherry picked from commit 5348243102)
2015-10-12 16:51:58 -04:00
João Matos ec3df94589 [runtime] Fixed build error related to undeclared object offsets.
In file included from /Users/joao/Dev/droid/mono/mono/metadata/marshal.c:26:0:
/Users/joao/Dev/droid/mono/mono/metadata/marshal.c: In function 'mono_marshal_get_delegate_invoke_internal':
/Users/joao/Dev/droid/mono/mono/metadata/abi-details.h:29:43: error: 'MONO_OFFSET_MonoDelegate_rgctx' undeclared (first use in this function)
 #define MONO_STRUCT_OFFSET(struct,field) (MONO_OFFSET_ ## struct ## _ ## field == -1, G_STRUCT_OFFSET (struct,field))
2015-10-12 21:42:19 +01:00
Rodrigo Kumpera 72a7e8de97 [verifier] Fix the verifiers to handle Roslyn style fixed blocks.
Roslyn used byref vars whenever possible to store fixed statements. This leads to confusion in
both the full verifier and the JIT built-in one.

Now we skip it in the JIT one and allow it when not in strict mode for the full verifier.
2015-10-12 16:39:39 -04:00
Martin Baulig 5e7a29ed66 [System]: Add ReferenceSources/Socket.cs to the mobile build.
This fixes commit c74c64718d64ecc05ddec21d12313d840842a9c2; these
new internal APIs are required by the referencesource's version of
NetworkStream.

(cherry picked from commit 2905ed96d1)
2015-10-12 15:09:28 -04:00
Martin Baulig 1ae6653077 [System]: Use NetworkStream from the referencesource. 2015-10-12 15:08:32 -04:00
Zoltan Varga 390a758396 Revert "[runtime] Don't allocate domain-level static slots for special static fields."
This reverts commit d2efa789ac.

Revert this as it breaks on monodroid.
2015-10-12 14:34:35 -04:00
Zoltan Varga 11a0a03e6a Revert "[runtime] Optimize mono_class_field_is_special_static () a bit."
This reverts commit 0686c21358.

Revert this as it breaks on monodroid.
2015-10-12 14:34:17 -04:00
Zoltan Varga a5f5d0f7b5 [ppdb] Update the image checking code, the guid in the ppdb file needs to be checked against the guid in the debug directory in the pe file. Not finished yet. 2015-10-12 14:23:38 -04:00
Marek Safar db6d1b96a9 [mcs] New test 2015-10-12 19:05:44 +02:00
Marek Safar 5528eb0194 Merge pull request #2119 from lambdageek/dev/bug-17571
parser improvements for Type.GetType() and Assembly.GetType()
2015-10-12 19:02:50 +02:00
Marek Safar cea55b8eb9 [mcs] Special case null inside parenthesized expression. Fixes #34753 2015-10-12 19:00:07 +02:00
Zoltan Varga d037168755 Fix the cross compiler build by not including c headers into mini-llvm-cpp.h. 2015-10-12 12:15:20 -04:00
João Matos 9624aa3bb7 [mini/llvm] Fixed cross compilation build. 2015-10-12 17:01:10 +01:00
João Matos 79ca7e2c18 [mini/llvm] Normalize includes. 2015-10-12 17:01:09 +01:00
Marcos Henrich d4e6109e82 [System] Added icall SupportsPortReuse.
Linux kernels before 3.9 did not support port reuse.
Added private method System.Net.Sockets.Socket.SupportsPortReuse,
which returns true when the runtime is able to bind to the same address
and port multiple times.
2015-10-12 16:45:37 +01:00
Marek Safar 51dc184ccc [system] Fix WebHeaderCollection values extraction for multi-header keys 2015-10-12 16:51:19 +02:00
Aleksey Kliger 936f77df46 [System.TypeSpec] make ModifierSpec an interface. 2015-10-12 10:47:00 -04:00
Marek Safar 78534d91c8 [mcs] Improve error reporting from 51137702c6 2015-10-12 16:17:22 +02:00
João Matos b35b474a9b Merge pull request #2120 from mono/revert-2101-stack-coop-gc
Revert "Reworked coop GC stack handling in platforms with restricted …
2015-10-12 14:39:02 +01:00
João Matos 5a834ff4af Revert "Reworked coop GC stack handling in platforms with restricted access to register contexts." 2015-10-12 14:38:48 +01:00
Rodrigo Kumpera 030f9dd26d Merge pull request #2101 from tritao/stack-coop-gc
Reworked coop GC stack handling in platforms with restricted access to register contexts.
2015-10-12 09:25:01 -04:00
Marek Safar 35e42072a8 [mcs] Rename error test 2015-10-10 20:19:34 +02:00
Marek Safar 51137702c6 [mcs] Report global attributes without target. Fixes #34724 2015-10-10 16:13:22 +02:00
Marek Safar 479fe65064 [mcs] Fixes typo 2015-10-10 16:13:22 +02:00
Rodrigo Kumpera 5e10b3057d [Apple] Disable environment access on Apple platforms that are not OSX.
The two known ways to access the environment variables are no longer allowed Apple.

Until something blessed by them is found, we'll provide no way to list all the envvars
of the current process.
2015-10-09 15:55:03 -04:00
Zoltan Varga 0421c0cff3 Fix the loaded llvm build. 2015-10-09 14:23:03 -04:00
João Matos d0843960aa [runtime] Fixed accidental whitespace change. 2015-10-09 17:11:45 +01:00
João Matos 4687c4bb25 [runtime] Build fixes for builds with disabled LLVM. 2015-10-09 17:09:05 +01:00
Zoltan Varga e19f9c25ed [llvmonly] Fix the build. 2015-10-08 23:07:20 -04:00
Zoltan Varga a39d73751b Merge remote-tracking branch 'origin/bitcode-premerge' 2015-10-08 22:57:00 -04:00
João Matos 66b81e5154 [runtime] Reworked coop GC stack handling in platforms with restricted access to register contexts. 2015-10-08 14:10:14 +01:00
Aleksey Kliger 54ab1256c6 Additional tests for Type.GetType() with delegates.
Test that exotic compositions of modifiers are parsed correctly.
2015-10-07 18:58:17 -04:00
Aleksey Kliger dc9f2bceb9 [corlib] System.TypeSpec: parse mixture of pointer and array type modifiers. 2015-10-07 18:18:14 -04:00
Ludovic Henry 1103abf383 [socket] Fix some tests 2015-10-07 17:44:31 +01:00
Ludovic Henry 12a58743fc [socket] Shutdown socket before trying to abort syscall
This is useful on WatchOS and TvOS as it's the only two platforms that
do not support signal based syscall abort. By calling shutdown, the
blocking syscalls on other threads will be interrupted. All the other
platforms currently support signals, so this will not change anything.

We cannot call Close, as this would let the OS reuse the FD for
something else, and the call to Receive (for example) on another thread
could fail with ENOTSOCK.

Unfortunatly it does not work for UDP based connection, as they are not
stream based, so Shutdown does not have much sense.
2015-10-07 17:44:30 +01:00
Aleksey Kliger 826880d362 [corlib] Tests for System.Reflection.Assembly.GetType(string, bool) 2015-10-07 11:57:42 -04:00
Ludovic Henry fd90b1e132 [socket] Make SocketAsyncResult use Socket.Handle
This is to avoid accessing a handle that has been disposed from the
SocketAsyncResult code.
2015-10-07 16:31:33 +01:00
Ludovic Henry c82b5e8d58 [socket] Take thread coop suspend status into account for syscall abort mechanism 2015-10-07 14:08:37 +01:00
Aleksey Kliger c58983457a [corlib] Type.GetType(string, bool) should throw ArgumentException
when it is unable to parse the type name.
2015-10-06 19:00:22 -04:00
Aleksey Kliger 70ec3c683f mono_reflection_parse_type(): pointer and ref parse errors.
pointer to ref (A&*), array of ref (A&[]), generic instantiation of
ref (A&[int]), generic instantiation of pointer (A*[int]) are all parse errors.
2015-10-06 18:31:53 -04:00
Adam Burgess 101bd2a868 [System] Fix bug #31209 - HttpConnection infinite loop
A continue statement in a do...while loop was skipping code to read the next line in a connection, causing an infinite loop.
Fixed by refactoring the loop, removing duplicated code.
2015-10-02 14:11:11 +00:00
BrennanConroy 429ee4b162 More robust get_address_info
We have been running into this issue: https://bugzilla.xamarin.com/show_bug.cgi?id=30018 a lot recently, after digging into getaddrinfo a bit we saw that the linked list of addrinfo structs had 1 or more valid ones which can be used and 1 bad one which should just be discarded.
2015-07-23 11:52:29 -07:00
meum 1d8284ed11 Fix dot stuffing in SmtpClient
As per RFC2821 section 4.5.2:
   -  Before sending a line of mail text, the SMTP client checks the
      first character of the line.  If it is a period, one additional
      period is inserted at the beginning of the line.
2015-06-23 17:03:59 +02:00
Mark Mikofski 82157625b5 initialize ReaderQuotas, fixes bugzilla #15153
Fixes [Bug 15153](https://bugzilla.xamarin.com/show_bug.cgi?id=15153) "System.ServiceModel.NetTcpBinding properties are not pre-initialized while they are in .NET causing interoperability problems."

Specifically the `reader_quotas` member of `System.ServiceModel.NetTcpBinding` is not initialized to a new `XmlDictionaryReaderQuotas` object which causes a "NullReferenceException: Object reference not set to an instance of an object." whenever an attempt is made to set any attributes of that property. For example: `using System.ServiceModel; NetTcpBinding binding = new NetTcpBinding(SecurityMode.None); binding.ReaderQuotas.MaxStringContentLength = 8192;` raises "NullReferenceException: Object reference not set to an instance of an object."
2015-06-16 11:44:02 -07:00
Matthew Leibowitz e3719ebcfc [system] WebSocket continuation frame incorrectly handles the message type opcode
When a frame marked with OPCODE 0, it is a continuation frame. This frame does not carry the message type and should be derived from the previous frame.
2014-10-15 14:14:07 +02:00
Etienne CHAMPETIER 8fdf3ae11c [Fix] ReusableHashAlgorithm doesn't set the Key of the ValidationAlgorithm
Without this patch you can't use "WebResource.axd" ressources
in a cluster (each mono instance will get a different link for the same ressource)

Signed-off-by: Etienne CHAMPETIER <[email protected]>
2014-04-01 11:42:09 +02:00
21052 changed files with 4196723 additions and 880565 deletions

No files matched your search

+8 -7
View File
@@ -1,18 +1,19 @@
# ensure LF endings on all checkouts
configure.ac crlf=input
configure.ac crlf=input
config.rpath crlf=input
configure.host crlf=input
mkinstalldirs crlf=input
*.sh crlf=input
*.sources crlf=input
.gitattributes crlf=input
*akefile* crlf=input
# ensure native line endings on checkout
*.c crlf
*.h crlf
*.cs crlf
*.sh crlf
*.il crlf
.gitattributes crlf
ChangeLog crlf
*akefile* crlf
*.sources crlf
# don't do anything to line-endings. Let CRLFs go into the repo, and CRLF on checkout
*.bat -crlf
*.sln -crlf
+3
View File
@@ -38,6 +38,8 @@ obj/
[Rr]elease*/
Ankh.NoLoad
*.gpState
.vscode/
*.exp
# Tooling
_ReSharper*/
@@ -125,4 +127,5 @@ mono.h
mono-*.tar.*
tmpinst-dir.stamp
msvc/scripts/inputs/
extensions-config.h
+38 -10
View File
@@ -7,9 +7,6 @@
[submodule "external/cecil"]
path = external/cecil
url = git://github.com/mono/cecil.git
[submodule "external/debian-snapshot"]
path = external/debian-snapshot
url = git://github.com/directhex/mono-snapshot.git
[submodule "external/rx"]
path = external/rx
url = git://github.com/mono/rx.git
@@ -20,13 +17,44 @@
[submodule "external/ikdasm"]
path = external/ikdasm
url = git://github.com/mono/ikdasm.git
[submodule "external/referencesource"]
path = external/referencesource
url = git://github.com/mono/referencesource
branch = mono
[submodule "external/reference-assemblies"]
path = external/binary-reference-assemblies
url = git://github.com/mono/reference-assemblies.git
[submodule "external/Lucene.Net.Light"]
path = external/Lucene.Net.Light
url = git://github.com/mono/Lucene.Net.Light.git
[submodule "external/nunit-lite"]
path = external/nunit-lite
url = git://github.com/mono/NUnitLite.git
[submodule "external/nuget-buildtasks"]
path = external/nuget-buildtasks
url = git://github.com/mono/NuGet.BuildTasks
[submodule "external/cecil-legacy"]
path = external/cecil-legacy
url = git://github.com/mono/cecil.git
branch = mono-legacy-0.9.5
[submodule "external/boringssl"]
path = external/boringssl
url = git://github.com/mono/boringssl.git
branch = mono
[submodule "external/corefx"]
path = external/corefx
url = git://github.com/mono/corefx.git
[submodule "external/bockbuild"]
path = external/bockbuild
url = git://github.com/mono/bockbuild.git
[submodule "external/linker"]
path = external/linker
url = git://github.com/mono/linker.git
[submodule "external/roslyn-binaries"]
path = external/roslyn-binaries
url = git://github.com/mono/roslyn-binaries.git
[submodule "external/corert"]
path = external/corert
url = git://github.com/mono/corert.git
[submodule "external/xunit-binaries"]
path = external/xunit-binaries
url = git://github.com/mono/xunit-binaries.git
[submodule "external/api-doc-tools"]
path = external/api-doc-tools
url = git://github.com/mono/api-doc-tools.git
[submodule "external/api-snapshot"]
path = external/api-snapshot
url = git://github.com/mono/api-snapshot.git
+126
View File
@@ -0,0 +1,126 @@
# Mono Code Owners File
#
# GitHub uses this file to determine who to assign for reviews
# on pull requests. Please keep this file alphabetically sorted.
#
# References:
#
# https://github.com/blog/2392-introducing-code-owners
# https://help.github.com/articles/about-codeowners
# These owners will be the default owners for everything in the repo.
* @luhenry @marek-safar
# Order is important. The last matching pattern has the most precedence.
/acceptance-tests @akoeplinger
/acceptance-tests/profiler-stress* @alexrp
/data @marek-safar @akoeplinger
/data/gdb @vargaz
/data/lldb @lewurm @vargaz
/docs @luhenry @marek-safar
/docs/sources/mono-api-profiler.html @alexrp
/external @marek-safar @luhenry
/external/binary-reference-assemblies @marek-safar @akoeplinger
/external/bockbuild @akoeplinger @alexischr
/external/boringssl @baulig
/external/nuget-buildtasks @radical @akoeplinger
/libgc @BrzVlad @vargaz
/llvm @vargaz
/man @marek-safar @miguel
/man/mprof-report.1 @alexrp
/mcs @marek-safar
/mcs/build @marek-safar @akoeplinger
/mcs/class @marek-safar @akoeplinger
/mcs/class/corlib/System.Reflection*/ @vargaz @lambdageek
/mcs/class/Mono.Btls.Interface @baulig
/mcs/class/Mono.Data.Tds @egorbo
/mcs/class/Mono.Debugger.Soft @vargaz
/mcs/class/Mono.Options @jonpryor
/mcs/class/Mono.Profiler.Log @alexrp
/mcs/class/Mono.Security/Mono.Security/Interface @baulig
/mcs/class/System/Mono.AppleTls @baulig
/mcs/class/System/Mono.Btls @baulig
/mcs/class/System/Mono.Net.Security @baulig
/mcs/class/System/Mono.Security.Interface @baulig
/mcs/class/System.Data* @egorbo
/mcs/errors @marek-safar
/mcs/ilasm @marek-safar
/mcs/jay @marek-safar
/mcs/mcs @marek-safar
/mcs/tests @marek-safar
/mcs/tools @marek-safar @akoeplinger
/mono @luhenry
/mono/btls @baulig
/mono/dis @lambdageek @vargaz
/mono/eglib @kumpera @vargaz @luhenry
/mono/metadata @vargaz @kumpera
/mono/metadata/*verify* @kumpera
/mono/metadata/*profiler* @alexrp
/mono/metadata/monitor* @brzvlad
/mono/metadata/sgen* @brzvlad
/mono/metadata/threads* @luhenry @kumpera
/mono/metadata/threadpool* @luhenry
/mono/metadata/w32* @luhenry
/mono/mini @vargaz @kumpera
/mono/mini/*cfgdump* @lewurm
/mono/mini/*exceptions* @lewurm
/mono/mini/*ppc* @lewurm
/mono/mini/*type-check* @lewurm
/mono/mini/interp/* @lewurm
/mono/mini/*profiler* @alexrp
/mono/mini/debugger-agent.c @DavidKarlas
/mono/profiler @alexrp @kumpera
/mono/sgen @brzvlad @kumpera
/mono/utils @kumpera @vargaz
/mono/utils/atomic* @alexrp
/mono/utils/mono-hwcap* @alexrp
/mono/utils/mono-mem* @alexrp
/mono/utils/mono-threads* @luhenry @kumpera
/msvc @ntherning
/msvc/*profiler* @alexrp
/msvc/scripts @akoeplinger
/packaging/ @alexischr @akoeplinger
/packaging/MacSDK/msbuild.py @radical @akoeplinger
/runtime @akoeplinger @marek-safar
/samples @luhenry
/samples/profiler @alexrp
/samples/size @alexrp
/scripts @akoeplinger
/scripts/ci @akoeplinger
/scripts/ci/run-test-profiler-stress-tests.sh @alexrp
/support @luhenry @vargaz
/tools @kumpera
/tools/checker @tritao
/tools/crash-bisector @kumpera
/tools/locale-builder @marek-safar
/tools/monograph @vargaz
/tools/nuget-hash-extractor @marek-safar
/tools/offsets-tool @lewurm @rolfbjarne
/tools/pedump @kumpera @lambdageek
/tools/sgen @brzvlad
+10 -16
View File
@@ -21,29 +21,23 @@ investigate bugs, regressions and problems.
License
=======
The Mono project uses the MIT X11, GNU LGPL version 2 and the Apache
License 2.0. We also imported some Microsoft code licensed under the
open source Microsoft Public License.
The Mono runtime, compilers, and tools and most of the class libraries
are licensed under the MIT license. But include some bits of code
licensed under different licenses. The exact list is [available here](https://github.com/mono/mono/blob/master/LICENSE).
Different parts of Mono use different licenses. The actual details of
which licenses are used for which parts are detailed on the LICENSE
file in this directory.
When contributing code, make sure that your contribution falls under
the appropriate license. For example, contributions to code licensed
under MIT/X11 code, should be MIT/X11 code.
CLA
=======
The runtime (`mono/...`) is a special case. The code is dual-licensed
by Xamarin under both the GNU LGPL v2 license and is also available
under commercial terms. For the runtime, you should either sign an
agreement that grants Xamarin the rights to relicense your code under
other licenses other than the LGPL v2 or your contribution must be
made as an MIT/X11 license which grants us the same rights, but
involves no paperwork. For the latter case, please specify on your
commit(s) that you are licensing the changes under MIT/X11.
Contributions are now taken under the [.NET Foundation CLA](https://cla2.dotnetfoundation.org/).
For other parts of the project that are dual-licensed, please state
on your commit(s) what license you are contributing the changes under.
Code Review
=======
We are requiring code reviews before merging a pull request.
GitHub won't let you merge a PR until someone from the Mono team approves it.
Testing
=======
+1 -501
View File
@@ -1,501 +1 @@
The Mono runtime is licensed under the terms of the GNU
Library General Public License, version 2.
The eglib directory is licensed under the terms of the MIT
X11 license and is a drop-in replacement for Mono's use of
glib 2.0 (which was LGPL).
The Boehm licensing information is in the libgc directory
The SGen Garbage Collector is under the terms of the MIT X11
license
The class libraries under mono/mcs are unless otherwise stated
under the MIT X11 license.
Open source Microsoft code is licensed under the original terms
which is either MS-PL for older components, or dual licensed
MS-PL/Apache2 licensed.
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
See LICENSE file in the project root for full license information.
-5719
View File
File diff suppressed because it is too large. Load diff
+1406 -102
View File
File diff suppressed because it is too large. Load diff
+34 -50
View File
@@ -2,36 +2,37 @@ ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = $(WERROR_CFLAGS)
MONOTOUCH_SUBDIRS = $(libgc_dir) eglib/src mono
MONOTOUCH_SUBDIRS = $(libgc_dir) mono
# Some tools might not build when cross-compiling
if CROSS_COMPILING
SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir)
# Keep in sync with SUBDIRS
## 'tools' is not normally built
DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs
tools_dir =
else
SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir)
# Keep in sync with SUBDIRS
## 'tools' is not normally built
DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs
tools_dir = tools
endif
SUBDIRS = po $(libgc_dir) mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) msvc $(docs_dir) acceptance-tests llvm
# Keep in sync with SUBDIRS
DIST_SUBDIRS = m4 po $(libgc_dir) mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests llvm
all: update_submodules
SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date'
update_submodules:
@$(srcdir)/scripts/update_submodules
@$(srcdir)/scripts/update_submodules.sh
.PHONY: update_submodules
EXTRA_DIST= \
README.md \
LICENSE \
autogen.sh \
mkinstalldirs \
mono-uninstalled.pc.in \
winconfig.h \
external
README.md \
LICENSE \
autogen.sh \
mkinstalldirs \
mono-uninstalled.pc.in \
winconfig.h \
code_of_conduct.md \
external \
mcs/class/referencesource
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
@@ -41,30 +42,25 @@ dist-hook:
test -d $(distdir)/mcs || mkdir $(distdir)/mcs
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
rm -rf `find $(top_distdir)/external -path '*\.git'`
rm -f `find $(top_distdir)/external -path '*\.exe'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*'`
cp mcs/class/lib/basic/System.Configuration.dll mcs/class/lib/monolite/
cp mcs/class/lib/basic/System.Security.dll mcs/class/lib/monolite/
# Disable this for now because it is very slow and causes wrench to timeout:
# test ! -d $(GIT_DIR) || ./scripts/commits-to-changelog.py --root=$(distdir) last-commit-with-compulsory-changelog-entry
rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*'`
pkgconfigdir = $(libdir)/pkgconfig
noinst_DATA = mono-uninstalled.pc
DISTCLEANFILES= mono-uninstalled.pc
# building with monolite
mcslib = $(mcs_topdir)/class/lib
monolite = $(mcslib)/monolite
mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c)
monolite_url = http://download.mono-project.com/monolite/monolite-$(mono_corlib_version)-latest.tar.gz
.PHONY: get-monolite-latest
get-monolite-latest:
-rm -fr $(mcslib)/monolite-*
-mkdir -p $(mcslib)
test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
cd $(mcslib) && mv -f monolite-* monolite
$(MAKE) -C $(mcs_topdir)/class get-monolite-latest
if BITCODE
BITCODE_CHECK=yes
endif
.PHONY: check-ci
check-ci:
MONO_LLVMONLY=$(BITCODE_CHECK) $(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
.PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
validate: do-build-mono-mcs
@@ -113,23 +109,6 @@ monotouch-do-clean:
endif
win32getdeps:
wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip
wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip
wget http://www.go-mono.com/archive/libiconv-1.7.zip
wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip
wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
unzip -n -d / pkgconfig-0.11-20020310.zip
unzip -n -d / glib-2.0.4-20020703.zip
unzip -n -d / glib-dev-2.0.4-20020703.zip
unzip -n -d / libiconv-1.7.zip
unzip -n -d / libiconv-dev-1.7.zip
unzip -n -d / libintl-0.10.40-20020101.zip
win32setup:
makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi
update-csproj:
-rm msvc/scripts/order
-rm msvc/scripts/order.xml
@@ -151,6 +130,7 @@ package-inputs:
read libou; echo " <library_output>$$libou</library_output>"; \
read fx_ver; echo " <fx_version>$$fx_ver</fx_version>"; \
read profile; echo " <profile>$$profile</profile>"; \
read resxt; echo " <resources>$$resxt</resources>"; \
read resp; echo " <response>$$resp</response>"; \
echo " </project>") >> msvc/scripts/order.xml; \
done
@@ -162,3 +142,7 @@ update-llvm-version:
REV=`$(LLVM_DIR)/bin/llvm-config --version` && sed -e "s,expected_llvm_version=.*,expected_llvm_version=\"$$REV\"," < configure.ac > tmp && mv tmp configure.ac && echo "Version set to $$REV."
update-solution-files:
make update-csproj
make package-inputs
(cd msvc/scripts; make genproj.exe; mono genproj.exe)
+44
View File
@@ -0,0 +1,44 @@
Microsoft Patent Promise for Mono
Microsoft Corporation and its affiliates (“Microsoft”) promise not to
assert any Applicable Patents against you for making, using, selling,
offering for sale, importing, or distributing Mono.
If you file, maintain, or voluntarily participate in any claim in a
lawsuit alleging direct or contributory patent infringement by Mono,
or inducement of patent infringement by Mono, then your rights under
this promise will automatically terminate.
This promise is not an assurance that (i) any Applicable Patents are
valid or enforceable or (ii) Mono does not infringe patents or other
intellectual property rights of any third party. No rights except
those expressly stated in this promise are granted, waived or received
by Microsoft, whether by implication, exhaustion, estoppel or
otherwise. This is a personal promise directly from Microsoft to you,
and you agree as a condition of benefitting from it that no Microsoft
rights are received from suppliers, distributors, or otherwise in
connection with this promise.
Definitions:
“Mono” means those portions of the software development technology, as
originally distributed by Xamarin, Inc. or the .NET Foundation under
the name “Mono,” that implement .NET Framework Functionality, provided
that such portions at a minimum implement all of the required parts of
the mandatory provisions of Standard ECMA-335 – Common Language
Infrastructure (CLI).
“.NET Framework Functionality” means any functionality in Microsoft’s
.NET Framework as described in Microsoft’s API documentation on
Microsoft’s MSDN website, including the functionality in
Windowsbase.dll, but excluding all other functionality in the Windows
Presentation Foundation component of .NET Framework.
“Applicable Patents” are those patent claims, currently owned by
Microsoft and acquired in the future, that are necessarily infringed
by Mono. For clarity, Applicable Patents do not include any patent
claims that are infringed (x) by any underlying or enabling technology
that may be used, combined, or distributed in connection with Mono
(such as hardware, operating systems, or applications that run on
Mono), (y) only as a consequence of modification of Mono, or (z) only
by the combination of Mono with third party code.
+109 -35
View File
@@ -3,6 +3,8 @@ create cross platform applications. It is an open source
implementation of Microsoft's .NET Framework based on the ECMA
standards for C# and the Common Language Runtime.
The Mono project is part of the [.NET Foundation](http://www.dotnetfoundation.org/)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mono/mono?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1. [Compilation and Installation](#compilation-and-installation)
@@ -13,32 +15,46 @@ standards for C# and the Common Language Runtime.
6. [Configuration Options](#configuration-options)
7. [Working with Submodules](#working-with-submodules)
**Build Status**
### Build Status
Officially supported architectures:
| OS | Architecture | Status |
|--------------|--------------------|------------------------------|
| Ubuntu 14.04 | amd64 | [![ubuntu-1404-amd64][1]][2] |
| Ubuntu 14.04 | i386 | [![ubuntu-1404-i386][3]][4] |
| Debian 8 | armel | [![debian-8-armel][5]][6] |
| Debian 8 | armhf | [![debian-8-armhf][7]][8] |
| Debian 8 | arm64 | [![debian-8-arm64][9]][10] |
| OS X | amd64 | [![osx-amd64][11]][12] |
| OS X | i386 | [![osx-i386][13]][14] |
| Windows | amd64 | [![windows-amd64][15]][16] |
| Windows | i386 | [![windows-amd64][17]][18] |
| CentOS | s390x (cs) | [![centos-s390x][19]][20] |
| Debian 8 | ppc64el (cs) | [![debian-8-ppc64el][21]][22]|
| debian-amd64 | debian-i386 | debian-armel | debian-armhf | windows-amd64 |
|-------------------------|------------------------|-------------------------|-------------------------|---------------------------|
| [![debian-amd64][1]][2] | [![debian-i386][3]][4] | [![debian-armel][5]][6] | [![debian-armhf][7]][8] | [![windows-amd64][9]][10] |
_(cs) = community supported architecture_
Community supported architectures:
| centos-s390x |
|---------------------------|
| [![centos-s390x][11]][12] |
[1]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/badge/icon
[2]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/
[3]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-i386/badge/icon
[4]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-i386/
[5]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armel/badge/icon
[6]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armel/
[7]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armhf/badge/icon
[8]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armhf/
[9]: https://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true
[10]: https://ci.appveyor.com/project/ajlennon/mono-817/branch/master
[11]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=nealef-s390x-1/badge/icon
[12]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=nealef-s390x-1/
[1]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64/badge/icon
[2]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64
[3]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-i386/badge/icon
[4]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-i386/
[5]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armel/badge/icon
[6]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armel/
[7]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armhf/badge/icon
[8]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armhf/
[9]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/badge/icon
[10]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/
[11]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/badge/icon
[12]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/
[13]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/badge/icon
[14]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/
[15]: https://jenkins.mono-project.com/job/z/label=w64/badge/icon
[16]: https://jenkins.mono-project.com/job/z/label=w64/
[17]: https://jenkins.mono-project.com/job/z/label=w32/badge/icon
[18]: https://jenkins.mono-project.com/job/z/label=w32/
[19]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=centos-s390x/badge/icon
[20]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=centos-s390x
[21]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-8-ppc64el/badge/icon
[22]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-8-ppc64el
Compilation and Installation
============================
@@ -80,8 +96,7 @@ Testing and Installation
You can run the mono and mcs test suites with the command: `make check`.
Expect to find a few test suite failures. As a sanity check, you
can compare the failures you got with [https://wrench.mono-project.com/Wrench/](https://wrench.mono-project.com/Wrench/)
and [http://jenkins.mono-project.com/](http://jenkins.mono-project.com/).
can compare the failures you got with [https://jenkins.mono-project.com/](https://jenkins.mono-project.com/).
You can now install mono with: `make install`
@@ -105,6 +120,8 @@ See the man pages for mono(1), mcs(1) and monodis(1) for further details.
Directory Roadmap
=================
* `acceptance-tests/` - Optional third party test suites used to validate Mono against a wider range of test cases.
* `data/` - Configuration files installed as part of the Mono runtime.
* `docs/` - Technical documents about the Mono runtime.
@@ -176,25 +193,28 @@ disable the compilation of a Mono runtime with the SGen garbage
collector.
* On platforms that support it, after building Mono, you will have
both a `mono` binary and a `mono-sgen` binary. `mono` uses Boehm,
both a `mono-boehm` binary and a `mono-sgen` binary. `mono-boehm` uses Boehm,
while `mono-sgen` uses the Simple Generational GC.
* `--with-gc=[included, boehm, none]` - Selects the default Boehm
* `--with-libgc=[included, none]` - Selects the default Boehm
garbage collector engine to use.
* *included*: (*slighty modified Boehm GC*) This is the default
* *included*: (*slightly modified Boehm GC*) This is the default
value for the Boehm GC, and it's the most feature complete, it will
allow Mono to use typed allocations and support the debugger.
* *boehm*: This is used to use a system-install Boehm GC, it is
useful to test new features available in Boehm GC, but we do not
recommend that people use this, as it disables a few features.
* *none*:
Disables the inclusion of a garbage collector.
Disables the inclusion of a Boehm garbage collector.
* This defaults to `included`.
* `--with-cooperative-gc`
* If you pass this flag the Mono runtime is configured to only use
the cooperative mode of the garbage collector. If you do not pass
this flag, then you can control at runtime the use of the
cooperative GC mode by setting the `MONO_ENABLE_COOP` flag.
* `--with-tls=__thread,pthread`
* Controls how Mono should access thread local storage,
@@ -420,8 +440,10 @@ cycle.
multiple CPUs to do its work. This helps performance
on multi-CPU machines as the work is divided across CPUS.
* This option is not currently the default as we have
not done much testing with Mono.
* This option is not currently the default on OSX
as it runs into issues there.
* This option only applies to the Boehm GC.
* `--enable-dtrace`
@@ -439,6 +461,19 @@ disable it.
* There are a number of runtime options to control this
also, see the man page.
* `--with-csc=roslyn,mcs,default`
* Use this option to configure which C# compiler to use. By default
the configure script will pick Roslyn, except on platforms where
Roslyn does not work (Big Endian systems) where it will pick mcs.
If you specify "mcs", then Mono's C# compiler will be used. This
also allows for a complete bootstrap of Mono's core compiler and
core libraries from source.
  If you specify "roslyn", then Roslyn's C# compiler will be used.
This currently uses Roslyn binaries.
* `--enable-nacl`
* This configures the Mono compiler to generate code
@@ -448,6 +483,16 @@ http://code.google.com/p/nativeclient/
* Currently this is used with Mono's AOT engine as
Native Client does not support JIT engines yet.
* `--enable-wasm`
* Use this option to configure mono to run on WebAssembly. It will
set both host and target to the WebAssembly triplet. This overrides
the values passed to `--host` or `--target` and ignored what config.sub guesses.
This is a workaround to enable usage of old automake versions that don't
recognize the wasm triplet.
Working With Submodules
=======================
@@ -497,3 +542,32 @@ to do at all), first edit `.gitmodules` to point to the new location, then:
The desired output diff is a change in `.gitmodules` to reflect the
change in the remote URL, and a change in /<submodule> where you see
the desired change in the commit hash.
License
=======
See the LICENSE file for licensing information, and the PATENTS.TXT
file for information about Microsoft's patent grant.
Mono Trademark Use Policy
=========================
The use of trademarks and logos for Mono can be found [here] (http://www.dotnetfoundation.org/legal/mono-tm).
Maintaining the Class Library Solution Files
============================================
Mono now ships with a solution file that can be used to build the
assemblies from an IDE. Either by opening the topmost `net_4_x.sln`
file, or to by loading one of the individual `csproj` files located in
each directory.
These are maintained by extracting the configuration information from
our Makefiles, which as of May 2016 remain the canonical location for
configuration information.
When changes are made to the Makefiles, a user would need to run the
following command to re-generate the solution files at the top level:
$ make update-solution-files
+6
View File
@@ -0,0 +1,6 @@
Makefile.in
Makefile
*.exe
*.dll
*.mdb
coreclr-testlist.txt
@@ -0,0 +1,14 @@
using System;
using System.IO;
using System.Reflection;
namespace System.Runtime.Loader
{
public static class AssemblyExtensions
{
public static Type[] GetTypes(this Assembly assembly)
{
return assembly.GetTypes ();
}
}
}
@@ -0,0 +1,41 @@
using System;
using System.IO;
using System.Reflection;
namespace System.Runtime.Loader
{
public abstract class AssemblyLoadContext
{
protected abstract Assembly Load(AssemblyName assemblyName);
protected Assembly LoadFromAssemblyPath(string assemblyPath)
{
if (assemblyPath == null)
throw new ArgumentNullException("assemblyPath");
if (!Path.IsPathRooted(assemblyPath))
throw new ArgumentException("Gimme an absolute path " + assemblyPath + " XXX " + Path.GetPathRoot(assemblyPath), "assemblyPath");
return Assembly.LoadFrom (assemblyPath);
}
public Assembly LoadFromAssemblyName(AssemblyName assemblyName)
{
// AssemblyName is mutable. Cache the expected name before anybody gets a chance to modify it.
string requestedSimpleName = assemblyName.Name;
Assembly assembly = Load(assemblyName);
if (assembly == null)
throw new FileLoadException("File not found", requestedSimpleName);
return assembly;
}
public static AssemblyName GetAssemblyName(string assemblyPath)
{
if (!File.Exists (assemblyPath))
throw new Exception ("file not found");
return new AssemblyName (Path.GetFileName (assemblyPath));
}
}
}
+26
View File
@@ -0,0 +1,26 @@
ACCEPTANCE_TESTS_PATH=external
BENCHMARKER_PATH=$(ACCEPTANCE_TESTS_PATH)/benchmarker
ROSLYN_PATH=$(ACCEPTANCE_TESTS_PATH)/roslyn
CORECLR_PATH=$(ACCEPTANCE_TESTS_PATH)/coreclr
MSTESTSUITE_PATH=$(ACCEPTANCE_TESTS_PATH)/ms-test-suite
CLEANFILES = *.dll *.exe *.mdb
EXTRA_DIST=README.md SUBMODULES.json versions.mk roslyn.mk coreclr.mk ms-test-suite.mk
CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
TOOLS_CLASS=$(mcs_topdir)/class/lib/build
RUNTIME = MONO_PATH=$(CLASS) $(abs_top_builddir)/runtime/mono-wrapper --debug
TOOLS_RUNTIME = MONO_PATH=$(TOOLS_CLASS) $(abs_top_builddir)/runtime/mono-wrapper --debug
MCS = $(TOOLS_RUNTIME) $(CSC) -nologo -noconfig -lib:$(CLASS) -r:System.dll -r:System.Core.dll -r:System.Xml.dll -r:Microsoft.CSharp.dll
ILASM = $(TOOLS_RUNTIME) $(TOOLS_CLASS)/ilasm.exe
include versions.mk
include profiler-stress.mk
include roslyn.mk
include coreclr.mk
include ms-test-suite.mk
check-full: check-profiler-stress check-roslyn check-coreclr check-ms-test-suite
clean-local: clean-local-coreclr
+35
View File
@@ -0,0 +1,35 @@
Acceptance tests
================
This directory contains acceptance tests, which are third party test suites and frameworks that are used to validate Mono against a wider range of test cases that go beyond the Mono unit tests that run as part of CI.
In order to make checking out those test suites optional we don't use traditional git submodules, but instead clone them on demand when needed. The custom submodule repositories are checked out into the acceptance-tests/external/ directory.
## Usage
Running all test suites is possible via "make check-full". There are also targets for running individual test suites, see below.
Some of the test suites require an installed Mono (i.e. they don't work with the in-tree build), those will ask you to pass in the PREFIX variable pointing to the installation directory when invoking make. Note that this directory needs to be writable as we overwrite some files there as part of testing.
## Individual test suites and targets
* `make check-ms-test-suite` - Runs tests that were shared with Xamarin, those are not available publically and will be skipped when the repository is not accessible.
* `make check-roslyn` - Runs the Roslyn test suite.
* `make check-coreclr` - Runs the CoreCLR test suite.
* `make coreclr-runtest-coremanglib` - Runs only the CoreMangLib portion of the CoreCLR tests, those tests mostly target the BCL behavior.
* `make coreclr-runtest-basic` - Runs only the CoreCLR tests that target runtime behavior and stability.
* `make coreclr-compile-tests` - Convenience target that precompiles all the test cases in parallel.
* `make coreclr-gcstress` - Runs the CoreCLR GC stress tests.
## Updating submodules
The SUBMODULES.json file stores information about the submodules, and make targets are used to check out submodules, check their versions, and update the submodule information:
* `make validate-<module>` - Checks whenever `<module>` is checked out and matches the version in the info file.
* `make reset-<module>` - Clones `<module>` if neccesary and checks out the revision specified in the info file.
* `make bump-<module>` - Updates the revision stored in the info file for `<module>`.
* `make bump-current-<module>` - Updates the revision stored in the info file for `<module>` to the current revision.
* `make commit-bump-<module>` - Same as `make bump-<module>`, but commits the change.
* `make commit-bump-current-<module>` - Same as `make bump-current-<module>`, but commits the change.
Example: when making a change in the CoreCLR submodule (like disabling something on Mono), you'd commit the change there and then run `make bump-current-coreclr` or `make commit-bump-current-coreclr` to update the version in SUBMODULES.json.
+34
View File
@@ -0,0 +1,34 @@
[
{
"name": "roslyn",
"url": "git://github.com/dotnet/roslyn.git",
"rev": "322bd5b2bbf07df6a67de35cbcb2365484412f70",
"remote-branch": "origin/master",
"branch": "master",
"directory": "roslyn"
},
{
"name": "coreclr",
"url": "git://github.com/mono/coreclr.git",
"rev": "d0e6a36f782f5ee1ca0b7d3ec0c55725c3571b1f",
"remote-branch": "origin/mono",
"branch": "mono",
"directory": "coreclr"
},
{
"name": "ms-test-suite",
"url": "[email protected]:xamarin/ms-test-suite.git",
"rev": "73c155f76b55839f26ba707d6d40091060e4f5d8",
"remote-branch": "origin/master",
"branch": "master",
"directory": "ms-test-suite"
},
{
"name": "benchmarker",
"url": "git://github.com/xamarin/benchmarker.git",
"rev": "97f618cd585af549dd861b7c142656c496f6a89b",
"remote-branch": "origin/master",
"branch": "master",
"directory": "benchmarker"
}
]
File diff suppressed because it is too large. Load diff
+2
View File
@@ -0,0 +1,2 @@
*
!.gitignore
+13
View File
@@ -0,0 +1,13 @@
check-ms-test-suite: $(CLASS)/nunitlite.dll
@if $(MAKE) validate-ms-test-suite RESET_VERSIONS=1; then \
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -debug:portable -t:library -warn:1 -r:$(CLASS)/nunitlite.dll" && \
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-lite-console.exe -exclude=MonoBug,BadTest -format:nunit2" NUNIT_XML_RESULT="-result:$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml" || EXIT_CODE=1; \
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug:portable -warn:1" && \
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup run MONO="$(RUNTIME)" || EXIT_CODE=1; \
exit $$EXIT_CODE; \
else \
echo "*** [ms-test-suite] Getting the repository failed, you probably don't have access to this Xamarin-internal resource. Skipping."; \
fi
$(CLASS)/nunitlite.dll:
$(MAKE) -C $(mcs_topdir)/tools/nunit-lite
+13
View File
@@ -0,0 +1,13 @@
SYS_REFS = \
System.dll \
System.Core.dll \
System.Data.dll \
System.Runtime.Serialization.dll \
System.Xml.dll \
System.Xml.Linq.dll \
Mono.Posix.dll
check-profiler-stress:
@$(MAKE) validate-benchmarker RESET_VERSIONS=1
cd profiler-stress && $(MCS) -debug -define:ARCH_$(arch_target) -target:exe $(addprefix -r:, $(SYS_REFS)) -out:runner.exe @runner.exe.sources
cd profiler-stress && $(RUNTIME) runner.exe
+346
View File
@@ -0,0 +1,346 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Xml;
using Mono.Unix.Native;
using Newtonsoft.Json;
// Shut up CLS compliance warnings from Json.NET.
[assembly: CLSCompliant (true)]
namespace Mono.Profiling.Tests.Stress {
// https://github.com/xamarin/benchmarker/blob/master/tools/libdbmodel/Benchmark.cs
sealed class Benchmark {
public string Name { get; set; }
public string TestDirectory { get; set; }
public bool OnlyExplicit { get; set; }
public string[] CommandLine { get; set; }
public string[] ClientCommandLine { get; set; }
public string[] AOTAssemblies { get; set; }
public static Benchmark Load (string file)
{
return JsonConvert.DeserializeObject<Benchmark> (File.ReadAllText (file));
}
}
sealed class TestResult {
public Benchmark Benchmark { get; set; }
public ProcessStartInfo StartInfo { get; set; }
public Stopwatch Stopwatch { get; set; } = new Stopwatch ();
public int? ExitCode { get; set; }
public string StandardOutput { get; set; }
public string StandardError { get; set; }
}
static class Program {
static readonly string[] _options = new [] {
"exception",
"monitor",
"gc",
"gcalloc",
"gcmove",
"gcroot",
"gchandle",
"finalization",
"counter",
"jit",
};
static readonly TimeSpan _timeout = TimeSpan.FromHours (9);
static readonly Dictionary<string, Predicate<Benchmark>> _filters = new Dictionary<string, Predicate<Benchmark>> {
{ "ironjs-v8", FilterArmArchitecture },
};
static readonly Dictionary<string, Action<TestResult>> _processors = new Dictionary<string, Action<TestResult>> {
{ "msbiology", Process32BitOutOfMemory },
};
static string FilterInvalidXmlChars (string text) {
return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", string.Empty);
}
static bool FilterArmArchitecture (Benchmark benchmark)
{
#if ARCH_arm || ARCH_arm64
return false;
#else
return true;
#endif
}
static void Process32BitOutOfMemory (TestResult result)
{
if (Environment.Is64BitProcess)
return;
if (result.ExitCode == null || result.ExitCode == 0)
return;
if (result.StandardError.Contains ("OutOfMemoryException"))
result.ExitCode = 0;
}
static bool IsSupported (Benchmark benchmark)
{
return _filters.TryGetValue (benchmark.Name, out var filter) ? filter (benchmark) : true;
}
static int Main ()
{
var depDir = Path.Combine ("..", "external", "benchmarker");
var benchDir = Path.Combine (depDir, "benchmarks");
var testDir = Path.Combine (depDir, "tests");
var benchmarks = Directory.EnumerateFiles (benchDir, "*.benchmark")
.Select (Benchmark.Load)
.Where (b => !b.OnlyExplicit && b.ClientCommandLine == null && IsSupported (b))
.OrderBy (b => b.Name)
.ToArray ();
var monoPath = Path.GetFullPath (Path.Combine ("..", "..", "runtime", "mono-wrapper"));
var classDir = Path.GetFullPath (Path.Combine ("..", "..", "mcs", "class", "lib", "net_4_x"));
var rand = new Random ();
var cpus = Environment.ProcessorCount;
var results = new List<TestResult> (benchmarks.Length);
var sw = Stopwatch.StartNew ();
for (var i = 0; i < benchmarks.Length; i++) {
var bench = benchmarks [i];
var sampleFreq = rand.Next (-1000, 1001);
var sampleMode = rand.Next (0, 2) == 1 ? "-real" : string.Empty;
var maxSamples = rand.Next (0, cpus * 2000 + 1);
var heapShotFreq = rand.Next (-10, 11);
var maxFrames = rand.Next (0, 33);
var options = _options.ToDictionary (x => x, _ => rand.Next (0, 2) == 1)
.Select (x => (x.Value ? string.Empty : "no") + x.Key)
.ToArray ();
var profOptions = $"maxframes={maxFrames},{string.Join (",", options)},output=/dev/null";
if (sampleFreq > 0)
profOptions += $",sample{sampleMode}={sampleFreq},maxsamples={maxSamples}";
if (heapShotFreq > 0)
profOptions += $",heapshot={heapShotFreq}gc";
var info = new ProcessStartInfo {
UseShellExecute = false,
WorkingDirectory = Path.Combine (testDir, bench.TestDirectory),
FileName = monoPath,
Arguments = $"--debug --profile=log:{profOptions} " + string.Join (" ", bench.CommandLine),
RedirectStandardOutput = true,
RedirectStandardError = true,
};
info.EnvironmentVariables.Clear ();
info.EnvironmentVariables.Add ("MONO_PATH", classDir);
var progress = $"({i + 1}/{benchmarks.Length})";
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] {progress} Running {bench.Name} with profiler options: {profOptions}");
Console.ResetColor ();
var result = new TestResult {
Benchmark = bench,
StartInfo = info,
};
using (var proc = new Process ()) {
proc.StartInfo = info;
var stdout = new StringBuilder ();
var stderr = new StringBuilder ();
proc.OutputDataReceived += (sender, args) => {
if (args.Data != null)
lock (result)
stdout.AppendLine (args.Data);
};
proc.ErrorDataReceived += (sender, args) => {
if (args.Data != null)
lock (result)
stderr.AppendLine (args.Data);
};
result.Stopwatch.Start ();
proc.Start ();
proc.BeginOutputReadLine ();
proc.BeginErrorReadLine ();
if (!proc.WaitForExit ((int) _timeout.TotalMilliseconds)) {
// Force a thread dump.
Syscall.kill (proc.Id, Signum.SIGQUIT);
Thread.Sleep (1000);
try {
proc.Kill ();
} catch (Exception) {
}
} else
result.ExitCode = proc.ExitCode;
result.Stopwatch.Stop ();
lock (result) {
result.StandardOutput = stdout.ToString ();
result.StandardError = stderr.ToString ();
}
}
var resultStr = result.ExitCode == null ? "timed out" : $"exited with code: {result.ExitCode}";
Console.ForegroundColor = result.ExitCode != 0 ? ConsoleColor.Red : ConsoleColor.Green;
Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] {progress} {bench.Name} took {result.Stopwatch.Elapsed.ToString ("G")} and {resultStr}");
Console.ResetColor ();
if (result.ExitCode != 0) {
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine ("===== stdout =====");
Console.ResetColor ();
Console.WriteLine (result.StandardOutput);
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine ("===== stderr =====");
Console.ResetColor ();
Console.WriteLine (result.StandardError);
}
if (_processors.TryGetValue (bench.Name, out var processor))
processor (result);
results.Add (result);
}
sw.Stop ();
var successes = results.Count (r => r.ExitCode == 0);
var failures = results.Count (r => r.ExitCode != null && r.ExitCode != 0);
var timeouts = results.Count (r => r.ExitCode == null);
var settings = new XmlWriterSettings {
NewLineOnAttributes = true,
Indent = true,
};
using (var writer = XmlWriter.Create ("TestResult-profiler-stress.xml", settings)) {
writer.WriteStartDocument ();
writer.WriteComment ("This file represents the results of running a test suite");
writer.WriteStartElement ("test-results");
writer.WriteAttributeString ("name", "profiler-stress-tests.dummy");
writer.WriteAttributeString ("total", results.Count.ToString ());
writer.WriteAttributeString ("failures", failures.ToString ());
writer.WriteAttributeString ("not-run", "0");
writer.WriteAttributeString ("date", DateTime.Now.ToString ("yyyy-MM-dd"));
writer.WriteAttributeString ("time", DateTime.Now.ToString ("HH:mm:ss"));
writer.WriteStartElement ("environment");
writer.WriteAttributeString ("nunit-version", "2.4.8.0");
writer.WriteAttributeString ("clr-version", Environment.Version.ToString ());
writer.WriteAttributeString ("os-version", Environment.OSVersion.ToString ());
writer.WriteAttributeString ("platform", Environment.OSVersion.Platform.ToString ());
writer.WriteAttributeString ("cwd", Environment.CurrentDirectory);
writer.WriteAttributeString ("machine-name", Environment.MachineName);
writer.WriteAttributeString ("user", Environment.UserName);
writer.WriteAttributeString ("user-domain", Environment.UserDomainName);
writer.WriteEndElement ();
writer.WriteStartElement ("culture-info");
writer.WriteAttributeString ("current-culture", CultureInfo.CurrentCulture.Name);
writer.WriteAttributeString ("current-uiculture", CultureInfo.CurrentUICulture.Name);
writer.WriteEndElement ();
writer.WriteStartElement ("test-suite");
writer.WriteAttributeString ("name", "profiler-stress-tests.dummy");
writer.WriteAttributeString ("success", (failures + timeouts == 0).ToString ());
writer.WriteAttributeString ("time", ((int) sw.Elapsed.TotalSeconds).ToString ());
writer.WriteAttributeString ("asserts", (failures + timeouts).ToString ());
writer.WriteStartElement ("results");
writer.WriteStartElement ("test-suite");
writer.WriteAttributeString ("name", "MonoTests");
writer.WriteAttributeString ("success", (failures + timeouts == 0).ToString ());
writer.WriteAttributeString ("time", ((int) sw.Elapsed.TotalSeconds).ToString ());
writer.WriteAttributeString ("asserts", (failures + timeouts).ToString ());
writer.WriteStartElement ("results");
writer.WriteStartElement ("test-suite");
writer.WriteAttributeString ("name", "profiler-stress");
writer.WriteAttributeString ("success", (failures + timeouts == 0).ToString ());
writer.WriteAttributeString ("time", ((int) sw.Elapsed.TotalSeconds).ToString ());
writer.WriteAttributeString ("asserts", (failures + timeouts).ToString ());
writer.WriteStartElement ("results");
foreach (var result in results) {
var timeoutStr = result.ExitCode == null ? "_timeout" : string.Empty;
writer.WriteStartElement ("test-case");
writer.WriteAttributeString ("name", $"MonoTests.profiler-stress.{result.Benchmark.Name}{timeoutStr}");
writer.WriteAttributeString ("executed", "True");
writer.WriteAttributeString ("success", (result.ExitCode == 0).ToString ());
writer.WriteAttributeString ("time", ((int) result.Stopwatch.Elapsed.TotalSeconds).ToString ());
writer.WriteAttributeString ("asserts", result.ExitCode == 0 ? "0" : "1");
if (result.ExitCode != 0) {
writer.WriteStartElement ("failure");
writer.WriteStartElement ("message");
writer.WriteCData (FilterInvalidXmlChars (result.StandardOutput));
writer.WriteEndElement ();
writer.WriteStartElement ("stack-trace");
writer.WriteCData (FilterInvalidXmlChars (result.StandardError));
writer.WriteEndElement ();
writer.WriteEndElement ();
}
writer.WriteEndElement ();
}
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndElement ();
writer.WriteEndDocument ();
}
var failureStr = failures + timeouts != 0 ? $" ({failures} failures, {timeouts} timeouts)" : string.Empty;
Console.ForegroundColor = failures + timeouts != 0 ? ConsoleColor.Red : ConsoleColor.Green;
Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] Finished with {successes}/{results.Count} passing tests{failureStr}");
Console.ResetColor ();
return failures + timeouts;
}
}
}
@@ -0,0 +1,156 @@
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonBinaryType.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonBinaryWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonToken.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonType.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Bson/BsonObjectId.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/BinaryConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DataSetConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DataTableConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/CustomCreationConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/DateTimeConverterBase.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/EntityKeyMemberConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/ExpandoObjectConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/KeyValuePairConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/BsonObjectIdConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/RegexConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/StringEnumConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/ConstructorHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/VersionConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/DateFormatHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/DateTimeZoneHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Formatting.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConstructorAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonPosition.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPropertyKeyedCollection.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicProxy.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPath.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JRaw.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Required.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonDynamicContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonISerializableContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonLinqContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonPrimitiveContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DynamicValueProvider.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ErrorEventArgs.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JPropertyDescriptor.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultReferenceResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/PreserveReferencesHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/IJsonLineInfo.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonArrayAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonContainerAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/DefaultValueHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverterAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonObjectAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializerSettings.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonValidatingReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/IJEnumerable.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenEqualityComparer.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/MemberSerialization.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/ObjectCreationHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/IsoDateTimeConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/JavaScriptDateTimeConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Converters/XmlNodeConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonTextReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonPropertyAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonIgnoreAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonTextWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonWriterException.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonReaderException.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConverterCollection.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonConvert.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializationException.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonSerializer.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/Extensions.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JConstructor.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JContainer.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JEnumerable.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JObject.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JArray.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JToken.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JProperty.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JTokenType.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Linq/JValue.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/Extensions.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaException.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaModel.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaModelBuilder.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaNodeCollection.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaNode.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/UndefinedSchemaIdHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/ValidationEventArgs.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/ValidationEventHandler.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/CamelCasePropertyNamesContractResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ErrorContext.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IContractResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IValueProvider.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonDictionaryContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonProperty.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonPropertyCollection.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/MissingMemberHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/NullValueHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/ReferenceLoopHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchema.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaBuilder.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaConstants.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/IReferenceResolver.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaType.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonObjectContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalBase.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonSerializerProxy.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonStringContract.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/CachedAttributeGetter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/LateBoundMetadataTypeAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ReflectionValueProvider.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/OnErrorAttribute.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/Base64Encoder.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicProxyMetaObject.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicWrapper.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Serialization/ObjectConstructor.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ReflectionDelegateFactory.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/LateBoundReflectionDelegateFactory.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MethodCall.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringReference.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ThreadSafeStore.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/TypeNameHandling.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/BidirectionalDictionary.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/CollectionWrapper.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DateTimeUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumValue.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/EnumValues.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/JavaScriptUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonToken.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/JsonWriter.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringBuffer.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/CollectionUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ListWrapper.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MathUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/MiscellaneousUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/StringUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/TypeExtensions.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/Utilities/ValidationUtils.cs
../../external/Newtonsoft.Json/Src/Newtonsoft.Json/WriteState.cs
runner.cs
+18
View File
@@ -0,0 +1,18 @@
check-roslyn:
@$(MAKE) validate-roslyn RESET_VERSIONS=1
@if [ -z $$PREFIX ]; then echo "You need to set PREFIX to the prefix of the Mono installation that should be used for testing Roslyn." && exit 1; fi
sed -i -e 's/\\4.5-api"/\\4.5"/g' $$PREFIX/lib/mono/xbuild-frameworks/.NETFramework/v4.5/RedistList/FrameworkList.xml; \
export MSBuildExtensionsPath=$$PREFIX/lib/mono/xbuild; \
MONO_DOTNET_PORTABLE_DIR=$$PREFIX/lib/mono/xbuild-frameworks/.NETPortable/; \
if [ ! -d "$$MONO_DOTNET_PORTABLE_DIR/v4.6" ]; then \
mkdir -p $$MONO_DOTNET_PORTABLE_DIR; \
curl -SL "http://download.mono-project.com/third-party/RoslynBuildDependencies.zip" > /tmp/RoslynBuildDependencies.zip; \
unzip -o /tmp/RoslynBuildDependencies.zip -d /tmp/RoslynBuildDependencies; \
cp -r /tmp/RoslynBuildDependencies/PortableReferenceAssemblies/* $$MONO_DOTNET_PORTABLE_DIR; \
fi; \
cd $(ROSLYN_PATH); \
sed -i -e 'N; s/bootstrapArg=".*\n.*"/bootstrapArg=""/g' cibuild.sh; \
sed -i -e 's#-xml Binaries/\$$BUILD_CONFIGURATION/xUnitResults/#-nunit $(abs_top_builddir)/acceptance-tests/TestResult-#g' cibuild.sh; \
./cibuild.sh --mono-path $$PREFIX/bin || EXIT_CODE=1; \
sed -i -e 's/\\4.5"/\\4.5-api"/g' $$PREFIX/lib/mono/xbuild-frameworks/.NETFramework/v4.5/RedistList/FrameworkList.xml; \
exit $$EXIT_CODE
+54
View File
@@ -0,0 +1,54 @@
.PHONY: validate-versions reset-versions
SUBMODULES_CONFIG_FILE = $(top_srcdir)/acceptance-tests/SUBMODULES.json
include $(top_srcdir)/scripts/submodules/versions.mk
$(eval $(call ValidateVersionTemplate,benchmarker,BENCHMARKER))
$(eval $(call ValidateVersionTemplate,roslyn,ROSLYN))
$(eval $(call ValidateVersionTemplate,coreclr,CORECLR))
$(eval $(call ValidateVersionTemplate,ms-test-suite,MSTESTSUITE))
# Bump the given submodule to the revision given by the REV make variable
# If COMMIT is 1, commit the change
bump-benchmarker: __bump-benchmarker
bump-roslyn: __bump-version-roslyn
bump-coreclr: __bump-version-coreclr
bump-ms-test-suite: __bump-version-ms-test-suite
# Bump the given submodule to the branch given by the BRANCH/REMOTE_BRANCH make variables
# If COMMIT is 1, commit the change
bump-branch-benchmarker: __bump-branch-benchmarker
bump-branch-roslyn: __bump-branch-roslyn
bump-branch-coreclr: __bump-branch-coreclr
bump-branch-ms-test-suite: __bump-branch-ms-test-suite
# Bump the given submodule to its current GIT version
# If COMMIT is 1, commit the change
bump-current-benchmarker: __bump-current-benchmarker
bump-current-roslyn: __bump-current-version-roslyn
bump-current-coreclr: __bump-current-version-coreclr
bump-current-ms-test-suite: __bump-current-version-ms-test-suite
commit-bump-benchmarker:
$(MAKE) bump-benchmarker COMMIT=1
commit-bump-roslyn:
$(MAKE) bump-roslyn COMMIT=1
commit-bump-coreclr:
$(MAKE) bump-coreclr COMMIT=1
commit-bump-ms-test-suite:
$(MAKE) bump-ms-test-suite COMMIT=1
commit-bump-current-benchmarker:
$(MAKE) bump-current-benchmarker COMMIT=1
commit-bump-current-roslyn:
$(MAKE) bump-current-roslyn COMMIT=1
commit-bump-current-coreclr:
$(MAKE) bump-current-coreclr COMMIT=1
commit-bump-current-ms-test-suite:
$(MAKE) bump-current-ms-test-suite COMMIT=1
-79
View File
@@ -1,79 +0,0 @@
#
# Appveyor configuration file for CI build of Mono on Windows (under Cygwin)
#
# For further details see http://www.appveyor.com
#
#
# Custom environment variables
#
environment:
global:
CYG_ROOT: C:\cygwin
CYG_MIRROR: http://cygwin.mirror.constant.com
CYG_CACHE: C:\cygwin\var\cache\setup
CYG_BASH: C:\cygwin\bin\bash
#
# Cache Cygwin files to speed up build
#
cache:
- '%CYG_CACHE%'
#
# Do a shallow clone of the repo to speed up build
#
clone_depth: 1
#
# Initialisation prior to pulling the Mono repository
# Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
#
init:
- git config --global core.autocrlf input
#
# Install needed build dependencies
#
install:
- ps: 'Start-FileDownload "http://cygwin.com/setup-x86.exe" -FileName "setup-x86.exe"'
- 'setup-x86.exe --quiet-mode --no-shortcuts --only-site --root "%CYG_ROOT%" --site "%CYG_MIRROR%" --local-package-dir "%CYG_CACHE%" --packages autoconf,automake,bison,gcc-core,gcc-g++,mingw-runtime,mingw-binutils,mingw-gcc-core,mingw-gcc-g++,mingw-pthreads,mingw-w32api,libtool,make,python,gettext-devel,gettext,intltool,libiconv,pkg-config,git,curl,libxslt > NUL 2>&1'
- '%CYG_BASH% -lc "cygcheck -dc cygwin"'
# Cygwin build script
#
# NOTES:
#
# The stdin/stdout file descriptor appears not to be valid for the Appveyor
# build which causes failures as certain functions attempt to redirect
# default file handles. Ensure a dummy file descriptor is opened with 'exec'.
#
build_script:
- 'echo Building...'
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; ./autogen.sh --prefix=/usr/local --host=i686-pc-mingw32"'
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make get-monolite-latest"'
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make -j2"'
- 'echo Installing...'
- 'mkdir %APPVEYOR_BUILD_FOLDER%\install'
- '%CYG_BASH% -lc "export CYGWIN=winsymlinks:native; mount \"$APPVEYOR_BUILD_FOLDER\install\" /usr/local; cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make install; umount /usr/local"'
#
# Disable tests for now
#
test: off
#
# Only build the master branch
#
branches:
only:
- master
#
# NOTE: Currently this is the Mono installation tree. In future we will create an installation package artifact.
# It has to be relative to the project path. Thus we have installed to within the build tree.
#
artifacts:
- path: install
name: mono-binaries
type: zip
+11 -14
View File
@@ -30,18 +30,18 @@ fi
DIE=1
}
if [ -z "$LIBTOOL" ]; then
LIBTOOL=`which glibtool 2>/dev/null`
if [ ! -x "$LIBTOOL" ]; then
LIBTOOL=`which libtool`
if [ -z "$LIBTOOLIZE" ]; then
LIBTOOLIZE=`which glibtoolize 2>/dev/null`
if [ ! -x "$LIBTOOLIZE" ]; then
LIBTOOLIZE=`which libtoolize`
fi
fi
(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed to compile Mono."
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
echo "**Error**: You must have \`libtoolize' installed to compile Mono."
echo "Get ftp://ftp.gnu.org/gnu/libtool/libtool-1.2.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
@@ -98,7 +98,7 @@ esac
if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
if test -z "$NO_LIBTOOLIZE" ; then
echo "Running libtoolize..."
${LIBTOOL}ize --force --copy
$LIBTOOLIZE --force --copy
fi
fi
@@ -154,14 +154,11 @@ if test -d $srcdir/libgc; then
echo Done running libgc/autogen.sh ...
fi
if test -d $srcdir/eglib; then
echo Running eglib/autogen.sh ...
(cd $srcdir/eglib ; NOCONFIGURE=1 ./autogen.sh "$@")
echo Done running eglib/autogen.sh ...
if test x$MONO_EXTRA_CONFIGURE_FLAGS != x; then
echo "MONO_EXTRA_CONFIGURE_FLAGS is $MONO_EXTRA_CONFIGURE_FLAGS"
fi
conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
conf_flags="$MONO_EXTRA_CONFIGURE_FLAGS --enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
+7
View File
@@ -0,0 +1,7 @@
@echo off
cd mcs\jay
vcbuild jay.vcxproj
cd msvc\scripts
csc prepare.cs
prepare.exe ..\..\mcs core
msbuild net_4_x.sln
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
(cd mcs/jay; make)
(cd msvc/scripts/; make prepare.exe; mono prepare.exe ../../mcs core)
msbuild net_4_x.sln
+50
View File
@@ -0,0 +1,50 @@
# Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer at miguel@xamarin.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. Maintainers are
obligated to maintain confidentiality with regard to the reporter of an
incident.
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at
[http://contributor-covenant.org/version/1/3/0/][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/
+1220 -391
View File
File diff suppressed because it is too large. Load diff
-6
View File
@@ -1,6 +0,0 @@
2008-03-23 Dean Brettle <[email protected]>
* Compat.browser: added. Provides browser definitions with
compatible IDs.
-15
View File
@@ -1,15 +0,0 @@
2010-05-17 Zoltan Varga <[email protected]>
* mono-2.pc.in (Libs): Remove glib dependencies.
2010-05-07 Zoltan Varga <[email protected]>
* mono-2.pc (Requires): Remove glib dependencies.
2010-04-02 Jb Evain <[email protected]>
* dotnet35.pc.in: add System.Data.Services.dll.
2010-03-08 Rodrigo Kumpera <[email protected]>
* mono.supp: Add hazard pointers supressions.
+3 -2
View File
@@ -5,7 +5,7 @@ monolldbdir = $(libdir)/mono/lldb
EXTRA_DIST = \
config.in \
browscap.ini mono.supp mono.d README ChangeLog \
browscap.ini mono.supp mono.d README \
mono.pc.in mono-2.pc.in monosgen-2.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in \
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
@@ -14,7 +14,8 @@ EXTRA_DIST = \
net_1_1/machine.config \
gdb/mono-gdb.py \
gdb/gdb-python.diff \
lldb/mono.py
lldb/mono.py \
lldb/monobt.py
pkgconfigdir = $(libdir)/pkgconfig
+7
View File
@@ -11,14 +11,21 @@
<dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
<dllmap dll="MonoPosixHelper" target="$mono_libdir/libMonoPosixHelper@libsuffix@" os="!windows" />
<dllmap dll="libmono-btls-shared" target="$mono_libdir/libmono-btls-shared@libsuffix@" os="!windows" />
<dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
<dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
<dllmap dll="sqlite" target="@SQLITE@" os="!windows"/>
<dllmap dll="sqlite3" target="@SQLITE3@" os="!windows"/>
<dllmap dll="libX11" target="@X11@" os="!windows" />
<dllmap dll="libgdk-x11-2.0" target="@GDKX11@" os="!windows"/>
<dllmap dll="libgdk_pixbuf-2.0" target="libgdk_pixbuf-2.0.so.0" os="!windows"/>
<dllmap dll="libgtk-x11-2.0" target="@GTKX11@" os="!windows"/>
<dllmap dll="libglib-2.0" target="libglib-2.0.so.0" os="!windows"/>
<dllmap dll="libgobject-2.0" target="libgobject-2.0.so.0" os="!windows"/>
<dllmap dll="libgnomeui-2" target="libgnomeui-2.so.0" os="!windows"/>
<dllmap dll="librsvg-2" target="librsvg-2.so.2" os="!windows"/>
<dllmap dll="libXinerama" target="@XINERAMA@" os="!windows" />
<dllmap dll="libasound" target="libasound.so.2" os="!windows" />
<dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows"/>
<dllmap dll="libcairo-2.dll" target="libcairo.2.dylib" os="osx"/>
<dllmap dll="libcups" target="libcups.so.2" os="!windows"/>
-66
View File
@@ -1,66 +0,0 @@
2009-10-09 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoSupport.run_hook): Set MONO_XDEBUG to 'gdb' to activate
the GDB support mode in the runtime.
2009-04-14 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoClassPrinter.to_string): Add a MonoClass* pretty
printer.
2009-04-12 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoMethodPrinter.to_string): Add a MonoMethod* pretty
printer.
2009-04-10 Zoltan Varga <[email protected]>
* mono-gdb.py: Update to the latest archer api.
2009-04-07 Zoltan Varga <[email protected]>
* mono-gdb.py (ObjectPrinter.__init__): Update to latest archer api.
2009-04-06 Zoltan Varga <[email protected]>
* test-xdb.py: New file, tester script for xdb.
* mono-gdb.py (stringify_class_name): Handle classes without a namespace
correctly.
* mono-gdb.py: Update after the changes to dwarfwriter.c.
2009-04-05 Zoltan Varga <[email protected]>
* mono-gdb.py: Handle superclasses in the pretty printer.
2009-03-27 Zoltan Varga <[email protected]>
* mono-gdb.py (StringPrinter.to_string): Fix support for non-ascii characters.
2009-03-20 Zoltan Varga <[email protected]>
* mono-gdb.py: Update for the latest python API on the archer branch.
2009-02-03 Zoltan Varga <[email protected]>
* mono-gdb.py: Remove the --64 argument to as, it is not needed.
* mono-gdb.py (stringify_class_name): Helper function to print base types
using their short name. Also add a prototype implementation of registering
the hooks from python code instead of needing the mono-gdbinit file.
* gdb-python.diff: Changes against the gdb archer branch at
http://sourceware.org/gdb/wiki/PythonGdb to fix some problems/add functionality.
2009-02-03 Geoff Norton <[email protected]>
* mono-gdbinit: Hook into backtrace as hook-stop seems to crash gdb
* mono-gdb.py: Find the gdbinit name from the executable name instead of
hardcoding mono
2009-01-29 Zoltan Varga <[email protected]>
* mono-gdb.py mono-gdbinit: Support files to help debugging mono/mono apps
using a python enabled gdb.
+14 -14
View File
@@ -53,7 +53,7 @@ def stringify_class_name(ns, name):
if ns == "":
return name
else:
return "%s.%s".format (ns, name)
return "{}.{}".format (ns, name)
class ArrayPrinter:
"Print a C# array"
@@ -66,7 +66,7 @@ class ArrayPrinter:
def to_string(self):
obj = self.val.cast (gdb.lookup_type ("MonoArray").pointer ()).dereference ()
length = obj ['max_length']
return "%s [%d]".format (stringify_class_name (self.class_ns, self.class_name [0:len (self.class_name) - 2]), int (length))
return "{} [{}]".format (stringify_class_name (self.class_ns, self.class_name [0:len (self.class_name) - 2]), int (length))
class ObjectPrinter:
"Print a C# object"
@@ -96,7 +96,7 @@ class ObjectPrinter:
return (field.name, self.obj [field.name])
except:
# Superclass
return (field.name, self.obj.cast (gdb.lookup_type ("%s".format (field.name))))
return (field.name, self.obj.cast (gdb.lookup_type ("{}".format (field.name))))
def children(self):
# FIXME: It would be easier if gdb.Value would support iteration itself
@@ -109,7 +109,7 @@ class ObjectPrinter:
class_name = obj ['vtable'].dereference ()['klass'].dereference ()['name'].string ()
if class_name [-2:len(class_name)] == "[]":
return {}.__iter__ ()
gdb_type = gdb.lookup_type ("struct %s_%s".format (class_ns.replace (".", "_"), class_name))
gdb_type = gdb.lookup_type ("struct {}_{}".format (class_ns.replace (".", "_"), class_name))
return self._iterator(obj.cast (gdb_type))
except:
print (sys.exc_info ()[0])
@@ -129,12 +129,12 @@ class ObjectPrinter:
return ArrayPrinter (self.val,class_ns,class_name).to_string ()
if class_ns != "":
try:
gdb_type = gdb.lookup_type ("struct %s.%s".format (class_ns, class_name))
gdb_type = gdb.lookup_type ("struct {}.{}".format (class_ns, class_name))
except:
# Maybe there is no debug info for that type
return "%s.%s".format (class_ns, class_name)
return "{}.{}".format (class_ns, class_name)
#return obj.cast (gdb_type)
return "%s.%s".format (class_ns, class_name)
return "{}.{}".format (class_ns, class_name)
return class_name
except:
print (sys.exc_info ()[0])
@@ -154,9 +154,9 @@ class MonoMethodPrinter:
val = self.val.dereference ()
klass = val ["klass"].dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
return "\"%s:%s ()\"".format (class_name, val ["name"].string ())
return "\"{}:{} ()\"".format (class_name, val ["name"].string ())
# This returns more info but requires calling into the inferior
#return "\"%s\"".format (gdb.parse_and_eval ("mono_method_full_name (%s, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
#return "\"{}\"".format (gdb.parse_and_eval ("mono_method_full_name ({}, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
class MonoClassPrinter:
"Print a MonoClass structure"
@@ -169,9 +169,9 @@ class MonoClassPrinter:
return "0x0"
klass = self.val.dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
return "\"%s\"".format (class_name)
return "\"{}\"".format (class_name)
# This returns more info but requires calling into the inferior
#return "\"%s\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*)%s)->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
#return "\"{}\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*){})->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
def lookup_pretty_printer(val):
t = str (val.type)
@@ -217,9 +217,9 @@ class MonoSupport(object):
new_size = os.stat ("xdb.s").st_size
if new_size > self.s_size:
sofile = "xdb.so"
gdb.execute ("shell as -o xdb.o xdb.s && ld -shared -o %s xdb.o".format (sofile))
gdb.execute ("shell as -o xdb.o xdb.s && ld -shared -o {} xdb.o".format (sofile))
# FIXME: This prints messages which couldn't be turned off
gdb.execute ("add-symbol-file %s 0".format (sofile))
gdb.execute ("add-symbol-file {} 0".format (sofile))
self.s_size = new_size
class RunHook (gdb.Command):
@@ -245,4 +245,4 @@ exec_file = gdb.current_objfile ().filename
if os.stat (exec_file).st_size != os.lstat (exec_file).st_size:
exec_file = os.readlink (exec_file)
exec_dir = os.path.dirname (exec_file)
gdb.execute ("source %s/%s-gdbinit".format (exec_dir, os.path.basename (exec_file)))
gdb.execute ("source {}/{}-gdbinit".format (exec_dir, os.path.basename (exec_file)))
-80
View File
@@ -1,80 +0,0 @@
2010-06-28 Zoltan Varga <[email protected]>
* mono-gdb.py: Add pretty printers for more runtime data structures.
2009-10-13 Zoltan Varga <[email protected]>
* mono-gdb.py: Add an 'xdb' command to flush the debugging info.
2009-10-12 Zoltan Varga <[email protected]>
* mono-gdb.py: Update this to gdb 7.0.
* mono-gdbinit: Removed, no longer needed.
2009-10-09 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoSupport.run_hook): Set MONO_XDEBUG to 'gdb' to activate
the GDB support mode in the runtime.
2009-04-14 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoClassPrinter.to_string): Add a MonoClass* pretty
printer.
2009-04-12 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoMethodPrinter.to_string): Add a MonoMethod* pretty
printer.
2009-04-10 Zoltan Varga <[email protected]>
* mono-gdb.py: Update to the latest archer api.
2009-04-07 Zoltan Varga <[email protected]>
* mono-gdb.py (ObjectPrinter.__init__): Update to latest archer api.
2009-04-06 Zoltan Varga <[email protected]>
* test-xdb.py: New file, tester script for xdb.
* mono-gdb.py (stringify_class_name): Handle classes without a namespace
correctly.
* mono-gdb.py: Update after the changes to dwarfwriter.c.
2009-04-05 Zoltan Varga <[email protected]>
* mono-gdb.py: Handle superclasses in the pretty printer.
2009-03-27 Zoltan Varga <[email protected]>
* mono-gdb.py (StringPrinter.to_string): Fix support for non-ascii characters.
2009-03-20 Zoltan Varga <[email protected]>
* mono-gdb.py: Update for the latest python API on the archer branch.
2009-02-03 Zoltan Varga <[email protected]>
* mono-gdb.py: Remove the --64 argument to as, it is not needed.
* mono-gdb.py (stringify_class_name): Helper function to print base types
using their short name. Also add a prototype implementation of registering
the hooks from python code instead of needing the mono-gdbinit file.
* gdb-python.diff: Changes against the gdb archer branch at
http://sourceware.org/gdb/wiki/PythonGdb to fix some problems/add functionality.
2009-02-03 Geoff Norton <[email protected]>
* mono-gdbinit: Hook into backtrace as hook-stop seems to crash gdb
* mono-gdb.py: Find the gdbinit name from the executable name instead of
hardcoding mono
2009-01-29 Zoltan Varga <[email protected]>
* mono-gdb.py mono-gdbinit: Support files to help debugging mono/mono apps
using a python enabled gdb.
+19 -21
View File
@@ -48,7 +48,7 @@ def stringify_class_name(ns, name):
if ns == "":
return name
else:
return "%s.%s".format (ns, name)
return "{}.{}".format (ns, name)
class ArrayPrinter:
"Print a C# array"
@@ -61,7 +61,7 @@ class ArrayPrinter:
def to_string(self):
obj = self.val.cast (gdb.lookup_type ("MonoArray").pointer ()).dereference ()
length = obj ['max_length']
return "%s [%d]".format (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length))
return "{} [{}]".format (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length))
class ObjectPrinter:
"Print a C# object"
@@ -91,7 +91,7 @@ class ObjectPrinter:
return (field.name, self.obj [field.name])
except:
# Superclass
return (field.name, self.obj.cast (gdb.lookup_type ("%s".format (field.name))))
return (field.name, self.obj.cast (gdb.lookup_type ("{}".format (field.name))))
def children(self):
# FIXME: It would be easier if gdb.Value would support iteration itself
@@ -105,7 +105,7 @@ class ObjectPrinter:
if class_name [-2:len(class_name)] == "[]":
return {}.__iter__ ()
try:
gdb_type = gdb.lookup_type ("struct %s_%s".format (class_ns.replace (".", "_"), class_name))
gdb_type = gdb.lookup_type ("struct {}_{}".format (class_ns.replace (".", "_"), class_name))
return self._iterator(obj.cast (gdb_type))
except:
return {}.__iter__ ()
@@ -127,12 +127,12 @@ class ObjectPrinter:
return ArrayPrinter (self.val,class_ns,class_name).to_string ()
if class_ns != "":
try:
gdb_type = gdb.lookup_type ("struct %s.%s".format (class_ns, class_name))
gdb_type = gdb.lookup_type ("struct {}.{}".format (class_ns, class_name))
except:
# Maybe there is no debug info for that type
return "%s.%s".format (class_ns, class_name)
return "{}.{}".format (class_ns, class_name)
#return obj.cast (gdb_type)
return "%s.%s".format (class_ns, class_name)
return "{}.{}".format (class_ns, class_name)
return class_name
except:
print (sys.exc_info ()[0])
@@ -152,9 +152,9 @@ class MonoMethodPrinter:
val = self.val.dereference ()
klass = val ["klass"].dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
return "\"%s:%s ()\"".format (class_name, val ["name"].string ())
return "\"{}:{} ()\"".format (class_name, val ["name"].string ())
# This returns more info but requires calling into the inferior
#return "\"%s\"".format (gdb.parse_and_eval ("mono_method_full_name (%s, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
#return "\"{}\"".format (gdb.parse_and_eval ("mono_method_full_name ({}, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
class MonoClassPrinter:
"Print a MonoClass structure"
@@ -167,14 +167,12 @@ class MonoClassPrinter:
return "0x0"
klass = self.val.dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
if klass ["generic_class"].cast (gdb.lookup_type ("guint64")) != 0:
class_name = "%s<%s>".format (class_name, str (klass ["generic_class"]["context"]["class_inst"]))
if add_quotes:
return "\"%s\"".format (class_name)
return "\"{}\"".format (class_name)
else:
return class_name
# This returns more info but requires calling into the inferior
#return "\"%s\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*)%s)->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
#return "\"{}\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*){})->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
def to_string(self):
try:
@@ -198,7 +196,7 @@ class MonoGenericInstPrinter:
inst_args = inst ["type_argv"]
inst_str = ""
for i in range(0, inst_len):
print (inst_args)
# print (inst_args)
type_printer = MonoTypePrinter (inst_args [i])
if i > 0:
inst_str = inst_str + ", "
@@ -222,7 +220,7 @@ class MonoGenericClassPrinter:
method_inst_str = ""
if int(method_inst.cast (gdb.lookup_type ("guint64"))) != 0:
method_inst_str = str(method_inst)
return "%s, [%s], [%s]>".format (container_str, class_inst_str, method_inst_str)
return "{}, [{}], [{}]>".format (container_str, class_inst_str, method_inst_str)
def to_string(self):
try:
@@ -240,7 +238,7 @@ class MonoTypePrinter:
def to_string_inner(self, csharp):
try:
t = self.val.dereference ()
t = self.val.referenced_value ()
kind = str (t ["type"]).replace ("MONO_TYPE_", "").lower ()
info = ""
@@ -252,9 +250,9 @@ class MonoTypePrinter:
info = str(t ["data"]["generic_class"])
if info != "":
return "{%s, %s}".format (kind, info)
return "{{{}, {}}}".format (kind, info)
else:
return "{%s}".format (kind)
return "{{{}}}".format (kind)
except:
#print (sys.exc_info ()[0])
#print (sys.exc_info ()[1])
@@ -278,12 +276,12 @@ class MonoMethodRgctxPrinter:
inst_args = inst ["type_argv"]
inst_str = ""
for i in range(0, inst_len):
print (inst_args)
# print (inst_args)
type_printer = MonoTypePrinter (inst_args [i])
if i > 0:
inst_str = inst_str + ", "
inst_str = inst_str + type_printer.to_string ()
return "MRGCTX[%s, [%s]]".format (klass_printer.to_string(), inst_str)
return "MRGCTX[{}, [{}]]".format (klass_printer.to_string(), inst_str)
class MonoVTablePrinter:
"Print a MonoVTable structure"
@@ -298,7 +296,7 @@ class MonoVTablePrinter:
klass = vtable ["klass"]
klass_printer = MonoClassPrinter (klass)
return "vtable(%s)".format (klass_printer.to_string ())
return "vtable({})".format (klass_printer.to_string ())
def lookup_pretty_printer(val):
t = str (val.type)
+79
View File
@@ -0,0 +1,79 @@
import lldb
def print_frames(thread, num_frames, current_thread):
# TODO: Make output header similar to bt.
print '%c thread #%i' % ('*' if current_thread else ' ', thread.idx)
if current_thread:
selected_frame = thread.GetSelectedFrame()
for frame in thread.frames[:+num_frames]:
pc = str(frame.addr)
var = frame
function_name = frame.GetFunctionName()
if function_name == "ves_exec_method_with_context":
try:
s = 'frame->runtime_method->method'
klassname = frame.EvaluateExpression('(char*) ' + s + '->klass->name').summary[1:-1]
methodname = frame.EvaluateExpression('(char*) ' + s + '->name').summary[1:-1]
ipoffset = frame.EvaluateExpression('ip').GetValueAsUnsigned()
insn = ''
if ipoffset != 0:
ipoffset -= frame.EvaluateExpression('rtm->code').GetValueAsUnsigned()
insn = "\"" + frame.EvaluateExpression('mono_interp_opname [*ip]').summary[1:-1] + "\""
var = '%s::%s @ %d %s || %s' % (klassname, methodname, ipoffset, insn, frame)
except Exception as e:
print "DBG: execfail:" + str(e)
elif function_name == "mono_interp_transform_method":
try:
s = 'runtime_method->method'
klassname = frame.EvaluateExpression('(char*) ' + s + '->klass->name').summary[1:-1]
methodname = frame.EvaluateExpression('(char*) ' + s + '->name').summary[1:-1]
var = 'transforming %s::%s || %s' % (klassname, methodname, frame)
except Exception as e:
print "DBG: transformfail:" + str(e)
elif pc[0] == '0':
try:
framestr = frame.EvaluateExpression('(char*)mono_pmip((void*)%s)' % pc).summary[1:-1]
var = 'frame #%i: %s%s' % (frame.idx, pc, framestr)
except:
pass
print ' %c %s' % ('*' if current_thread and frame.idx == selected_frame.idx else ' ', var)
def monobt(debugger, command, result, dict):
opts = {'all_bt': False, 'num_frames': None}
if command == 'all':
opts['all_bt'] = True
elif command.isdigit():
opts['num_frames'] = int(command)
elif command != '':
print 'error: monobt [<number>|all]'
return
target = debugger.GetSelectedTarget()
process = target.process
if not process.IsValid():
print 'error: invalid process'
return
if opts['all_bt']:
for thread in process.threads:
print_frames(thread, len(thread), process.selected_thread == thread)
print ''
else:
thread = process.selected_thread
num_frames = len(thread) if opts['num_frames'] is None else opts['num_frames']
print_frames(thread, num_frames, True)
return None
def __lldb_init_module (debugger, dict):
# This initializer is being run from LLDB in the embedded command interpreter
# Add any commands contained in this module to LLDB
debugger.HandleCommand('command script add -f monobt.monobt monobt')
debugger.HandleCommand('command alias mbt monobt')
print '"monobt" command installed'
-6
View File
@@ -1,6 +0,0 @@
2009-02-19 Rodrigo Kumpera <[email protected]>
* LockTracerDecoder.cs: Initial version of the lock tracers decoder.
+2 -2
View File
@@ -86,7 +86,7 @@ LOCK RULES
Simple locks:
Can be acquired at any point regardless of which locks are taken or not.
No other locks can be acquired or released while holding a simple lock.
Reentrancy is not recomended. (warning)
Reentrancy is not recommended. (warning)
Simple locks are leaf locks on the lock lattice.
Complex locks:
@@ -129,7 +129,7 @@ ERROR: tried to acquire lock DomainLock at mono_domain_code_reserve_align while
WARNING: tried to acquire lock ImageDataLock at mono_image_init_name_cache while holding ImageDataLock at mono_class_from_name
WARNING: tried to acquire lock ImageDataLock at mono_image_init_name_cache while holding ImageDataLock at mono_image_add_to_name_cache
Both of those happen when filling up the name_cache, as it needs to alloc image memory.
This one is fixable by spliting mono_image_init_name_cache into a locked and an unlocked variants and calling them appropriatedly.
This one is fixable by splitting mono_image_init_name_cache into a locked and an unlocked variants and calling them appropriately.
*/
-3
View File
@@ -74,9 +74,6 @@
<add prefix="https" type="System.Net.HttpRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.web>
<httpHandlers>
-147
View File
@@ -1,147 +0,0 @@
2009-08-11 Gonzalo Paniagua Javier <[email protected]>
* DefaultWsdlHelpGenerator.aspx: the 'Message Layout' can now handle
self-referencing types. Fixes bug #529353.
2009-08-05 Atsushi Enomoto <[email protected]>
* web.config: add WCF assemblies as references at compilation.
* machine.config: add some missing WCF sections (new in 3.5).
2009-05-28 Atsushi Enomoto <[email protected]>
* machine.config: fix WCF diagnostics section name.
2009-03-31 Marek Habersack <[email protected]>
* DefaultWsdlHelpGenerator.aspx: the link element in <head> must
be created using Response.Write, as the code expression in the
href attribute is otherwise treated verbatim. This is the same as
with .NET. Fixes bug #490497
2009-03-27 Gonzalo Paniagua Javier <[email protected]>
* DefaultWsdlHelpGenerator.aspx: disable the test form
when only Soap is supported.
Bug #342073 fixed.
2009-01-23 Atsushi Enomoto <[email protected]>
* web.config : added .svc handler.
2009-01-07 Kornél Pál <[email protected]>
* DefaultWsdlHelpGenerator.aspx: Move <script> at the end of <head> that
will make Visual Studio recognize the web service disco reference.
Contributed under MIT/X11 license.
2008-12-03 Marek Habersack <[email protected]>
* machine.config: rename serviceModelHostingEnvironment to
serviceHostingEnvironment.
2008-11-20 Gonzalo Paniagua Javier <[email protected]>
* machine.config: in 2.0, there's no <connectionManagement> section
here. Bug #445991 fixed.
2008-11-14 Gonzalo Paniagua Javier <[email protected]>
* DefaultWsdlHelpGenerator.aspx: use javascript instead of
HttpWebRequest to avoid a deadlock if the web service uses Session.
Bug #444343 fixed.
2008-10-09 Gonzalo Paniagua Javier <[email protected]>
* web.config: default values for httpRuntime are different in 2.0
2008-10-09 Marek Habersack <[email protected]>
* web.config: added the default monoSettings section which works around
an incompatibility between mcs and csc, mentioned in bug #433806
* machine.config: added definition of the monoSettings section to
the system.web group
2008-10-06 Marek Habersack <[email protected]>
* machine.config: added entries to ignore the mobileControls and
deviceFilters sections.
2008-09-02 Marek Habersack <[email protected]>
* web.config: removed System.Web.Extensions.dll from the assemblies
(reverting r112073) - it would break all the ASP.NET applications
which use System.Web.Extensions other than 3.5.0.0
2008-09-06 Daniel Morgan <[email protected]>
* machine.config: added Mono.Data.SybaseClient
to DbProviderFactories section.
2008-09-02 Atsushi Enomoto <[email protected]>
* web.config: added System.Web.Extensions.dll to assemblies.
2008-08-28 Zoltan Varga <[email protected]>
* machine.config: Fix syntax error.
2008-03-23 Dean Brettle <[email protected]>
* Makefile.am: added Browsers/Compat.browser
2008-02-29 Marek Habersack <[email protected]>
* machine.config: added an entry to ignore the browserCaps section.
2007-12-15 Marek Habersack <[email protected]>
* web.config: compilation/compilers are no longer necessary.
2007-12-08 Marek Habersack <[email protected]>
* machine.config: updated the LocalSqlServer connection string to
match MS.NET and added a new connection string, LocalSqliteServer,
to be used by default on Unix.
Updated the AspNetSqlMembershipProvider definition to match
MS.NET.
* settings.map: added
* Makefile.am: added settings.map
2007-10-17 Atsushi Enomoto <[email protected]>
* web.config, machine.config: moved webSerices section from former
to latter.
2007-09-05 Atsushi Enomoto <[email protected]>
* machine.config : added WCF sectionGroups.
2007-09-04 Marek Habersack <[email protected]>
* machine.config: added an entry to ignore the <system.webServer>
section. Fixes bug #82535
2007-07-03 Marek Habersack <[email protected]>
* DefaultWsdlHelpGenerator.aspx: make head server-side, for the
service generator to run on sites which use stylesheet themes
configured in web.config. Fixes bug #81994
2007-05-01 Marek Habersack <[email protected]>
* machine.config: added standard data provider factories, or
otherwise the SqlDataSource tests will fail.
2007-04-27 Atsushi Enomoto <[email protected]>
* DefaultWsdlHelpGenerator.aspx :
ProfileViolations could be null, when there is no Binding. So,
don't omit null check.
Stop your bad habit of missing ChangeLog. Former changes (as long
as logged) can be seen in ../../ChangeLog.
-3
View File
@@ -118,9 +118,6 @@
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.runtime.remoting>
-9
View File
@@ -1,9 +0,0 @@
2009-08-06 Atsushi Enomoto <[email protected]>
* web.config: add WCF assemblies as references at compilation.
* machine.config: add some missing WCF sections (new in 3.5).
2009-07-24 Jb Evain <[email protected]>
* Initial import of the net_4_0 specific files.
-3
View File
@@ -135,9 +135,6 @@
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.runtime.remoting>
-3
View File
@@ -138,9 +138,6 @@
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.runtime.remoting>
+3
View File
@@ -0,0 +1,3 @@
check-coverage crlf=input
check-exports crlf=input
produce-lists crlf=input
+1
View File
@@ -9,3 +9,4 @@
/mono-tools.tree
/mono-tools.zip
/AgilityPack.dll*
/doxygen-output
-133
View File
@@ -1,133 +0,0 @@
2010-04-06 Andreia Gaita <[email protected]>
* Makefile.am: fix distcheck - several targets get built on the
srcdir, which has no write permissions on make distcheck, so make
sure permissions are set
2009-12-22 Jo Shields <[email protected]>
* HtmlAgilityPack/LICENSE: Include upstream license (Ms-PL) since the
file headers don't specify it
2009-12-22 Jo Shields <[email protected]>
* HtmlAgilityPack/*: Bundle HtmlAgilityPack 1.4~beta2 from
http://www.codeplex.com/htmlagilitypack in source form.
* AgilityPack.dll: Remove binary assembly, use source instead.
* docs.make Makefile.am README: Reflect above changes
2009-02-12 Zoltan Varga <[email protected]>
* Makefile.am (EXTRA_DIST): Remove removed files.
* README: Point to the documentation on the wiki.
* call-sites.txt: Remove this, its contents is in jit-trampolines.
* memory-management.txt thread-safety.txt aot-compiler.txt jit-regalloc
exception-handling.txt: Remove documents which are now on the wiki.
2009-02-11 Rodrigo Kumpera <[email protected]>
* thread-safety.txt: Improve the docs about image lock.
2009-02-11 Rodrigo Kumpera <[email protected]>
* thread-safety.txt: Document the new image lock.
2008-12-12 Mark Probst <[email protected]>
* mini-porting.txt: Added some details about function descriptors
and emulated opcodes.
2008-12-08 Jonathan Pryor <[email protected]>
* mono-file-formats.source, mono-tools.source: Place these under the
new "Commands and Files" node, and remove nay intermediate nodes.
2008-11-20 Jonathan Pryor <[email protected]>
* Makefile.am (sources_DATA): Add mono-file-formats.source,
mono-tools.source.
2008-11-20 Raja R Harinath <[email protected]>
Remove unnecessary rebuilds of the html directory
* docs.make (monoapi.zip): Make slightly more unforgiving, by
using '&&' instead of ';' to sequence commands.
(mono-tools.zip, mono-file-formats.zip): Likewise.
* Makefile.am (monoapi.zip, mono-tools.zip, mono-fileformats.zip):
Likewise.
(convert.exe): Don't depend on Makefile.am or docs.make.
2008-11-19 Raja R Harinath <[email protected]>
Fix srcdir != builddir, and add idiom for multi-output commands
* docs.make (monoapi.zip): Handle the case where 'monoapi.tree'
exists but 'monoapi.zip' doesn't. IOW, we should rebuild
monoapi.zip with 'rm monoapi.zip; make'.
(mono-tools.zip, mono-file-formats.zip): Likewise.
* Makefile.am (monoapi.zip, mono-tools.zip, mono-fileformats.zip):
Likewise.
(monoapi.tree): Don't use $< in an explicit rule.
(mono-tools.tree, mono-file-formats.tree): Likewise.
2008-11-18 Jonathan Pryor <[email protected]>
* Makefile.am (EXTRA_DIST): Add mono-file-formats{.config,.source} and
mono-tools{.config,.source} (fixes the build).
2008-11-18 Jonathan Pryor <[email protected]>
* docs.make, Makefile.am: Build mono-file-formats{.tree,.zip},
mono-tool{.tree,.zip} files.
* mono-file-formats.config, mono-tools.config: Alter paths to man
pages so that they're valid for building from mono/docs.
* monoapi.make: Rename to docs.make.
2008-11-01 Raja R Harinath <[email protected]>
* Makefile.am: Clean up for srcdir != builddir.
(deploy/.stamp): Compute location of 'mono-wrapper' and pass to exdoc.
* exdoc (mono-wrapper): Use $runtimedir to look for 'mono-wrapper'.
2008-10-31 Jonathan Pryor <[email protected]>
* check, Makefile.am (EXTRA_DIST): Rename to check-exports. This was
needed to fix `make distdir...`, because (1) with a file named
`check` which (2) was listed in $(EXTRA_DIST), while (3) `check` is
ALSO a .PHONY target, this caused make to look for the `check` file,
not find it due to (3), and then proceed to try to build convert.exe
from convert.cs...for reasons I don't care about. This obviously
can't work during `make distdir`, as mcs hasn't been built yet, thus
leading to pain, suffering, and a broken build.
2008-10-30 Jonathan Pryor <[email protected]>
* . (svn:ignore), deploy (svn:ignore): Ignore generated files.
* AgilityPack.dll, api-style.css, ChangeLog, check, check-coverage,
convert.cs, current-api, deploy, documented, exdoc, ignore,
mono-api-metadata.html, monoapi.source, produce-lists, public,
public-api, README, sources, toc.xml, TODO, wapi: Copy from
../mono/docscripts.
* exdoc: Use the in-tree mono program to run convert.exe.
* Makefile.am: Mention files to clean/distribute; extract
documentation (with exdoc) and then assemble documentation (with
monoapi.make's assemble target) for use by monodoc.
* monoapi.make: Added; Makefile to use mcs' buid/rules.make to compile
convert.cs and assemble documentation. (This is a separate file so
that we can include mcs' build/rules.make, which needs topdir set to
behave properly BUT must be $(mcs_topdir) from Makefile.am's
perspective.)
* monoapi.source: Add a /monodoc/node element for use with monodoc 2.2.
2006-11-19 Miguel de Icaza <[email protected]>
* exdoc: Move to use CSS instead of tables, this will break
GtkHTML rendering.
* ignore: Updated with more hidden APIs.
* Bunch of documentation work.
+6 -5
View File
@@ -17,10 +17,8 @@ EXTRA_DIST = \
check-exports \
check-coverage \
convert.cs \
current-api \
deploy \
docs.make \
documented \
embedded-api \
exdoc \
file-share-modes \
@@ -43,8 +41,6 @@ EXTRA_DIST = \
object-layout \
precise-gc \
produce-lists \
public \
public-api \
README \
remoting \
ssapre.txt \
@@ -68,6 +64,7 @@ dist-hook:
clean-local:
-rm -Rf html
-rm -Rf doxygen-output
-rm -f deploy/* convert.exe* AgilityPack.dll*
-rm -f $(ASSEMBLED_DOCS)
@@ -90,7 +87,7 @@ mono-file-formats.zip: mono-file-formats.tree
mono-file-formats.tree: $(srcdir)/docs.make $(srcdir)/Makefile.am $(srcdir)/deploy/.stamp
$(TOOL_MAKE) $@
deploy/.stamp: convert.exe Makefile.am
deploy/.stamp: convert.exe Makefile.am exdoc
$(mkdir_p) html
runtimedir=`cd ../runtime && pwd`; export runtimedir; \
MONO_PATH=$(CLASS) perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c
@@ -104,3 +101,7 @@ convert.exe: convert.cs AgilityPack.dll
AgilityPack.dll:
$(TOOL_MAKE) AgilityPack.dll
doxygen:
doxygen doxyfile
.PHONY: doxygen
+4 -4
View File
@@ -26,7 +26,7 @@ some combination of the two.
To be clearer, and give an idea of what the algorithm can and
cannot do without describing it in detail... keep in mind that
only "redunant" checks cannot be removed. By "redundant", I
only "redundant" checks cannot be removed. By "redundant", I
mean "already explicitly checked" in the method code.
Unfortunately, analyzing complex expressions is not so easy
@@ -136,7 +136,7 @@ some combination of the two.
In the first case, the BB has exactly two exit BBs, and their
execution conditions are easy to get from the condition of the
branch (see the "get_relation_from_branch_instruction"
function, and expecially the end of "analyze_block" in
function, and especially the end of "analyze_block" in
abcremoval.c.
If there is a switch, the jump condition of every exit BB is
@@ -303,7 +303,7 @@ some combination of the two.
each BB tried to examine all possible conditions between all
variables, filling a sort of "evaluation matrix". The problem
was that the complexity of this evaluation was quadratic (or
worse) on the number of variables, and that many wariables
worse) on the number of variables, and that many variables
were examined even if they were not involved in any array
access.
@@ -332,7 +332,7 @@ some combination of the two.
[1b] Prepare the evaluation graph (empty)
[1b] Summarize each varible definition, and put
[1b] Summarize each variable definition, and put
the resulting relations in the evaluation
graph
+176 -36
View File
@@ -1,40 +1,180 @@
h3 {
font-size: 18px;
padding-bottom: 4pt;
border-bottom: 2px solid #dddddd;
}
.api {
border: 1px solid;
padding: 10pt;
margin: 10pt;
}
.mapi-docs {
line-height: 1.5;
padding-left: 2em;
padding-right: 2em;
}
.mapi-docs p {
max-width: 60em;
}
.mapi-docs .mapi-body {
max-width: 60em;
}
.mapi-docs code {
border: 1px solid rgba(214,214,214,1);
background-color: rgba(249,249,249,1);
padding: 0.1em 0.5em;
}
.mapi-description code {
font-family: "Consolas", "Courier", monospace;
border: 1px solid rgba(214,214,214,1);
background-color: rgba(249,249,249,1);
padding: 0.1em 0.2em;
}
.api-entry {
border-bottom: none;
font-size: 18px;
}
.mapi-header {
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
border: 1px solid rgba(233,233,233,1);
background-color: rgba(249,249,249,1);
}
.prototype {
border: 1px solid;
background-color: #f2f2f2;
padding: 5pt;
margin-top: 5pt;
margin-bottom: 5pt;
}
.mapi-code {
padding: 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
border: 1px solid rgba(233,233,233,1);
background-color: rgba(249,249,249,1);
}
.header {
border: 1px solid;
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
}
.mapi-code:first-line {
line-height: 0px;
}
.mapi-entry code {
border: none;
background-color: transparent;
}
.code {
border: 1px solid;
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
}
.mapi-parameters {
border-collapse: collapse;
border-spacing: 0;
empty-cells: hide;
border: 0;
margin: 5px 0 26px;
}
.mapi-parameters td {
border: 1px solid rgba(214,214,214,1);
border-left-style: none;
padding: 5px 25px 5px 10px;
}
.mapi-parameters tr>td:last-child {
border-right: 0;
}
.mapi-parameters td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px;
}
.mapi-parameters tr:last-child>td {
border-bottom: 0;
}
.mapi-parameters tr:first-child>td {
border-top: 0;
}
.mapi-parameters tr td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px;
}
.mapi {
left: -25px;
margin: 0;
padding: 13px 25px 0;
position: relative;
width: 100%;
}
.mapi-description {
background: rgba(249,249,249,1);
border-bottom: 1px solid rgba(233,233,233,1);
left: -25px;
margin: 0;
padding: 13px 25px 0;
position: relative;
width: 100%;
}
.mapi-entry {
background: transparent;
}
.mapi-docs {
}
.mapi-prototype {
border-left: 5px solid rgba(205,233,244,1);
padding: .5em;
margin-top: 5pt;
margin-bottom: 5pt;
font-family: "Consolas", "Courier", monospace;
display: block;
overflow: auto;
background-color: #f9f9f9;
}
.mapi-declaration {
margin-top: 21px;
}
.mapi-section {
font-size: smaller;
font-weight: bold;
margin-top: 21px;
line-height: 1.5;
}
.mapi-strike {
text-decoration: line-through;
}
.mapi-deprecated {
color: red;
}
.mapi-ptr-container {
background: white;
border-bottom: 1px solid rgba(233,233,233,1);
left: -25px;
padding-left: 25px;
padding-right: 25px;
padding-bottom: 13px;
position: relative;
width: 100%;
}
.mapi-ptr {
background: rgba(249,249,249,1);
border-left: 1px solid rgba(233,233,233,1);
border-top: 1px solid rgba(233,233,233,1);
height: 12px;
left: 37px;
top: -7px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
position: absolute;
width: 12px;
}
.mapi-height-container {
left: -25px;
padding: 0 25px;
position: relative;
width: 100%;
}
-949
View File
@@ -1,949 +0,0 @@
dlfree
dlmalloc
dlmemalign
free_list_index_of
g_printerr
g_ptr_array_remove_fast
invoke_protected_memory_method
mini_debugger_init
mini_debugger_main
mini_debugger_set_attach_ok
mini_debug_running_inside_mdb
mini_emit_initobj
mini_emit_stobj
mono_add_internal_call
mono_aot_register_globals
mono_aot_register_module
mono_array_addr_with_size
mono_array_class_get
mono_array_clone
mono_array_element_size
mono_array_length
mono_array_new
mono_array_new_full
mono_array_new_specific
mono_assemblies_cleanup
mono_assembly_close
mono_assembly_get_image
mono_assembly_get_main
mono_assembly_get_object
mono_assembly_getrootdir
mono_assembly_load
mono_assembly_loaded
mono_assembly_loaded_full
mono_assembly_load_full
mono_assembly_name_free
mono_assembly_name_get_culture
mono_assembly_name_get_name
mono_assembly_name_get_pubkeytoken
mono_assembly_name_get_version
mono_assembly_name_new
mono_assembly_names_equal
mono_assembly_open
mono_bitset_alloc_size
mono_bitset_clear
mono_bitset_clear_all
mono_bitset_clone
mono_bitset_copyto
mono_bitset_count
mono_bitset_equal
mono_bitset_find_first
mono_bitset_find_first_unset
mono_bitset_find_last
mono_bitset_find_start
mono_bitset_foreach
mono_bitset_free
mono_bitset_intersection
mono_bitset_intersection_2
mono_bitset_invert
mono_bitset_mem_new
mono_bitset_new
mono_bitset_set
mono_bitset_set_all
mono_bitset_size
mono_bitset_sub
mono_bitset_test
mono_bitset_test_bulk
mono_bitset_union
mono_bounded_array_class_get
mono_breakpoint_clean_code
mono_check_corlib_version
mono_class_array_element_size
mono_class_data_size
mono_class_describe_statics
mono_class_enum_basetype
mono_class_from_generic_parameter
mono_class_from_mono_type
mono_class_from_name
mono_class_from_name_case
mono_class_from_typeref
mono_class_get
mono_class_get_byref_type
mono_class_get_element_class
mono_class_get_events
mono_class_get_event_token
mono_class_get_field
mono_class_get_field_from_name
mono_class_get_fields
mono_class_get_field_token
mono_class_get_flags
mono_class_get_full
mono_class_get_image
mono_class_get_interfaces
mono_class_get_method_from_name
mono_class_get_method_from_name_flags
mono_class_get_methods
mono_class_get_name
mono_class_get_namespace
mono_class_get_nested_types
mono_class_get_nesting_type
mono_class_get_parent
mono_class_get_properties
mono_class_get_property_from_name
mono_class_get_property_token
mono_class_get_rank
mono_class_get_type
mono_class_get_type_token
mono_class_inflate_generic_method
mono_class_inflate_generic_type
mono_class_init
mono_class_instance_size
mono_class_interface_offset
mono_class_is_assignable_from
mono_class_is_enum
mono_class_is_subclass_of
mono_class_is_valid_enum
mono_class_is_valuetype
mono_class_min_align
mono_class_name_from_token
mono_class_num_events
mono_class_num_fields
mono_class_num_methods
mono_class_num_properties
mono_class_value_size
mono_class_vtable
mono_cli_rva_image_map
mono_code_manager_commit
mono_code_manager_destroy
mono_code_manager_foreach
mono_code_manager_invalidate
mono_code_manager_new
mono_code_manager_new_dynamic
mono_code_manager_reserve
mono_code_manager_reserve_align
mono_code_manager_set_read_only
mono_code_manager_size
mono_compile_method
mono_config_for_assembly
mono_config_parse
mono_config_parse_memory
mono_config_string_for_assembly_file
mono_context_get
mono_context_get_desc
mono_context_set
mono_counters_cleanup
mono_counters_dump
mono_counters_enable
mono_counters_register
mono_custom_attrs_construct
mono_custom_attrs_free
mono_custom_attrs_from_assembly
mono_custom_attrs_from_class
mono_custom_attrs_from_event
mono_custom_attrs_from_field
mono_custom_attrs_from_index
mono_custom_attrs_from_method
mono_custom_attrs_from_param
mono_custom_attrs_from_property
mono_custom_attrs_get_attr
mono_custom_attrs_has_attr
mono_debug_add_method
_mono_debug_address_from_il_offset
mono_debug_close_image
mono_debug_close_mono_symbol_file
mono_debug_domain_create
mono_debug_domain_unload
mono_debug_find_method
mono_debug_free_source_location
mono_debugger_abort_runtime_invoke
mono_debugger_breakpoint_callback
mono_debugger_call_exception_handler
mono_debugger_check_breakpoints
mono_debugger_check_interruption
mono_debugger_check_runtime_version
mono_debugger_class_initialized
mono_debugger_event
mono_debugger_event_create_appdomain
mono_debugger_event_unload_appdomain
mono_debugger_extended_notification
mono_debugger_handle_exception
mono_debugger_insert_breakpoint
mono_debugger_insert_breakpoint_full
mono_debugger_insert_method_breakpoint
mono_debugger_lock
mono_debugger_method_has_breakpoint
MONO_DEBUGGER__notification_function
mono_debugger_register_class_init_callback
mono_debugger_remove_breakpoint
mono_debugger_remove_class_init_callback
mono_debugger_remove_method_breakpoint
mono_debugger_run_finally
mono_debugger_runtime_invoke
mono_debugger_thread_cleanup
mono_debugger_thread_created
_mono_debugger_throw_exception
mono_debugger_trampoline_compiled
_mono_debugger_unhandled_exception
mono_debugger_unlock
mono_debug_il_offset_from_address
mono_debug_list_add
mono_debug_list_remove
mono_debug_lookup_locals
mono_debug_lookup_method
mono_debug_lookup_method_addresses
mono_debug_lookup_source_location
mono_debug_open_image_from_memory
mono_debug_open_mono_symbols
mono_debug_print_stack_frame
mono_debug_print_vars
mono_debug_symfile_get_line_numbers
mono_debug_symfile_lookup_locals
mono_debug_symfile_lookup_location
mono_debug_symfile_lookup_method
mono_debug_using_mono_debugger
mono_declsec_flags_from_assembly
mono_declsec_flags_from_class
mono_declsec_flags_from_method
mono_declsec_get_assembly_action
mono_declsec_get_class_action
mono_declsec_get_demands
mono_declsec_get_inheritdemands_class
mono_declsec_get_inheritdemands_method
mono_declsec_get_linkdemands
mono_declsec_get_method_action
mono_digest_get_public_token
mono_disasm_code
mono_disasm_code_one
mono_dllmap_insert
mono_domain_assembly_open
mono_domain_create
mono_domain_create_appdomain
mono_domain_finalize
mono_domain_foreach
mono_domain_free
mono_domain_from_appdomain
mono_domain_get
mono_domain_get_by_id
mono_domain_get_id
mono_domain_has_type_resolve
mono_domain_is_unloading
mono_domain_owns_vtable_slot
mono_domain_set
mono_domain_set_internal
mono_domain_try_type_resolve
mono_domain_try_unload
mono_domain_unload
mono_emit_native_call
mono_environment_exitcode_get
mono_environment_exitcode_set
mono_error_cleanup
mono_error_get_error_code
mono_error_get_message
mono_error_init
mono_error_init_flags
mono_error_ok
mono_escape_uri_string
mono_event_get_add_method
mono_event_get_flags
mono_event_get_name
mono_event_get_object
mono_event_get_parent
mono_event_get_raise_method
mono_event_get_remove_method
mono_exception_from_name
mono_exception_from_name_domain
mono_exception_from_name_msg
mono_exception_from_name_two_strings
mono_exception_from_token
mono_exception_from_token_two_strings
mono_field_from_token
mono_field_full_name
mono_field_get_data
mono_field_get_flags
mono_field_get_name
mono_field_get_object
mono_field_get_offset
mono_field_get_parent
mono_field_get_type
mono_field_get_value
mono_field_get_value_object
mono_field_set_value
mono_field_static_get_value
mono_field_static_set_value
mono_file_map
mono_file_map_close
mono_file_map_fd
mono_file_map_open
mono_file_map_size
mono_file_unmap
mono_free
mono_free_bstr
mono_free_method
mono_free_verify_list
mono_gc_collect
mono_gc_collection_count
mono_gc_get_generation
mono_gc_get_heap_size
mono_gc_get_used_size
mono_gchandle_free
mono_gchandle_get_target
mono_gchandle_new
mono_gchandle_new_weakref
mono_gc_invoke_finalizers
mono_gc_max_generation
mono_gc_wbarrier_arrayref_copy
mono_gc_wbarrier_generic_nostore
mono_gc_wbarrier_generic_store
mono_gc_wbarrier_generic_store_atomic
mono_gc_wbarrier_object_copy
mono_gc_wbarrier_set_arrayref
mono_gc_wbarrier_set_field
mono_gc_wbarrier_value_copy
mono_get_array_class
mono_get_boolean_class
mono_get_byte_class
mono_get_char_class
mono_get_config_dir
mono_get_corlib
mono_get_dbnull_object
mono_get_delegate_invoke
mono_get_double_class
mono_get_enum_class
mono_get_exception_appdomain_unloaded
mono_get_exception_argument
mono_get_exception_argument_null
mono_get_exception_argument_out_of_range
mono_get_exception_arithmetic
mono_get_exception_array_type_mismatch
mono_get_exception_bad_image_format
mono_get_exception_bad_image_format2
mono_get_exception_cannot_unload_appdomain
mono_get_exception_class
mono_get_exception_divide_by_zero
mono_get_exception_execution_engine
mono_get_exception_field_access
mono_get_exception_file_not_found
mono_get_exception_file_not_found2
mono_get_exception_index_out_of_range
mono_get_exception_invalid_cast
mono_get_exception_invalid_operation
mono_get_exception_io
mono_get_exception_method_access
mono_get_exception_missing_field
mono_get_exception_missing_method
mono_get_exception_not_implemented
mono_get_exception_not_supported
mono_get_exception_null_reference
mono_get_exception_out_of_memory
mono_get_exception_overflow
mono_get_exception_reflection_type_load
mono_get_exception_security
mono_get_exception_serialization
mono_get_exception_stack_overflow
mono_get_exception_synchronization_lock
mono_get_exception_thread_abort
mono_get_exception_thread_interrupted
mono_get_exception_thread_state
mono_get_exception_type_initialization
mono_get_exception_type_load
mono_get_int16_class
mono_get_int32_class
mono_get_int64_class
mono_get_intptr_class
mono_get_machine_config
mono_get_method
mono_get_method_full
mono_get_object_class
mono_get_root_domain
mono_get_sbyte_class
mono_get_single_class
mono_get_string_class
mono_get_thread_class
mono_get_trampoline_func
mono_get_uint16_class
mono_get_uint32_class
mono_get_uint64_class
mono_get_uintptr_class
mono_get_void_class
mono_g_hash_table_destroy
mono_g_hash_table_find
mono_g_hash_table_foreach
mono_g_hash_table_foreach_remove
mono_g_hash_table_insert
mono_g_hash_table_lookup
mono_g_hash_table_lookup_extended
mono_g_hash_table_new
mono_g_hash_table_new_full
mono_g_hash_table_new_type
mono_g_hash_table_remove
mono_g_hash_table_replace
mono_g_hash_table_size
mono_guid_to_string
mono_hazard_pointer_get
mono_image_addref
mono_image_close
mono_image_ensure_section
mono_image_ensure_section_idx
mono_image_fixup_vtable
mono_image_get_assembly
mono_image_get_entry_point
mono_image_get_filename
mono_image_get_guid
mono_image_get_name
mono_image_get_public_key
mono_image_get_resource
mono_image_get_strong_name
mono_image_get_table_info
mono_image_get_table_rows
mono_image_has_authenticode_entry
mono_image_is_dynamic
mono_image_loaded
mono_image_loaded_by_guid
mono_image_loaded_by_guid_full
mono_image_loaded_full
mono_image_load_file_for_image
mono_image_lookup_resource
mono_image_open
mono_image_open_from_data
mono_image_open_from_data_full
mono_image_open_from_data_with_name
mono_image_open_full
mono_image_rva_map
mono_images_cleanup
mono_image_strerror
mono_image_strong_name_position
mono_init
mono_init_from_assembly
mono_init_version
mono_install_assembly_load_hook
mono_install_assembly_postload_refonly_search_hook
mono_install_assembly_postload_search_hook
mono_install_assembly_preload_hook
mono_install_assembly_refonly_preload_hook
mono_install_assembly_refonly_search_hook
mono_install_assembly_search_hook
mono_install_runtime_cleanup
mono_install_threadpool_item_hooks
mono_install_threadpool_thread_hooks
mono_inst_name
mono_is_debugger_attached
mono_jit_cleanup
mono_jit_exec
mono_jit_info_get_code_size
mono_jit_info_get_code_start
mono_jit_info_get_method
mono_jit_info_table_find
mono_jit_init
mono_jit_init_version
mono_jit_parse_options
mono_jit_set_aot_only
mono_jit_set_trace_options
mono_ldstr
mono_ldtoken
mono_llvm_build_aligned_load
mono_llvm_build_alloca
mono_llvm_build_load
mono_llvm_create_ee
mono_llvm_dispose_ee
mono_llvm_dump_value
mono_llvm_optimize_method
mono_llvm_replace_uses_of
mono_load_remote_field
mono_load_remote_field_new
mono_local_deadce
mono_locks_dump
mono_lookup_internal_call
mono_lookup_pinvoke_call
mono_main
mono_marshal_string_to_utf16
mono_md5_final
mono_md5_get_digest
mono_md5_get_digest_from_file
mono_md5_init
mono_md5_update
mono_mempool_alloc
mono_mempool_alloc0
mono_mempool_contains_addr
mono_mempool_destroy
mono_mempool_empty
mono_mempool_get_allocated
mono_mempool_invalidate
mono_mempool_new
mono_mempool_new_size
mono_mempool_stats
mono_mempool_strdup
mono_metadata_blob_heap
mono_metadata_cleanup
mono_metadata_compute_size
mono_metadata_custom_attrs_from_index
mono_metadata_declsec_from_index
mono_metadata_decode_blob_size
mono_metadata_decode_row
mono_metadata_decode_row_col
mono_metadata_decode_signed_value
mono_metadata_decode_table_row
mono_metadata_decode_table_row_col
mono_metadata_decode_value
mono_metadata_encode_value
mono_metadata_events_from_typedef
mono_metadata_field_info
mono_metadata_field_info_with_mempool
mono_metadata_free_array
mono_metadata_free_inflated_signature
mono_metadata_free_marshal_spec
mono_metadata_free_method_signature
mono_metadata_free_mh
mono_metadata_free_type
mono_metadata_generic_class_is_valuetype
mono_metadata_get_constant_index
mono_metadata_get_inflated_signature
mono_metadata_get_marshal_info
mono_metadata_guid_heap
mono_metadata_implmap_from_method
mono_metadata_interfaces_from_typedef
mono_metadata_load_generic_params
mono_metadata_locate
mono_metadata_locate_token
mono_metadata_methods_from_event
mono_metadata_methods_from_property
mono_metadata_nested_in_typedef
mono_metadata_nesting_typedef
mono_metadata_packing_from_typedef
mono_metadata_parse_array
mono_metadata_parse_custom_mod
mono_metadata_parse_field_type
mono_metadata_parse_marshal_spec
mono_metadata_parse_method_signature
mono_metadata_parse_method_signature_full
mono_metadata_parse_mh
mono_metadata_parse_mh_full
mono_metadata_parse_param
mono_metadata_parse_signature
mono_metadata_parse_type
mono_metadata_parse_typedef_or_ref
mono_metadata_parse_type_full
mono_metadata_properties_from_typedef
mono_metadata_signature_alloc
mono_metadata_signature_dup
mono_metadata_signature_equal
mono_metadata_string_heap
mono_metadata_token_from_dor
mono_metadata_translate_token_index
mono_metadata_typedef_from_field
mono_metadata_typedef_from_method
mono_metadata_type_equal
mono_metadata_type_hash
mono_metadata_user_string
mono_method_body_get_object
mono_method_can_access_field
mono_method_can_access_method
mono_method_desc_free
mono_method_desc_from_method
mono_method_desc_full_match
mono_method_desc_match
mono_method_desc_new
mono_method_desc_search_in_class
mono_method_desc_search_in_image
mono_method_full_name
mono_method_get_class
mono_method_get_flags
mono_method_get_generic_container
mono_method_get_header
mono_method_get_index
mono_method_get_last_managed
mono_method_get_marshal_info
mono_method_get_name
mono_method_get_object
mono_method_get_param_names
mono_method_get_param_token
mono_method_get_signature
mono_method_get_signature_full
mono_method_get_token
mono_method_get_unmanaged_thunk
mono_method_has_marshal_info
mono_method_header_get_clauses
mono_method_header_get_code
mono_method_header_get_locals
mono_method_header_get_num_clauses
mono_method_signature
mono_method_verify
mono_mlist_alloc
mono_mlist_append
mono_mlist_get_data
mono_mlist_last
mono_mlist_length
mono_mlist_next
mono_mlist_prepend
mono_mlist_remove_item
mono_mlist_set_data
mono_mlist_set_next
mono_module_file_get_object
mono_module_get_object
mono_monitor_enter
mono_monitor_exit
mono_monitor_try_enter
mono_mprotect
mono_object_castclass_mbyref
mono_object_clone
mono_object_describe
mono_object_describe_fields
mono_object_get_class
mono_object_get_domain
mono_object_get_size
mono_object_get_virtual_method
mono_object_isinst
mono_object_isinst_mbyref
mono_object_new
mono_object_new_alloc_specific
mono_object_new_fast
mono_object_new_from_token
mono_object_new_specific
mono_object_unbox
mono_opcode_name
mono_opcode_value
mono_op_to_op_imm_noemul
mono_pagesize
mono_param_get_objects
mono_parse_default_optimizations
mono_path_canonicalize
mono_path_resolve_symlinks
mono_pe_file_open
mono_perfcounters_init
mono_personality
mono_pmip
mono_print_method_from_ip
mono_print_thread_dump
mono_print_thread_dump_from_ctx
mono_print_unhandled_exception
mono_profiler_coverage_get
mono_profiler_get_events
mono_profiler_install
mono_profiler_install_allocation
mono_profiler_install_appdomain
mono_profiler_install_assembly
mono_profiler_install_class
mono_profiler_install_code_buffer_new
mono_profiler_install_code_chunk_destroy
mono_profiler_install_code_chunk_new
mono_profiler_install_coverage_filter
mono_profiler_install_enter_leave
mono_profiler_install_exception
mono_profiler_install_gc
mono_profiler_install_gc_moves
mono_profiler_install_iomap
mono_profiler_install_jit_compile
mono_profiler_install_jit_end
mono_profiler_install_method_free
mono_profiler_install_method_invoke
mono_profiler_install_module
mono_profiler_install_monitor
mono_profiler_install_runtime_initialized
mono_profiler_install_statistical
mono_profiler_install_statistical_call_chain
mono_profiler_install_thread
mono_profiler_install_transition
mono_profiler_load
mono_profiler_set_events
mono_property_get_flags
mono_property_get_get_method
mono_property_get_name
mono_property_get_object
mono_property_get_parent
mono_property_get_set_method
mono_property_get_value
mono_property_hash_destroy
mono_property_hash_insert
mono_property_hash_lookup
mono_property_hash_new
mono_property_hash_remove_object
mono_property_set_value
mono_ptr_class_get
mono_raise_exception
mono_reflection_free_type_info
mono_reflection_get_custom_attrs
mono_reflection_get_custom_attrs_blob
mono_reflection_get_custom_attrs_by_type
mono_reflection_get_custom_attrs_data
mono_reflection_get_custom_attrs_info
mono_reflection_get_token
mono_reflection_get_type
mono_reflection_parse_type
mono_reflection_type_from_name
mono_register_bundled_assemblies
mono_register_machine_config
mono_replace_ins
mono_runtime_class_init
mono_runtime_cleanup
mono_runtime_delegate_invoke
mono_runtime_exec_main
mono_runtime_exec_managed_code
mono_runtime_get_main_args
mono_runtime_init
mono_runtime_invoke
mono_runtime_invoke_array
mono_runtime_is_shutting_down
mono_runtime_object_init
mono_runtime_quit
mono_runtime_run_main
mono_security_core_clr_require_elevated_permissions
mono_security_enable_core_clr
mono_security_set_core_clr_platform_callback
mono_sem_post
mono_sem_timedwait
mono_sem_wait
mono_set_break_policy
mono_set_defaults
mono_set_dirs
mono_set_is_debugger_attached
mono_set_signal_chaining
mono_sha1_final
mono_sha1_get_digest
mono_sha1_get_digest_from_file
mono_sha1_init
mono_sha1_update
mono_signature_explicit_this
mono_signature_get_call_conv
mono_signature_get_desc
mono_signature_get_param_count
mono_signature_get_params
mono_signature_get_return_type
mono_signature_hash
mono_signature_is_instance
mono_signature_vararg_start
mono_signbit_double
mono_signbit_float
mono_stack_walk
mono_stack_walk_no_il
mono_store_remote_field
mono_store_remote_field_new
mono_string_chars
mono_string_equal
mono_string_from_bstr
mono_string_from_utf16
mono_string_hash
mono_stringify_assembly_name
mono_string_intern
mono_string_is_interned
mono_string_length
mono_string_new
mono_string_new_len
mono_string_new_size
mono_string_new_utf16
mono_string_new_wrapper
mono_string_to_utf16
mono_string_to_utf8
mono_table_info_get_rows
mono_thread_attach
mono_thread_cleanup
mono_thread_create
mono_thread_current
mono_thread_detach
mono_thread_exit
mono_thread_get_main
mono_thread_get_undeniable_exception
mono_thread_hazardous_free_or_queue
mono_thread_hazardous_try_free_all
mono_thread_manage
mono_thread_new_init
mono_thread_set_main
mono_thread_set_manage_callback
mono_threads_get_default_stacksize
mono_threads_install_cleanup
mono_threads_request_thread_dump
mono_threads_set_default_stacksize
mono_thread_stop
mono_trace_set_level_string
mono_trace_set_mask_string
mono_type_create_from_typespec
mono_type_full_name
mono_type_generic_inst_is_valuetype
mono_type_get_array_type
mono_type_get_class
mono_type_get_desc
mono_type_get_modifiers
mono_type_get_name
mono_type_get_object
mono_type_get_ptr_type
mono_type_get_signature
mono_type_get_type
mono_type_get_underlying_type
mono_type_is_byref
mono_type_is_pointer
mono_type_is_reference
mono_type_is_struct
mono_type_is_valid_enum_basetype
mono_type_is_void
mono_type_size
mono_type_stack_size
mono_type_to_unmanaged
mono_unhandled_exception
mono_unicode_from_external
mono_unicode_to_external
mono_upgrade_remote_class_wrapper
mono_utf8_from_external
mono_utf8_validate_and_len
mono_utf8_validate_and_len_with_bounds
mono_valloc
mono_value_box
mono_value_copy
mono_value_copy_array
mono_value_describe_fields
mono_verify_corlib
mono_vfree
mono_vtable_get_static_field_data
mono_walk_stack
mono_win32_compat_CopyMemory
mono_win32_compat_FillMemory
mono_win32_compat_MoveMemory
mono_win32_compat_ZeroMemory
_ZN20MonoJITMemoryManager11AllocateGOTEv
_ZN20MonoJITMemoryManager12allocateStubEPKN4llvm11GlobalValueEjj
_ZN20MonoJITMemoryManager13allocateSpaceEij
_ZN20MonoJITMemoryManager13SetDlsymTableEPv
_ZN20MonoJITMemoryManager14allocateGlobalEjj
_ZN20MonoJITMemoryManager15endFunctionBodyEPKN4llvm8FunctionEPhS4_
_ZN20MonoJITMemoryManager17endExceptionTableEPKN4llvm8FunctionEPhS4_S4_
_ZN20MonoJITMemoryManager17setMemoryWritableEv
_ZN20MonoJITMemoryManager17startFunctionBodyEPKN4llvm8FunctionERj
_ZN20MonoJITMemoryManager19setMemoryExecutableEv
_ZN20MonoJITMemoryManager19startExceptionTableEPKN4llvm8FunctionERj
_ZN20MonoJITMemoryManager24deallocateMemForFunctionEPKN4llvm8FunctionE
_ZN20MonoJITMemoryManagerC1Ev
_ZN20MonoJITMemoryManagerC2Ev
_ZN20MonoJITMemoryManagerD0Ev
_ZN20MonoJITMemoryManagerD1Ev
_ZN20MonoJITMemoryManagerD2Ev
CloseHandle
closesocket
CopyFile
CreateDirectory
CreateEvent
CreateFile
CreateMutex
CreatePipe
CreateProcess
CreateProcessWithLogonW
CreateSemaphore
CreateThread
DeleteCriticalSection
DeleteFile
DuplicateHandle
EnumProcesses
EnumProcessModules
errno_to_WSA
ExitThread
FileTimeToSystemTime
FindClose
FindFirstFile
FindNextFile
FlushFileBuffers
FormatMessage
GetCurrentDirectory
GetCurrentProcess
GetCurrentProcessId
GetCurrentThread
GetCurrentThreadId
GetDiskFreeSpaceEx
GetDriveType
GetExitCodeProcess
GetExitCodeThread
GetFileAttributes
GetFileAttributesEx
GetFileSize
GetFileTime
GetFileType
GetFileVersionInfo
GetFileVersionInfoSize
GetLastError
GetLogicalDriveStrings
GetModuleBaseName
GetModuleFileNameEx
GetModuleInformation
GetPriorityClass
GetProcessId
GetProcessTimes
GetProcessWorkingSetSize
GetStdHandle
GetSystemInfo
GetTempPath
GetThreadContext
GetTickCount
ImpersonateLoggedOnUser
InitializeCriticalSection
InitializeCriticalSectionAndSpinCount
ioctlsocket
LockFile
mono_once
mono_pthread_key_for_tls
MoveFile
OpenEvent
OpenMutex
OpenProcess
OpenSemaphore
OpenThread
PulseEvent
QueryPerformanceCounter
QueryPerformanceFrequency
QueueUserAPC
ReadFile
ReleaseMutex
ReleaseSemaphore
RemoveDirectory
ReplaceFile
ResetEvent
ResumeThread
RevertToSelf
SetCriticalSectionSpinCount
SetCurrentDirectory
SetEndOfFile
SetEvent
SetFileAttributes
SetFilePointer
SetFileTime
SetLastError
SetPriorityClass
SetProcessWorkingSetSize
ShellExecuteEx
SignalObjectAndWait
Sleep
SleepEx
SuspendThread
TerminateProcess
TlsAlloc
TlsFree
TlsGetValue
TlsSetValue
TransmitFile
TryEnterCriticalSection
UnlockFile
VerLanguageName
VerQueryValue
WaitForInputIdle
WaitForMultipleObjects
WaitForMultipleObjectsEx
WaitForSingleObject
WaitForSingleObjectEx
wapi_clear_interruption
wapi_current_thread_desc
wapi_interrupt_thread
wapi_self_interrupt
wapi_thread_clear_wait_handle
wapi_thread_set_wait_handle
WriteFile
WSACleanup
WSAGetLastError
WSAIoctl
WSARecv
WSASend
WSASetLastError
WSAStartup
+2 -2
View File
@@ -13,10 +13,10 @@ ASSEMBLED_DOCS = \
monoapi.tree monoapi.zip
convert.exe: $(srcdir)/convert.cs AgilityPack.dll
$(CSCOMPILE) -out:$@ $< -r:AgilityPack.dll
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -out:$@ $< -r:AgilityPack.dll
AgilityPack.dll:
$(CSCOMPILE) -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
monoapi.zip: monoapi.tree
@test -f $@ || { rm -f $< && $(MAKE) $<; }
-1019
View File
File diff suppressed because it is too large. Load diff
+94
View File
@@ -0,0 +1,94 @@
ALLOW_UNICODE_NAMES = NO
ALPHABETICAL_INDEX = YES
ALWAYS_DETAILED_SEC = NO
AUTOLINK_SUPPORT = YES
BRIEF_MEMBER_DESC = YES
CALLER_GRAPH = YES
CALL_GRAPH = YES
CASE_SENSE_NAMES = NO
CLASS_DIAGRAMS = YES
COLS_IN_ALPHA_INDEX = 1
CREATE_SUBDIRS = NO
DIRECTORY_GRAPH = YES
DOT_CLEANUP = YES
DOT_IMAGE_FORMAT = svg
DOT_MULTI_TARGETS = YES
DOXYFILE_ENCODING = UTF-8
ENABLE_PREPROCESSING = YES
ENUM_VALUES_PER_LINE = 1
EXCLUDE_SYMLINKS = NO
EXPAND_ONLY_PREDEF = NO
EXTENSION_MAPPING = c=C h=C
EXTRACT_ALL = NO
EXTRACT_STATIC = YES
EXT_LINKS_IN_WINDOW = NO
FILE_PATTERNS = *.c *.h
FULL_PATH_NAMES = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST = YES
GENERATE_HTML = YES
GENERATE_LEGEND = YES
GENERATE_PERLMOD = NO
GENERATE_TESTLIST = NO
GENERATE_TODOLIST = YES
GENERATE_TREEVIEW = YES
GRAPHICAL_HIERARCHY = YES
HAVE_DOT = YES
HIDE_UNDOC_RELATIONS = YES
HTML_COLORSTYLE_GAMMA = 80
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_DYNAMIC_SECTIONS = YES
HTML_FILE_EXTENSION = .html
HTML_INDEX_NUM_ENTRIES = 100
HTML_OUTPUT = doxygen
HTML_TIMESTAMP = YES
INCLUDED_BY_GRAPH = YES
INCLUDE_GRAPH = YES
INHERIT_DOCS = YES
INLINE_INHERITED_MEMB = NO
INLINE_SOURCES = YES
INPUT = ../mono
INPUT_ENCODING = UTF-8
INTERACTIVE_SVG = YES
JAVADOC_AUTOBRIEF = NO
LOOKUP_CACHE_SIZE = 0
MACRO_EXPANSION = NO
MARKDOWN_SUPPORT = YES
MAX_INITIALIZER_LINES = 30
MULTILINE_CPP_IS_BRIEF = NO
OPTIMIZE_OUTPUT_FOR_C = YES
OUTPUT_DIRECTORY = doxygen-output
OUTPUT_LANGUAGE = English
PREDEFINED = "HAVE_SGEN_GC="
PROJECT_NAME = "Mono"
QT_AUTOBRIEF = NO
QUIET = NO
RECURSIVE = YES
REFERENCED_BY_RELATION = YES
REFERENCES_LINK_SOURCE = YES
REFERENCES_RELATION = YES
REPEAT_BRIEF = YES
SEARCHENGINE = YES
SEARCH_INCLUDES = YES
SEPARATE_MEMBER_PAGES = NO
SHORT_NAMES = NO
SHOW_FILES = YES
SHOW_USED_FILES = YES
SKIP_FUNCTION_MACROS = YES
SORT_BRIEF_DOCS = YES
SORT_GROUP_NAMES = YES
SORT_MEMBER_DOCS = YES
SOURCE_BROWSER = YES
SOURCE_TOOLTIPS = YES
STRIP_CODE_COMMENTS = NO
TAB_SIZE = 4
TREEVIEW_WIDTH = 250
TYPEDEF_HIDES_STRUCT = NO
USE_HTAGS = NO
USE_MDFILE_AS_MAINPAGE = ../README.md
VERBATIM_HEADERS = YES
WARNINGS = YES
WARN_IF_DOC_ERROR = YES
WARN_IF_UNDOCUMENTED = YES
WARN_NO_PARAMDOC = YES
+450 -247
View File
@@ -1,299 +1,502 @@
#!/usr/bin/perl
if ($ARGV[0] eq "-h"){
$sourcedir = $ARGV[1];
$dir = $sourcedir;
$html = 1;
shift @ARGV;
shift @ARGV;
use warnings;
use strict;
use Getopt::Long;
use Pod::Usage;
# Options
my $HELP = 0;
my $SOURCE_DIR = '';
my $TARGET_DIR = '';
my $WARNINGS = 0;
GetOptions(
"help" => \$HELP,
"html|h=s" => \$SOURCE_DIR,
"target|t=s" => \$TARGET_DIR,
"warnings|W" => \$WARNINGS,
) or pod2usage(1);
pod2usage(0) if $HELP;
exdoc();
#
# Main entry point.
#
sub exdoc {
my %templates = ();
my %docs = ();
my $stylesheet = load_stylesheet($SOURCE_DIR);
load_templates($SOURCE_DIR, \%templates);
process_source_files(\%docs);
merge(\%docs, \%templates, \$stylesheet);
}
if ($ARGV[0] eq "-t"){
$dir = $ARGV[1];
shift @ARGV;
#
# Load CSS stylesheet.
#
sub load_stylesheet {
my ($dir_path) = @_;
my $file_path = "$dir_path/api-style.css";
open (my $file, '<', $file_path) or die "Could not open $file_path";
local $/;
my $contents = <$file>;
close $file;
return $contents;
}
if ($html){
opendir (D, "$sourcedir/sources/") || die "Can not open $dir";
while ($n = readdir (D)){
if ($n =~ /mono-api-.*\.html$/){
open (IN, "$sourcedir/sources/$n") || die "Can not open $n";
$files[$filecount] = $n;
while (<IN>){
@files_content[$filecount] .= $_;
if (/name="api:(.*?)"/){
$_ =~ s/.*name="api:(\w+?)".*/\1/;
$apis[$filecount] .= "$_";
}
}
$filecount++;
close IN;
}
#
# Load HTML templates.
#
sub load_templates {
my ($dir_path, $templates) = @_;
opendir (my $dir, "$dir_path/sources/") or die "Could not open $dir_path";
while (my $file_name = readdir ($dir)) {
next if $file_name !~ /mono-api-.*\.html$/;
open (my $file, "$dir_path/sources/$file_name") or die "Could not open $file_name";
my $contents = '';
my @api = ();
while (<$file>) {
$contents .= $_;
if (/name="api:(.*?)"/) {
s/.*name="api:(\w+?)".*/$1/;
push @api, $_;
}
}
close $file;
$templates->{$file_name}->{contents} = $contents;
$templates->{$file_name}->{api} = \@api;
}
closedir $dir;
}
#
# Extract documentation from all source files.
#
sub process_source_files {
my ($docs) = @_;
for my $file_path (@ARGV) {
process_source_file($file_path, $docs);
}
}
while (<ARGV>){
if (/\/\*\* *\n/){
&process_doc;
} else {
#print "IGNORING: $_";
}
#
# Extract documentation from a single source file.
#
sub process_source_file {
my ($file_path, $docs) = @_;
open (my $file, '<', $file_path) or die "Could not open $file_path";
while (<$file>) {
next if (!/\/\*\* *\n/);
process_function($file, $file_path, $docs);
}
close $file;
}
if ($html){
for ($f = 0; $f < $filecount; $f++){
$name = $files[$f];
open (OUT, "> $dir/html/$name") || die "Can not create $dir/html/$name";
print "Merging: $name\n";
print OUT<<EOF;
#
# Extract documentation from a single function.
#
sub process_function {
my ($file, $file_path, $docs) = @_;
my $PARAMETER_SECTION = 0;
my $BODY_SECTION = 1;
my $RETURN_SECTION = 2;
my $section = $PARAMETER_SECTION;
my $name = do {
$_ = <$file>;
chomp;
s/^ \* //;
s/:$//;
$_
};
# Ignore irrelevant functions, and those with the wrong doc format.
return if $name !~ /^mono_\w+$/;
my $deprecated;
my @parameters = ();
my $body = '';
my $returns = '';
my $prototype = '';
while (<$file>) {
# We've reached the last line in the documentation block.
if (/^ \*\*?\//) {
# Grab function prototype.
while (<$file>) {
$prototype .= $_;
last if /\{/;
}
# Clean up prototype.
$prototype = do {
$_ = $prototype;
# Strip braces and trailing whitespace.
s/{//;
s/ +$//;
# Turn "Type * xxx" into "Type* xxx"
s/^(\w+)\W+\*/$1*/;
$_;
};
# Process formatting within sections.
for my $parameter (@parameters) {
process_formatting(\$parameter->{description}, $file_path, $.);
}
process_formatting(\$returns, $file_path, $.);
process_formatting(\$body, $file_path, $.);
if (defined($deprecated)) {
process_formatting(\$deprecated, $file_path, $.);
}
$body =~ s/\n/ /g;
if (exists($docs->{body}->{$name})) {
my $origin = $docs->{origin}->{$name};
if ($WARNINGS) {
warn
"$file_path:$.: Redundant documentation for $name\n",
"$origin->{file}:$origin->{line}: Previously defined here\n";
}
}
$docs->{origin}->{$name} = { file => $file_path, line => $. };
$docs->{body}->{$name} = $body;
$docs->{parameters}->{$name} = \@parameters;
$docs->{deprecated}->{$name} = $deprecated if defined $deprecated;
$docs->{return}->{$name} = $returns;
$docs->{prototype}->{$name} = $prototype;
last;
}
# Strip newlines and asterisk prefix.
chomp;
s/^ +\*//;
# Replace blank lines with paragraph breaks.
$_ = '<p>' if /^\s*$/;
if ($section == $PARAMETER_SECTION) {
if (/\s*\\param +(\w+)(.*)/) {
# print "$file_path:$.: warning: Got parameter $1\n";
push @parameters, { name => $1, description => $2 };
} elsif (/\s*\\deprecated(.*)/) {
# print "$file_path:$.: warning: Got deprecated annotation\n";
$deprecated = $1;
} elsif (/\s*(\w+):(.*)/) {
if ($1 eq 'deprecated') {
warn "$file_path:$.: Old-style monodoc notation 'deprecated:' used\n"
if $WARNINGS;
$deprecated = $2;
} else {
warn "$file_path:$.: Old-style monodoc notation 'param:' used\n"
if $WARNINGS;
push @parameters, { name => $1, description => $2 };
}
} else {
# $body = "\t$_\n";
$section = $BODY_SECTION;
redo;
}
} elsif ($section == $BODY_SECTION) {
if (s/(Returns?:\s*|\\returns?\s*)//) {
$returns = "\t$_\n";
$section = $RETURN_SECTION;
} else {
$body .= "\n\t$_";
}
} elsif ($section == $RETURN_SECTION) {
$returns .= "\n\t$_";
} else {
die "Invalid section $section\n";
}
}
}
#
# Substitute formatting within documentation text.
#
sub process_formatting {
my ($content, $file_path, $current_line) = @_;
$_ = $$content;
# Constants
s{NULL}{<code>NULL</code>}g;
s{TRUE}{<code>TRUE</code>}g;
s{FALSE}{<code>FALSE</code>}g;
# Parameters
warn "$file_path:$current_line: Old-style monodoc notation '\@param' used\n"
if s{@(\w+)}{<i>$1</i>}g && $WARNINGS;
s{\\p +(\w+)}{<i>$1</i>}g;
# Code
warn "$file_path:$current_line: Old-style monodoc notation '#code' used\n"
if s{#(\w+)}{<code>$1</code>}g && $WARNINGS;
warn "$file_path:$current_line: Old-style monodoc notation '`code`' used\n"
if s{\`((?!api:)[:.\w\*]+)\`}{<code>$1</code>}g && $WARNINGS;
s{\\c +(\S+(?<![.,:;]))}{<code>$1</code>}g;
$$content = $_;
}
#
# Merge templates with stylesheet and documentation extracted from sources.
#
sub merge {
my ($docs, $templates, $stylesheet) = @_;
my $last = '';
for my $name (keys %$templates) {
open (my $output_file, '>', "$TARGET_DIR/html/$name")
or die "Could not create $TARGET_DIR/html/$name";
print "Merging: $name\n";
print $output_file <<EOF;
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>$name</title>
<style type="text/css">
h3 {
font-size: 18px;
padding-bottom: 4pt;
border-bottom: 2px solid #dddddd;
}
.api {
border: 1px solid;
padding: 10pt;
margin: 10pt;
}
.api-entry {
border-bottom: none;
font-size: 18px;
}
.prototype {
border: 1px solid;
background-color: #f2f2f2;
padding: 5pt;
margin-top: 5pt;
margin-bottom: 5pt;
}
.header {
border: 1px solid;
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
}
.code {
border: 1px solid;
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
}
<title>$name</title>
<style type="text/css">
$stylesheet
</style>
</head>
<body>
<div class="mapi-docs">
EOF
@a = split (/\n/, $files_content[$f]);
my @a = split (/\n/, $templates->{$name}->{contents});
my $strike = '';
my $strikeextra = '';
my $api_shown = 0;
for (my $ai = 0; $ai < $#a; $ai++) {
my $line = $a[$ai];
if (my ($api, $caption) = ($line =~ /<h4><a name=\"api:(\w+)\">(\w+)<\/a><\/h4>/)) {
if ($api_shown == 1) {
print $output_file "</div> <!-- class=mapi -->\n\n";
if ($docs->{deprecated}->{$api}) {
$strike = "mapi-strike";
$strikeextra = "</div><br><div class='mapi-deprecated'><b>Deprecated:</b> " . $docs->{deprecated}->{$api};
} else {
$strike = "";
$strikeextra = "";
}
}
$api_shown = 1;
my $proto = $docs->{prototype}->{$api} // $api;
for ($ai = 0; $ai < $#a; $ai++){
$line = $a[$ai];
($api,$caption) = $line =~ /<h4><a name=\"api:(\w+)\">(\w+)<\/a><\/h4>/;
if ($api ne ""){
if ($api_shown == 1){
print OUT "</div>";
}
$api_shown = 1;
$proto = $prototype{$api};
if ($proto eq ""){
$proto = "Prototype: $api";
}
print $output_file <<EOF;
<a name="api:$api"></a>
<div class="mapi">
<div class="mapi-entry $strike"><code>$api$strikeextra</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
print OUT<<EOF;
<a name="api:$api"></a>
<div class="api">
<div class="api-entry">$api</div>
<div class="prototype">$proto</div>
<p>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">$proto</div>
<p>
EOF
&opt_print ("Parameters", $arguments{$api}, 1);
&opt_print ("Returns", $returns{$api}, 1);
&opt_print ("Remarks", $bodies{$api}, 0);
print OUT "\n";
} else {
if ($line =~ /@API_IDX@/){
$apis_toc = &create_toc ($apis[$f]);
$line =~ s/\@API_IDX\@/$apis_toc/;
}
if ($line =~ /^<h/){
print OUT "</div>";
$api_shown = 0;
}
if (exists ($docs->{parameters}->{$api})) {
my $ppars = $docs->{parameters}->{$api};
if (@$ppars) {
print $output_file
" <div class=\"mapi-section\">Parameters</div>\n",
" <table class=\"mapi-parameters\"><tbody>",
render_parameters($ppars),
"</tbody></table>";
}
}
print OUT "$line\n";
}
}
print OUT<<EOF;
</body>
</html>
EOF
close OUT;
system ("$ENV{runtimedir}/mono-wrapper convert.exe $dir/html/$name $dir/html/x-$name");
opt_print ($output_file, "Return value", $docs->{return}->{$api});
opt_print ($output_file, "Description", $docs->{body}->{$api});
print $output_file " </div><!--mapi-description-->\n </div><!--height container-->\n";
} else {
if ($line =~ /\@API_IDX\@/) {
my $apis_toc = create_toc ($docs, $templates->{$name}->{api});
$line =~ s/\@API_IDX\@/$apis_toc/;
}
if ($line =~ /^<h4/) {
print $output_file "</div>\n";
$api_shown = 0;
}
if ($line =~ /`/) {
}
print $output_file "$line\n";
}
}
print $output_file
" </div>",
"</body>",
"</html>";
close $output_file;
system ("$ENV{runtimedir}/mono-wrapper convert.exe $TARGET_DIR/html/$name $TARGET_DIR/html/x-$name");
# clean up the mess that AgilityPack does, it CDATAs our CSS
open HACK, "$dir/html/x-$name" || die "Could not open $dir/html/x-$name";
open HACKOUT, ">$dir/deploy/$name" || die "Could not open output";
# Clean up the mess that AgilityPack makes (it CDATAs our CSS).
open (my $hack_input, '<', "$TARGET_DIR/html/x-$name")
or die "Could not open $TARGET_DIR/html/x-$name";
open (my $hack_output, '>', "$TARGET_DIR/deploy/$name")
or die "Could not open output";
while (<HACK>){
s/^\/\/<!\[CDATA\[//;
s/^\/\/\]\]>\/\///;
print HACKOUT $_;
}
#system ("cp.exe $dir/html/$name $dir/deploy/$name");
my $line = 0;
my $doprint = 0;
while (<$hack_input>) {
print $hack_output $last if ($doprint);
$line++;
s/^\/\/<!\[CDATA\[//;
s/^\/\/\]\]>\/\///;
# Remove the junk <span> wrapper generated by AgilityPack.
if ($line==1) {
s/<span>//;
}
if (/<style type/) {
# Replace the CSS in the XHTML output with the original CSS.
print $hack_output $_;
print $hack_output $$stylesheet;
while (<$hack_input>) {
last if (/<\/style>/);
}
}
$last = $_;
$doprint = 1;
}
if (!($last =~ /span/)) {
print $hack_output $last;
}
# system ("cp.exe $TARGET_DIR/html/$name $TARGET_DIR/deploy/$name");
}
}
sub process_doc {
$doc = "";
$func = <>;
chop $func;
$func =~ s/^ \* //;
$func =~ s/:$//;
print "Function: $func\n" if (!$html);
$args = "";
$inbody = 0;
$returns = "";
$body = "";
$functions[$fn++] = $func;
# Process arguments
while (<>){
if (/^ \*\*?\//){
$body =~ s/[@#](\w+)/<i>\1<\/i>/g;
$returns =~ s/[@#](\w+)/<i>\1<\/i>/g;
$args =~ s/@(\w+)/<i>\1<\/i>/g;
$body =~ s/\n/ /;
$bodies{$func} = $body;
$arguments{$func} = $args;
$returns{$func} = $returns;
$proto = "";
while (<>){
$proto .= $_;
last if (/\{/);
}
$proto =~ s/{//;
# clean it up a little, remove newlines, empty space at end
$proto =~ s/ +$//;
# Turn "Type * xxx" into "Type* xxx"
$proto =~ s/^(\w+)\W+\*/\1\*/;
$prototype{$func} = $proto;
return;
}
chop;
s/^\ \*//;
$_ = "\n<p>" if (/^\s+$/);
if ($inbody == 0){
if (/\s*(\w+):(.*)/){
$args .= "<dt><i>$1:</i></dt><dd>$2</dd>";
} else {
$body = "\t$_\n";
$inbody = 1;
}
} elsif ($inbody == 1) {
if (/Returns?:/){
s/Returns?://;
$returns = "\t$_\n";
$inbody = 2;
} else {
$body .= "\n\t$_";
}
} else {
$returns .= "\n\t$_";
}
}
}
sub create_toc {
my ($apis_listed) = @_;
my ($docs, $apis_listed) = @_;
my $type_size = 0;
my $name_size = 0;
my $ret, $xname, $args, $line;
$apis_toc = "";
my ($ret, $xname, $args);
my $apis_toc = "";
# Try to align things, so compute type size, method size, and arguments
foreach $line (split /\n/, $apis_listed){
$p = $prototype{$line};
($ret, $xname, $args) = $p =~ /(.*)\n(\w+)[ \t](.*)/;
$tl = length ($ret);
$pl = length ($xname);
$type_size = $tl if ($tl > $type_size);
$name_size = $pl if ($pl > $name_size);
# Try to align things; compute type size, method size, and arguments.
foreach my $line (split /\n/, $apis_listed) {
if (exists ($docs->{prototype}->{$line})) {
my $p = $docs->{prototype}->{$line};
if (my ($ret, $xname, $args) = ($p =~ /(.*)\n(\w+)[ \t](.*)/)) {
my $tl = length ($ret);
my $pl = length ($xname);
$type_size = $tl if ($tl > $type_size);
$name_size = $pl if ($pl > $name_size);
}
}
}
$type_size++;
$name_size++;
foreach $line (split /\n/, $apis_listed){
chop;
$p = $prototype{$line};
($ret, $xname, $args) = $p =~ /(.*)\n(\w+)[ \t](.*)/;
$rspace = " " x ($type_size - length ($ret));
$nspace = " " x ($name_size - length ($xname));
$args = &format ($args, length ($ret . $rspace . $xname . $nspace), 60);
$apis_toc .= "$ret$rspace<a href=\"\#api:$line\">$xname</a>$nspace$args\n";
foreach my $line (split /\n/, $apis_listed) {
chomp($line);
if (exists($docs->{prototype}->{$line})) {
my $p = $docs->{prototype}->{$line};
if (my ($ret, $xname, $args) = ($p =~ /(.*)\n(\w+)[ \t](.*)/)) {
$xname = $line if $xname eq "";
my $rspace = " " x ($type_size - length ($ret));
my $nspace = " " x ($name_size - length ($xname));
$args = wrap ($args, length ($ret . $rspace . $xname . $nspace), 60);
$apis_toc .= "$ret$rspace<a href=\"\#api:$line\">$xname</a>$nspace$args\n";
}
}
}
return $apis_toc;
}
#
# Formats the rest of the arguments in a way that will fit in N columns
#
sub format {
sub wrap {
my ($args, $size, $limit) = @_;
my $sret = "";
# return $args if ((length (args) + size) < $limit);
# return $args if ((length (args) + size) < $limit);
$remain = $limit - $size;
@sa = split /,/, $args;
$linelen = $size;
foreach $arg (@sa){
if ($sret eq ""){
$sret = $arg . ", ";
$linelen += length ($sret);
} else {
if ($linelen + length ($arg) < $limit){
$sret .= "FITS" . $arg . ", ";
} else {
$newline = " " x ($size) . $arg . ", ";
$linelen = length ($newline);
$sret .= "\n" . $newline;
}
}
my $remain = $limit - $size;
my @sa = split /,/, $args;
my $linelen = $size;
foreach my $arg (@sa) {
if ($sret eq "") {
$sret = $arg . ", ";
$linelen += length ($sret);
} else {
if ($linelen + length ($arg) < $limit) {
$sret .= "FITS" . $arg . ", ";
} else {
my $newline = " " x ($size) . $arg . ", ";
my $linelen = length ($newline);
$sret .= "\n" . $newline;
}
}
}
$sret =~ s/, $/;/;
return $sret;
}
#
# Print a section if non-empty.
#
sub opt_print {
my ($caption, $opttext, $quote) = @_;
if ($opttext ne "" && (!($opttext =~ /^[ \t]+$/))){
print OUT "<b>$caption</b>\n";
if ($quote == 1){
print OUT "<blockquote>$opttext</blockquote>\n";
} else {
print OUT "<p>$opttext\n";
}
my ($output, $caption, $opttext) = @_;
if (defined($opttext) && $opttext ne '' && $opttext !~ /^[ \t]+$/) {
print $output
" <div class=\"mapi-section\">$caption</div>\n",
" <div>$opttext</div>\n";
}
}
#
# Render parameter information as table.
#
sub render_parameters {
my ($parameters) = @_;
my $result = '';
for my $parameter (@$parameters) {
$result .= "<tr><td><i>$parameter->{name}</i></td><td>$parameter->{description}</td></tr>";
}
return $result;
}
__END__
=head1 NAME
exdoc - Compiles API docs from Mono sources and HTML templates.
=head1 SYNOPSIS
exdoc [OPTIONS] [FILE...]
=head1 OPTIONS
=over 4
=item B<--help>
Print this help message.
=item B<--html> I<DIR>, B<-h> I<DIR>
Use I<DIR> as the input path for HTML sources.
=item B<--target> I<DIR>, B<-t> I<DIR>
Use I<DIR> as the target path for output.
=item B<--warnings>, B<-W>
Enable warnings about documentation errors.
=back
=head1 DESCRIPTION
Reads HTML templates and C sources, extracting documentation from the sources and splicing it into the templates.
=cut
+1 -1
View File
@@ -326,7 +326,7 @@ mono_poll
mono_dynamic_stream_reset
mono_domain_get_tls_offset
mono_domain_add_class_static_data
mono_handle_native_sigsegv
mono_handle_native_crash
mono_set_config_dir
mono_profiler_coverage_alloc
mono_profiler_coverage_free
-1
View File
@@ -37,7 +37,6 @@
<manpage name="mono-xmltool(1)" page="../man/mono-xmltool.1" />
<manpage name="mozroots(1)" page="../man/mozroots.1" />
<manpage name="permview(1)" page="../man/permview.1" />
<manpage name="prj2make(1)" page="../man/prj2make.1" />
<manpage name="resgen(1)" page="../man/resgen.1" />
<manpage name="secutil(1)" page="../man/secutil.1" />
<manpage name="setreg(1)" page="../man/setreg.1" />
-79
View File
@@ -1,79 +0,0 @@
mono_array_clone
mono_array_clone_in_domain
mono_array_full_copy
mono_array_new
mono_array_new_full
mono_array_new_specific
mono_async_result_new
mono_class_get_allocation_ftn
mono_class_vtable
mono_compile_method
mono_delegate_ctor
mono_field_get_value
mono_field_get_value_object
mono_field_set_value
mono_field_static_get_value
mono_field_static_set_value
mono_get_constant_value_from_blob
mono_get_delegate_invoke
mono_install_compile_method
mono_install_free_method
mono_install_handler
mono_install_remoting_trampoline
mono_install_runtime_invoke
mono_install_trampoline
mono_ldstr
mono_load_remote_field
mono_load_remote_field_new
mono_message_init
mono_message_invoke
mono_method_call_message_new
mono_method_return_message_restore
mono_object_castclass_mbyref
mono_object_clone
mono_object_get_class
mono_object_get_domain
mono_object_get_virtual_method
mono_object_isinst
mono_object_isinst_mbyref
mono_object_new
mono_object_new_alloc_specific
mono_object_new_fast
mono_object_new_from_token
mono_object_new_specific
mono_object_unbox
mono_print_unhandled_exception
mono_property_get_value
mono_property_set_value
mono_raise_exception
mono_release_type_locks
mono_remote_class
mono_remote_class_vtable
mono_remoting_invoke
mono_runtime_class_init
mono_runtime_delegate_invoke
mono_runtime_exec_main
mono_runtime_exec_managed_code
mono_runtime_free_method
mono_runtime_get_main_args
mono_runtime_invoke
mono_runtime_invoke_array
mono_runtime_object_init
mono_runtime_run_main
mono_store_remote_field
mono_store_remote_field_new
mono_string_from_utf16
mono_string_intern
mono_string_is_interned
mono_string_new
mono_string_new_len
mono_string_new_size
mono_string_new_utf16
mono_string_new_wrapper
mono_string_to_utf16
mono_string_to_utf8
mono_type_initialization_init
mono_unhandled_exception
mono_upgrade_remote_class
mono_value_box
mono_wait_handle_new
-825
View File
@@ -1,825 +0,0 @@
dlfree
dlmalloc
dlmemalign
free_list_index_of
g_printerr
g_ptr_array_remove_fast
invoke_protected_memory_method
mini_debugger_init
mini_debugger_main
mini_debugger_set_attach_ok
mini_debug_running_inside_mdb
mini_emit_initobj
mini_emit_stobj
mono_add_internal_call
mono_aot_register_globals
mono_aot_register_module
mono_array_addr_with_size
mono_array_class_get
mono_array_clone
mono_array_element_size
mono_array_length
mono_array_new
mono_array_new_full
mono_array_new_specific
mono_assemblies_cleanup
mono_assembly_close
mono_assembly_get_image
mono_assembly_get_main
mono_assembly_get_object
mono_assembly_getrootdir
mono_assembly_load
mono_assembly_loaded
mono_assembly_loaded_full
mono_assembly_load_full
mono_assembly_name_free
mono_assembly_name_get_culture
mono_assembly_name_get_name
mono_assembly_name_get_pubkeytoken
mono_assembly_name_get_version
mono_assembly_name_new
mono_assembly_names_equal
mono_assembly_open
mono_bitset_alloc_size
mono_bitset_clear
mono_bitset_clear_all
mono_bitset_clone
mono_bitset_copyto
mono_bitset_count
mono_bitset_equal
mono_bitset_find_first
mono_bitset_find_first_unset
mono_bitset_find_last
mono_bitset_find_start
mono_bitset_foreach
mono_bitset_free
mono_bitset_intersection
mono_bitset_intersection_2
mono_bitset_invert
mono_bitset_mem_new
mono_bitset_new
mono_bitset_set
mono_bitset_set_all
mono_bitset_size
mono_bitset_sub
mono_bitset_test
mono_bitset_test_bulk
mono_bitset_union
mono_bounded_array_class_get
mono_breakpoint_clean_code
mono_check_corlib_version
mono_class_array_element_size
mono_class_data_size
mono_class_describe_statics
mono_class_enum_basetype
mono_class_from_generic_parameter
mono_class_from_mono_type
mono_class_from_name
mono_class_from_name_case
mono_class_from_typeref
mono_class_get
mono_class_get_byref_type
mono_class_get_element_class
mono_class_get_events
mono_class_get_event_token
mono_class_get_field
mono_class_get_field_from_name
mono_class_get_fields
mono_class_get_field_token
mono_class_get_flags
mono_class_get_full
mono_class_get_image
mono_class_get_interfaces
mono_class_get_method_from_name
mono_class_get_method_from_name_flags
mono_class_get_methods
mono_class_get_name
mono_class_get_namespace
mono_class_get_nested_types
mono_class_get_nesting_type
mono_class_get_parent
mono_class_get_properties
mono_class_get_property_from_name
mono_class_get_property_token
mono_class_get_rank
mono_class_get_type
mono_class_get_type_token
mono_class_inflate_generic_method
mono_class_inflate_generic_type
mono_class_init
mono_class_instance_size
mono_class_interface_offset
mono_class_is_assignable_from
mono_class_is_enum
mono_class_is_subclass_of
mono_class_is_valid_enum
mono_class_is_valuetype
mono_class_min_align
mono_class_name_from_token
mono_class_num_events
mono_class_num_fields
mono_class_num_methods
mono_class_num_properties
mono_class_value_size
mono_class_vtable
mono_cli_rva_image_map
mono_code_manager_commit
mono_code_manager_destroy
mono_code_manager_foreach
mono_code_manager_invalidate
mono_code_manager_new
mono_code_manager_new_dynamic
mono_code_manager_reserve
mono_code_manager_reserve_align
mono_code_manager_set_read_only
mono_code_manager_size
mono_compile_method
mono_config_for_assembly
mono_config_parse
mono_config_parse_memory
mono_config_string_for_assembly_file
mono_context_get
mono_context_get_desc
mono_context_set
mono_counters_cleanup
mono_counters_dump
mono_counters_enable
mono_counters_register
mono_custom_attrs_construct
mono_custom_attrs_free
mono_custom_attrs_from_assembly
mono_custom_attrs_from_class
mono_custom_attrs_from_event
mono_custom_attrs_from_field
mono_custom_attrs_from_index
mono_custom_attrs_from_method
mono_custom_attrs_from_param
mono_custom_attrs_from_property
mono_custom_attrs_get_attr
mono_custom_attrs_has_attr
mono_debug_add_method
_mono_debug_address_from_il_offset
mono_debug_close_image
mono_debug_close_mono_symbol_file
mono_debug_domain_create
mono_debug_domain_unload
mono_debug_find_method
mono_debug_free_source_location
mono_debugger_abort_runtime_invoke
mono_debugger_breakpoint_callback
mono_debugger_call_exception_handler
mono_debugger_check_breakpoints
mono_debugger_check_interruption
mono_debugger_check_runtime_version
mono_debugger_class_initialized
mono_debugger_event
mono_debugger_event_create_appdomain
mono_debugger_event_unload_appdomain
mono_debugger_extended_notification
mono_debugger_handle_exception
mono_debugger_insert_breakpoint
mono_debugger_insert_breakpoint_full
mono_debugger_insert_method_breakpoint
mono_debugger_lock
mono_debugger_method_has_breakpoint
MONO_DEBUGGER__notification_function
mono_debugger_register_class_init_callback
mono_debugger_remove_breakpoint
mono_debugger_remove_class_init_callback
mono_debugger_remove_method_breakpoint
mono_debugger_run_finally
mono_debugger_runtime_invoke
mono_debugger_thread_cleanup
mono_debugger_thread_created
_mono_debugger_throw_exception
mono_debugger_trampoline_compiled
_mono_debugger_unhandled_exception
mono_debugger_unlock
mono_debug_il_offset_from_address
mono_debug_list_add
mono_debug_list_remove
mono_debug_lookup_locals
mono_debug_lookup_method
mono_debug_lookup_method_addresses
mono_debug_lookup_source_location
mono_debug_open_image_from_memory
mono_debug_open_mono_symbols
mono_debug_print_stack_frame
mono_debug_print_vars
mono_debug_symfile_get_line_numbers
mono_debug_symfile_lookup_locals
mono_debug_symfile_lookup_location
mono_debug_symfile_lookup_method
mono_debug_using_mono_debugger
mono_declsec_flags_from_assembly
mono_declsec_flags_from_class
mono_declsec_flags_from_method
mono_declsec_get_assembly_action
mono_declsec_get_class_action
mono_declsec_get_demands
mono_declsec_get_inheritdemands_class
mono_declsec_get_inheritdemands_method
mono_declsec_get_linkdemands
mono_declsec_get_method_action
mono_digest_get_public_token
mono_disasm_code
mono_disasm_code_one
mono_dllmap_insert
mono_domain_assembly_open
mono_domain_create
mono_domain_create_appdomain
mono_domain_finalize
mono_domain_foreach
mono_domain_free
mono_domain_from_appdomain
mono_domain_get
mono_domain_get_by_id
mono_domain_get_id
mono_domain_has_type_resolve
mono_domain_is_unloading
mono_domain_owns_vtable_slot
mono_domain_set
mono_domain_set_internal
mono_domain_try_type_resolve
mono_domain_try_unload
mono_domain_unload
mono_emit_native_call
mono_environment_exitcode_get
mono_environment_exitcode_set
mono_error_cleanup
mono_error_get_error_code
mono_error_get_message
mono_error_init
mono_error_init_flags
mono_error_ok
mono_escape_uri_string
mono_event_get_add_method
mono_event_get_flags
mono_event_get_name
mono_event_get_object
mono_event_get_parent
mono_event_get_raise_method
mono_event_get_remove_method
mono_exception_from_name
mono_exception_from_name_domain
mono_exception_from_name_msg
mono_exception_from_name_two_strings
mono_exception_from_token
mono_exception_from_token_two_strings
mono_field_from_token
mono_field_full_name
mono_field_get_data
mono_field_get_flags
mono_field_get_name
mono_field_get_object
mono_field_get_offset
mono_field_get_parent
mono_field_get_type
mono_field_get_value
mono_field_get_value_object
mono_field_set_value
mono_field_static_get_value
mono_field_static_set_value
mono_file_map
mono_file_map_close
mono_file_map_fd
mono_file_map_open
mono_file_map_size
mono_file_unmap
mono_free
mono_free_bstr
mono_free_method
mono_free_verify_list
mono_gc_collect
mono_gc_collection_count
mono_gc_get_generation
mono_gc_get_heap_size
mono_gc_get_used_size
mono_gchandle_free
mono_gchandle_get_target
mono_gchandle_new
mono_gchandle_new_weakref
mono_gc_invoke_finalizers
mono_gc_max_generation
mono_gc_wbarrier_arrayref_copy
mono_gc_wbarrier_generic_nostore
mono_gc_wbarrier_generic_store
mono_gc_wbarrier_generic_store_atomic
mono_gc_wbarrier_object_copy
mono_gc_wbarrier_set_arrayref
mono_gc_wbarrier_set_field
mono_gc_wbarrier_value_copy
mono_get_array_class
mono_get_boolean_class
mono_get_byte_class
mono_get_char_class
mono_get_config_dir
mono_get_corlib
mono_get_dbnull_object
mono_get_delegate_invoke
mono_get_double_class
mono_get_enum_class
mono_get_exception_appdomain_unloaded
mono_get_exception_argument
mono_get_exception_argument_null
mono_get_exception_argument_out_of_range
mono_get_exception_arithmetic
mono_get_exception_array_type_mismatch
mono_get_exception_bad_image_format
mono_get_exception_bad_image_format2
mono_get_exception_cannot_unload_appdomain
mono_get_exception_class
mono_get_exception_divide_by_zero
mono_get_exception_execution_engine
mono_get_exception_field_access
mono_get_exception_file_not_found
mono_get_exception_file_not_found2
mono_get_exception_index_out_of_range
mono_get_exception_invalid_cast
mono_get_exception_invalid_operation
mono_get_exception_io
mono_get_exception_method_access
mono_get_exception_missing_field
mono_get_exception_missing_method
mono_get_exception_not_implemented
mono_get_exception_not_supported
mono_get_exception_null_reference
mono_get_exception_out_of_memory
mono_get_exception_overflow
mono_get_exception_reflection_type_load
mono_get_exception_security
mono_get_exception_serialization
mono_get_exception_stack_overflow
mono_get_exception_synchronization_lock
mono_get_exception_thread_abort
mono_get_exception_thread_interrupted
mono_get_exception_thread_state
mono_get_exception_type_initialization
mono_get_exception_type_load
mono_get_int16_class
mono_get_int32_class
mono_get_int64_class
mono_get_intptr_class
mono_get_machine_config
mono_get_method
mono_get_method_full
mono_get_object_class
mono_get_root_domain
mono_get_sbyte_class
mono_get_single_class
mono_get_string_class
mono_get_thread_class
mono_get_trampoline_func
mono_get_uint16_class
mono_get_uint32_class
mono_get_uint64_class
mono_get_uintptr_class
mono_get_void_class
mono_g_hash_table_destroy
mono_g_hash_table_find
mono_g_hash_table_foreach
mono_g_hash_table_foreach_remove
mono_g_hash_table_insert
mono_g_hash_table_lookup
mono_g_hash_table_lookup_extended
mono_g_hash_table_new
mono_g_hash_table_new_full
mono_g_hash_table_new_type
mono_g_hash_table_remove
mono_g_hash_table_replace
mono_g_hash_table_size
mono_guid_to_string
mono_hazard_pointer_get
mono_image_addref
mono_image_close
mono_image_ensure_section
mono_image_ensure_section_idx
mono_image_fixup_vtable
mono_image_get_assembly
mono_image_get_entry_point
mono_image_get_filename
mono_image_get_guid
mono_image_get_name
mono_image_get_public_key
mono_image_get_resource
mono_image_get_strong_name
mono_image_get_table_info
mono_image_get_table_rows
mono_image_has_authenticode_entry
mono_image_is_dynamic
mono_image_loaded
mono_image_loaded_by_guid
mono_image_loaded_by_guid_full
mono_image_loaded_full
mono_image_load_file_for_image
mono_image_lookup_resource
mono_image_open
mono_image_open_from_data
mono_image_open_from_data_full
mono_image_open_from_data_with_name
mono_image_open_full
mono_image_rva_map
mono_images_cleanup
mono_image_strerror
mono_image_strong_name_position
mono_init
mono_init_from_assembly
mono_init_version
mono_install_assembly_load_hook
mono_install_assembly_postload_refonly_search_hook
mono_install_assembly_postload_search_hook
mono_install_assembly_preload_hook
mono_install_assembly_refonly_preload_hook
mono_install_assembly_refonly_search_hook
mono_install_assembly_search_hook
mono_install_runtime_cleanup
mono_install_threadpool_item_hooks
mono_install_threadpool_thread_hooks
mono_inst_name
mono_is_debugger_attached
mono_jit_cleanup
mono_jit_exec
mono_jit_info_get_code_size
mono_jit_info_get_code_start
mono_jit_info_get_method
mono_jit_info_table_find
mono_jit_init
mono_jit_init_version
mono_jit_parse_options
mono_jit_set_aot_only
mono_jit_set_trace_options
mono_ldstr
mono_ldtoken
mono_llvm_build_aligned_load
mono_llvm_build_alloca
mono_llvm_build_load
mono_llvm_create_ee
mono_llvm_dispose_ee
mono_llvm_dump_value
mono_llvm_optimize_method
mono_llvm_replace_uses_of
mono_load_remote_field
mono_load_remote_field_new
mono_local_deadce
mono_locks_dump
mono_lookup_internal_call
mono_lookup_pinvoke_call
mono_main
mono_marshal_string_to_utf16
mono_md5_final
mono_md5_get_digest
mono_md5_get_digest_from_file
mono_md5_init
mono_md5_update
mono_mempool_alloc
mono_mempool_alloc0
mono_mempool_contains_addr
mono_mempool_destroy
mono_mempool_empty
mono_mempool_get_allocated
mono_mempool_invalidate
mono_mempool_new
mono_mempool_new_size
mono_mempool_stats
mono_mempool_strdup
mono_metadata_blob_heap
mono_metadata_cleanup
mono_metadata_compute_size
mono_metadata_custom_attrs_from_index
mono_metadata_declsec_from_index
mono_metadata_decode_blob_size
mono_metadata_decode_row
mono_metadata_decode_row_col
mono_metadata_decode_signed_value
mono_metadata_decode_table_row
mono_metadata_decode_table_row_col
mono_metadata_decode_value
mono_metadata_encode_value
mono_metadata_events_from_typedef
mono_metadata_field_info
mono_metadata_field_info_with_mempool
mono_metadata_free_array
mono_metadata_free_inflated_signature
mono_metadata_free_marshal_spec
mono_metadata_free_method_signature
mono_metadata_free_mh
mono_metadata_free_type
mono_metadata_generic_class_is_valuetype
mono_metadata_get_constant_index
mono_metadata_get_inflated_signature
mono_metadata_get_marshal_info
mono_metadata_guid_heap
mono_metadata_implmap_from_method
mono_metadata_interfaces_from_typedef
mono_metadata_load_generic_params
mono_metadata_locate
mono_metadata_locate_token
mono_metadata_methods_from_event
mono_metadata_methods_from_property
mono_metadata_nested_in_typedef
mono_metadata_nesting_typedef
mono_metadata_packing_from_typedef
mono_metadata_parse_array
mono_metadata_parse_custom_mod
mono_metadata_parse_field_type
mono_metadata_parse_marshal_spec
mono_metadata_parse_method_signature
mono_metadata_parse_method_signature_full
mono_metadata_parse_mh
mono_metadata_parse_mh_full
mono_metadata_parse_param
mono_metadata_parse_signature
mono_metadata_parse_type
mono_metadata_parse_typedef_or_ref
mono_metadata_parse_type_full
mono_metadata_properties_from_typedef
mono_metadata_signature_alloc
mono_metadata_signature_dup
mono_metadata_signature_equal
mono_metadata_string_heap
mono_metadata_token_from_dor
mono_metadata_translate_token_index
mono_metadata_typedef_from_field
mono_metadata_typedef_from_method
mono_metadata_type_equal
mono_metadata_type_hash
mono_metadata_user_string
mono_method_body_get_object
mono_method_can_access_field
mono_method_can_access_method
mono_method_desc_free
mono_method_desc_from_method
mono_method_desc_full_match
mono_method_desc_match
mono_method_desc_new
mono_method_desc_search_in_class
mono_method_desc_search_in_image
mono_method_full_name
mono_method_get_class
mono_method_get_flags
mono_method_get_generic_container
mono_method_get_header
mono_method_get_index
mono_method_get_last_managed
mono_method_get_marshal_info
mono_method_get_name
mono_method_get_object
mono_method_get_param_names
mono_method_get_param_token
mono_method_get_signature
mono_method_get_signature_full
mono_method_get_token
mono_method_get_unmanaged_thunk
mono_method_has_marshal_info
mono_method_header_get_clauses
mono_method_header_get_code
mono_method_header_get_locals
mono_method_header_get_num_clauses
mono_method_signature
mono_method_verify
mono_mlist_alloc
mono_mlist_append
mono_mlist_get_data
mono_mlist_last
mono_mlist_length
mono_mlist_next
mono_mlist_prepend
mono_mlist_remove_item
mono_mlist_set_data
mono_mlist_set_next
mono_module_file_get_object
mono_module_get_object
mono_monitor_enter
mono_monitor_exit
mono_monitor_try_enter
mono_mprotect
mono_object_castclass_mbyref
mono_object_clone
mono_object_describe
mono_object_describe_fields
mono_object_get_class
mono_object_get_domain
mono_object_get_size
mono_object_get_virtual_method
mono_object_isinst
mono_object_isinst_mbyref
mono_object_new
mono_object_new_alloc_specific
mono_object_new_fast
mono_object_new_from_token
mono_object_new_specific
mono_object_unbox
mono_opcode_name
mono_opcode_value
mono_op_to_op_imm_noemul
mono_pagesize
mono_param_get_objects
mono_parse_default_optimizations
mono_path_canonicalize
mono_path_resolve_symlinks
mono_pe_file_open
mono_perfcounters_init
mono_personality
mono_pmip
mono_print_method_from_ip
mono_print_thread_dump
mono_print_thread_dump_from_ctx
mono_print_unhandled_exception
mono_profiler_coverage_get
mono_profiler_get_events
mono_profiler_install
mono_profiler_install_allocation
mono_profiler_install_appdomain
mono_profiler_install_assembly
mono_profiler_install_class
mono_profiler_install_code_buffer_new
mono_profiler_install_code_chunk_destroy
mono_profiler_install_code_chunk_new
mono_profiler_install_coverage_filter
mono_profiler_install_enter_leave
mono_profiler_install_exception
mono_profiler_install_gc
mono_profiler_install_gc_moves
mono_profiler_install_iomap
mono_profiler_install_jit_compile
mono_profiler_install_jit_end
mono_profiler_install_method_free
mono_profiler_install_method_invoke
mono_profiler_install_module
mono_profiler_install_monitor
mono_profiler_install_runtime_initialized
mono_profiler_install_statistical
mono_profiler_install_statistical_call_chain
mono_profiler_install_thread
mono_profiler_install_transition
mono_profiler_load
mono_profiler_set_events
mono_property_get_flags
mono_property_get_get_method
mono_property_get_name
mono_property_get_object
mono_property_get_parent
mono_property_get_set_method
mono_property_get_value
mono_property_hash_destroy
mono_property_hash_insert
mono_property_hash_lookup
mono_property_hash_new
mono_property_hash_remove_object
mono_property_set_value
mono_ptr_class_get
mono_raise_exception
mono_reflection_free_type_info
mono_reflection_get_custom_attrs
mono_reflection_get_custom_attrs_blob
mono_reflection_get_custom_attrs_by_type
mono_reflection_get_custom_attrs_data
mono_reflection_get_custom_attrs_info
mono_reflection_get_token
mono_reflection_get_type
mono_reflection_parse_type
mono_reflection_type_from_name
mono_register_bundled_assemblies
mono_register_machine_config
mono_replace_ins
mono_runtime_class_init
mono_runtime_cleanup
mono_runtime_delegate_invoke
mono_runtime_exec_main
mono_runtime_exec_managed_code
mono_runtime_get_main_args
mono_runtime_init
mono_runtime_invoke
mono_runtime_invoke_array
mono_runtime_is_shutting_down
mono_runtime_object_init
mono_runtime_quit
mono_runtime_run_main
mono_security_core_clr_require_elevated_permissions
mono_security_enable_core_clr
mono_security_set_core_clr_platform_callback
mono_sem_post
mono_sem_timedwait
mono_sem_wait
mono_set_break_policy
mono_set_defaults
mono_set_dirs
mono_set_is_debugger_attached
mono_set_signal_chaining
mono_sha1_final
mono_sha1_get_digest
mono_sha1_get_digest_from_file
mono_sha1_init
mono_sha1_update
mono_signature_explicit_this
mono_signature_get_call_conv
mono_signature_get_desc
mono_signature_get_param_count
mono_signature_get_params
mono_signature_get_return_type
mono_signature_hash
mono_signature_is_instance
mono_signature_vararg_start
mono_signbit_double
mono_signbit_float
mono_stack_walk
mono_stack_walk_no_il
mono_store_remote_field
mono_store_remote_field_new
mono_string_chars
mono_string_equal
mono_string_from_bstr
mono_string_from_utf16
mono_string_hash
mono_stringify_assembly_name
mono_string_intern
mono_string_is_interned
mono_string_length
mono_string_new
mono_string_new_len
mono_string_new_size
mono_string_new_utf16
mono_string_new_wrapper
mono_string_to_utf16
mono_string_to_utf8
mono_table_info_get_rows
mono_thread_attach
mono_thread_cleanup
mono_thread_create
mono_thread_current
mono_thread_detach
mono_thread_exit
mono_thread_get_main
mono_thread_get_undeniable_exception
mono_thread_hazardous_free_or_queue
mono_thread_hazardous_try_free_all
mono_thread_manage
mono_thread_new_init
mono_thread_set_main
mono_thread_set_manage_callback
mono_threads_get_default_stacksize
mono_threads_install_cleanup
mono_threads_request_thread_dump
mono_threads_set_default_stacksize
mono_thread_stop
mono_trace_set_level_string
mono_trace_set_mask_string
mono_type_create_from_typespec
mono_type_full_name
mono_type_generic_inst_is_valuetype
mono_type_get_array_type
mono_type_get_class
mono_type_get_desc
mono_type_get_modifiers
mono_type_get_name
mono_type_get_object
mono_type_get_ptr_type
mono_type_get_signature
mono_type_get_type
mono_type_get_underlying_type
mono_type_is_byref
mono_type_is_pointer
mono_type_is_reference
mono_type_is_struct
mono_type_is_valid_enum_basetype
mono_type_is_void
mono_type_size
mono_type_stack_size
mono_type_to_unmanaged
mono_unhandled_exception
mono_unicode_from_external
mono_unicode_to_external
mono_upgrade_remote_class_wrapper
mono_utf8_from_external
mono_utf8_validate_and_len
mono_utf8_validate_and_len_with_bounds
mono_valloc
mono_value_box
mono_value_copy
mono_value_copy_array
mono_value_describe_fields
mono_verify_corlib
mono_vfree
mono_vtable_get_static_field_data
mono_walk_stack
mono_win32_compat_CopyMemory
mono_win32_compat_FillMemory
mono_win32_compat_MoveMemory
mono_win32_compat_ZeroMemory
_ZN20MonoJITMemoryManager11AllocateGOTEv
_ZN20MonoJITMemoryManager12allocateStubEPKN4llvm11GlobalValueEjj
_ZN20MonoJITMemoryManager13allocateSpaceEij
_ZN20MonoJITMemoryManager13SetDlsymTableEPv
_ZN20MonoJITMemoryManager14allocateGlobalEjj
_ZN20MonoJITMemoryManager15endFunctionBodyEPKN4llvm8FunctionEPhS4_
_ZN20MonoJITMemoryManager17endExceptionTableEPKN4llvm8FunctionEPhS4_S4_
_ZN20MonoJITMemoryManager17setMemoryWritableEv
_ZN20MonoJITMemoryManager17startFunctionBodyEPKN4llvm8FunctionERj
_ZN20MonoJITMemoryManager19setMemoryExecutableEv
_ZN20MonoJITMemoryManager19startExceptionTableEPKN4llvm8FunctionERj
_ZN20MonoJITMemoryManager24deallocateMemForFunctionEPKN4llvm8FunctionE
_ZN20MonoJITMemoryManagerC1Ev
_ZN20MonoJITMemoryManagerC2Ev
_ZN20MonoJITMemoryManagerD0Ev
_ZN20MonoJITMemoryManagerD1Ev
_ZN20MonoJITMemoryManagerD2Ev
+66 -7
View File
@@ -1,33 +1,75 @@
<h2>Assemblies</h2>
<p>Code in .NET and Mono is distributed in assemblies, there
are shipped typically in files with the extension .exe or
.dll, and they are files that extend
the <a href="https://en.wikipedia.org/wiki/Portable_Executable">Portable
Executable</a> file format to include the Common Intermediate
Language metadata and portable code.
<p>Assemblies are typically loaded either from a given file
path, or using an <a href="#assembly-name">Assembly Name</a>
to load them from the Global Assembly Cache.
<p>The Mono Assembly API contains method for dealing with
<a href="#assembly-name">assembly
names</a>, <a href="cil_assembly_load">loading assemblies</a>,
<a href="#working">accessing assembly
components</a>, <a href="#modules">modules</a> and
some <a href="#advanced">advanced</a> features.
<p>Assemblies contain one or
more images, the actual vessels for your code.
The <a href="mono-api-image.html">Image API</a> documents the
functions that operate on <code>MonoImage *</code>.
<h3>Synopsis</h3>
<div class="header">
<div class="mapi-header">
#include &lt;metadata/assembly.h&gt;
typedef struct _MonoImage MonoImage;
typedef struct _MonoAssembly MonoAssembly;
@API_IDX@
</div>
<a name="cil_assembly_load"/>
<a name="cil_assembly_load"/></a>
<h3>Assembly Loading</h3>
<h4><a name="api:mono_assembly_open">mono_assembly_open</a></h4>
<h4><a name="api:mono_assembly_close">mono_assembly_close</a></h4>
<h4><a name="api:mono_assembly_get_object">mono_assembly_get_object</a></h4>
<h4><a name="api:mono_assembly_load">mono_assembly_load</a></h4>
<h4><a name="api:mono_assembly_load_full">mono_assembly_load_full</a></h4>
<h4><a name="api:mono_assembly_loaded">mono_assembly_loaded</a></h4>
<h4><a name="api:mono_assembly_get_object">mono_assembly_get_object</a></h4>
<h4><a name="api:mono_assembly_load_from">mono_assembly_load_from</a></h4>
<h4><a name="api:mono_assembly_load_from_full">mono_assembly_load_from_full</a></h4>
<h4><a name="api:mono_assembly_load_with_partial_name">mono_assembly_load_with_partial_name</a></h4>
<h4><a name="api:mono_assembly_open">mono_assembly_open</a></h4>
<h4><a name="api:mono_assembly_open_full">mono_assembly_open_full</a></h4>
<h4><a name="api:mono_set_assemblies_path">mono_set_assemblies_path</a></h4>
<h4><a name="api:mono_set_rootdir">mono_set_rootdir</a></h4>
<a name="working"/>
<h3>Working with Assemblies</h3>
<h4><a name="api:mono_assembly_fill_assembly_name">mono_assembly_fill_assembly_name</a></h4>
<h4><a name="api:mono_assembly_foreach">mono_assembly_foreach</a></h4>
<h4><a name="api:mono_assembly_get_image">mono_assembly_get_image</a></h4>
<h4><a name="api:mono_assembly_get_main">mono_assembly_get_main</a></h4>
<h4><a name="api:mono_assembly_get_name">mono_assembly_get_name</a></h4>
<h4><a name="api:mono_assembly_getrootdir">mono_assembly_getrootdir</a></h4>
<h4><a name="api:mono_assembly_get_assemblyref">mono_assembly_get_assemblyref</a></h4>
<h4><a name="api:mono_assembly_loaded_full">mono_assembly_loaded_full</a></h4>
<h4><a name="api:mono_assembly_load_reference">mono_assembly_load_reference</a></h4>
<h4><a name="api:mono_assembly_load_references">mono_assembly_load_references</a></h4>
<h4><a name="api:mono_assembly_load_module">mono_assembly_load_module</a></h4>
<h4><a name="api:mono_assembly_invoke_load_hook">mono_assembly_invoke_load_hook</a></h4>
<h4><a name="api:mono_assembly_invoke_search_hook">mono_assembly_invoke_search_hook</a></h4>
<h4><a name="api:mono_assembly_set_main">mono_assembly_set_main</a></h4>
<h4><a name="api:mono_assembly_setrootdir">mono_assembly_setrootdir</a></h4>
<h4><a name="api:mono_register_config_for_assembly">mono_register_config_for_assembly</a></h4>
<h4><a name="api:mono_register_symfile_for_assembly">mono_register_symfile_for_assembly</a></h4>
<a name="assembly-name"></a>
<h3>Assembly Names</h3>
<p>The MonoAssemblyName contains the full identity of an
@@ -38,10 +80,16 @@ typedef struct _MonoAssembly MonoAssembly;
href="http://www.mono-project.com/monodoc/T:System.Reflection.AssemblyName">System.Reflection.AssemblyName</a>
managed type.
<h4><a name="api:mono_assembly_name_new">mono_assembly_name_new</a></h4>
<h4><a name="api:mono_assembly_name_get_name">mono_assembly_name_get_name</a></h4>
<h4><a name="api:mono_assembly_name_get_culture">mono_assembly_name_get_culture</a></h4>
<h4><a name="api:mono_assembly_name_get_version">mono_assembly_name_get_version</a></h4>
<h4><a name="api:mono_assembly_name_get_pubkeytoken">mono_assembly_name_get_pubkeytoken</a></h4>
<h4><a name="api:mono_assembly_name_free">mono_assembly_name_free</a></h4>
<h4><a name="api:mono_stringify_assembly_name">mono_stringify_assembly_name</a></h4>
<h4><a name="api:mono_assembly_names_equal">mono_assembly_names_equal</a></h4>
<a href="modules"/>
<h3>Modules</h3>
<p>An assembly is made up of one or more modules.
@@ -49,3 +97,14 @@ typedef struct _MonoAssembly MonoAssembly;
<h4><a name="api:mono_module_file_get_object">mono_module_file_get_object</a></h4>
<h4><a name="api:mono_module_get_object">mono_module_get_object</a></h4>
<a href="advanced"/>
<h3>Advanced</h3>
<h4><a name="api:mono_install_assembly_load_hook">mono_install_assembly_load_hook</a></h4>
<h4><a name="api:mono_install_assembly_search_hook">mono_install_assembly_search_hook</a></h4>
<h4><a name="api:mono_install_assembly_refonly_search_hook">mono_install_assembly_refonly_search_hook</a></h4>
<h4><a name="api:mono_install_assembly_preload_hook">mono_install_assembly_preload_hook</a></h4>
<h4><a name="api:mono_install_assembly_refonly_preload_hook">mono_install_assembly_refonly_preload_hook</a></h4>
<h4><a name="api:mono_install_assembly_postload_search_hook">mono_install_assembly_postload_search_hook</a></h4>
<h4><a name="api:mono_install_assembly_postload_refonly_search_hook">mono_install_assembly_postload_refonly_search_hook</a></h4>
+71 -15
View File
@@ -1,52 +1,108 @@
<h2>Class Operations</h2>
<p>The operations on <code>MonoClass*</code> allow you to
query a number of properties of a .NET class from the C API.
<p>This page contains information
for <a href="#class-getting">how to obtain a MonoClass*</a>,
how to <a href="#class-work">probe for different
features of a MonoClass*</a> and APIs
to <a href="#class-members">access class members</a> and
<a href="#class-fields">access fields</a>. To access
methods, see the <a href="mono-api-methods.html">method
documentation API</a>.
<a name="class-getting"></a>
<h3>Getting a MonoClass</h3>
<p>You typically would obtain a <code>MonoClass*</code>
pointer by using a combination of the <code>MonoImage*</code>
where the type is located, the namespace and name using the
<code><a href="api:mono_class_from_name">mono_class_from_name</a></code>
or
the <code><a href="api:mono_class_from_name_case">mono_class_from_name_case</a></code>
APIs or by using
the <code><a href="api:mono_class_from_typeref">mono_class_from_typeref</a></code>
or <code><a href="api:mono_class_from_typeref">mono_class_from_typeref_checked</a></code>
methods.
<p>For low-level access, you can get the <code>MonoClass
*</code> from an image and an ECMA type token relative to
the <code>MonoImage*</code> by using <a href="api:mono_class_get">mono_class_get</a>.
<h4><a name="api:mono_class_get">mono_class_get</a></h4>
<h4><a name="api:mono_class_from_mono_type">mono_class_from_mono_type</a></h4>
<h4><a name="api:mono_class_from_name">mono_class_from_name</a></h4>
<h4><a name="api:mono_class_from_name_case">mono_class_from_name_case</a></h4>
<h4><a name="api:mono_class_from_typeref">mono_class_from_typeref</a></h4>
<h4><a name="api:mono_class_from_typeref_checked">mono_class_from_typeref_checked</a></h4>
<h4><a name="api:mono_class_from_generic_parameter">mono_class_from_generic_parameter</a></h4>
<h3>Working with a MonoClass</h3>
<h4><a name="api:mono_class_array_element_size">mono_class_array_element_size</a></h4>
<h4><a name="api:mono_class_data_size">mono_class_data_size</a></h4>
<h4><a name="api:mono_class_enum_basetype">mono_class_enum_basetype</a></h4>
<h4><a name="api:mono_class_from_generic_parameter">mono_class_from_generic_parameter</a></h4>
<h4><a name="api:mono_class_from_mono_type">mono_class_from_mono_type</a></h4>
<h4><a name="api:mono_class_from_name_case">mono_class_from_name_case</a></h4>
<h4><a name="api:mono_class_from_name">mono_class_from_name</a></h4>
<h4><a name="api:mono_class_from_typeref">mono_class_from_typeref</a></h4>
<h4><a name="api:mono_class_get_byref_type">mono_class_get_byref_type</a></h4>
<h4><a name="api:mono_class_get_element_class">mono_class_get_element_class</a></h4>
<h4><a name="api:mono_class_get_events">mono_class_get_events</a></h4>
<h4><a name="api:mono_class_get_event_token">mono_class_get_event_token</a></h4>
<h4><a name="api:mono_class_get_field_from_name">mono_class_get_field_from_name</a></h4>
<h4><a name="api:mono_class_get_field">mono_class_get_field</a></h4>
<h4><a name="api:mono_class_get_fields">mono_class_get_fields</a></h4>
<h4><a name="api:mono_class_get_field_token">mono_class_get_field_token</a></h4>
<h4><a name="api:mono_class_get_flags">mono_class_get_flags</a></h4>
<h4><a name="api:mono_class_get_full">mono_class_get_full</a></h4>
<h4><a name="api:mono_class_get_image">mono_class_get_image</a></h4>
<h4><a name="api:mono_class_get_interfaces">mono_class_get_interfaces</a></h4>
<h4><a name="api:mono_class_get_method_from_name">mono_class_get_method_from_name</a></h4>
<h4><a name="api:mono_class_get_methods">mono_class_get_methods</a></h4>
<h4><a name="api:mono_class_get">mono_class_get</a></h4>
<h4><a name="api:mono_class_get_name">mono_class_get_name</a></h4>
<h4><a name="api:mono_class_get_namespace">mono_class_get_namespace</a></h4>
<h4><a name="api:mono_class_get_nested_types">mono_class_get_nested_types</a></h4>
<h4><a name="api:mono_class_get_nesting_type">mono_class_get_nesting_type</a></h4>
<h4><a name="api:mono_class_get_parent">mono_class_get_parent</a></h4>
<h4><a name="api:mono_class_get_properties">mono_class_get_properties</a></h4>
<h4><a name="api:mono_class_get_property_from_name">mono_class_get_property_from_name</a></h4>
<h4><a name="api:mono_class_get_property_token">mono_class_get_property_token</a></h4>
<h4><a name="api:mono_class_get_rank">mono_class_get_rank</a></h4>
<h4><a name="api:mono_class_get_type">mono_class_get_type</a></h4>
<h4><a name="api:mono_class_get_type_token">mono_class_get_type_token</a></h4>
<h4><a name="api:mono_class_implements_interface">mono_class_implements_interface</a></h4>
<h4><a name="api:mono_class_inflate_generic_method">mono_class_inflate_generic_method</a></h4>
<h4><a name="api:mono_class_inflate_generic_type">mono_class_inflate_generic_type</a></h4>
<h4><a name="api:mono_class_init">mono_class_init</a></h4>
<h4><a name="api:mono_class_instance_size">mono_class_instance_size</a></h4>
<h4><a name="api:mono_class_is_assignable_from">mono_class_is_assignable_from</a></h4>
<h4><a name="api:mono_class_is_delegate">mono_class_is_delegate</a></h4>
<h4><a name="api:mono_class_is_enum">mono_class_is_enum</a></h4>
<h4><a name="api:mono_class_is_subclass_of">mono_class_is_subclass_of</a></h4>
<h4><a name="api:mono_class_is_valuetype">mono_class_is_valuetype</a></h4>
<h4><a name="api:mono_class_min_align">mono_class_min_align</a></h4>
<h4><a name="api:mono_class_name_from_token">mono_class_name_from_token</a></h4>
<h4><a name="api:mono_class_num_events">mono_class_num_events</a></h4>
<h4><a name="api:mono_class_num_fields">mono_class_num_fields</a></h4>
<h4><a name="api:mono_class_num_methods">mono_class_num_methods</a></h4>
<h4><a name="api:mono_class_num_properties">mono_class_num_properties</a></h4>
<h4><a name="api:mono_class_value_size">mono_class_value_size</a></h4>
<h4><a name="api:mono_class_vtable">mono_class_vtable</a></h4>
<a name="class-members"></a>
<h3>Getting Class Members</h3>
<h4><a name="api:mono_class_get_fields">mono_class_get_fields</a></h4>
<h4><a name="api:mono_class_get_field_from_name">mono_class_get_field_from_name</a></h4>
<h4><a name="api:mono_class_get_methods">mono_class_get_methods</a></h4>
<h4><a name="api:mono_class_get_method_from_name">mono_class_get_method_from_name</a></h4>
<h4><a name="api:mono_class_get_method_from_name_flags">mono_class_get_method_from_name_flags</a></h4>
<h4><a name="api:mono_class_name_from_token">mono_class_name_from_token</a></h4>
<h4><a name="api:mono_class_get_nested_types">mono_class_get_nested_types</a></h4>
<h4><a name="api:mono_class_get_properties">mono_class_get_properties</a></h4>
<h4><a name="api:mono_class_get_property_from_name">mono_class_get_property_from_name</a></h4>
<h4><a name="api:mono_class_get_events">mono_class_get_events</a></h4>
<a name="class-fields"></a>
<h3>Fields</h3>
<h4><a name="api:mono_field_get_data">mono_field_get_data</a></h4>
<h4><a name="api:mono_field_get_offset">mono_field_get_offset</a></h4>
<h4><a name="api:mono_field_full_name">mono_field_full_name</a></h4>
<h3>Method Accessibility</h3>
<h4><a name="api:mono_method_can_access_field">mono_method_can_access_field</a></h4>
<h4><a name="api:mono_method_can_access_method">mono_method_can_access_method</a></h4>
<p>
-10
View File
@@ -1,10 +0,0 @@
<h3>Code manager</h3>
<h4><a name="api:mono_code_manager_commit">mono_code_manager_commit</a></h4>
<h4><a name="api:mono_code_manager_destroy">mono_code_manager_destroy</a></h4>
<h4><a name="api:mono_code_manager_foreach">mono_code_manager_foreach</a></h4>
<h4><a name="api:mono_code_manager_invalidate">mono_code_manager_invalidate</a></h4>
<h4><a name="api:mono_code_manager_new_dynamic">mono_code_manager_new_dynamic</a></h4>
<h4><a name="api:mono_code_manager_new">mono_code_manager_new</a></h4>
<h4><a name="api:mono_code_manager_reserve">mono_code_manager_reserve</a></h4>
+30 -15
View File
@@ -1,23 +1,38 @@
<h4><a name="api:mono_debug_il_offset_from_address">mono_debug_il_offset_from_address</a></h4>
<h4><a name="api:mono_debug_add_method">mono_debug_add_method</a></h4>
<h4><a name="api:mono_debug_close_mono_symbol_file">mono_debug_close_mono_symbol_file</a></h4>
<h4><a name="api:mono_debug_find_method">mono_debug_find_method</a></h4>
<h4><a name="api:mono_debug_using_mono_debugger">mono_debug_using_mono_debugger</a></h4>
<h3>Mono Debugger Interface</h3>
<p>These are methods that are invoked by the debugger at
runtime.
<h4><a name="api:mono_debugger_breakpoint_callback">mono_debugger_breakpoint_callback</a></h4>
<h4><a name="api:mono_debugger_check_runtime_version">mono_debugger_check_runtime_version</a></h4>
<h4><a name="api:mono_debugger_event">mono_debugger_event</a></h4>
<h4><a name="api:mono_debugger_handle_exception">mono_debugger_handle_exception</a></h4>
<h4><a name="api:mono_debugger_insert_breakpoint_full">mono_debugger_insert_breakpoint_full</a></h4>
<h4><a name="api:mono_debugger_insert_breakpoint">mono_debugger_insert_breakpoint</a></h4>
<h4><a name="api:mono_debugger_lock">mono_debugger_lock</a></h4>
<h4><a name="api:mono_debugger_method_has_breakpoint">mono_debugger_method_has_breakpoint</a></h4>
<h4><a name="api:mono_debugger_remove_breakpoint">mono_debugger_remove_breakpoint</a></h4>
<h4><a name="api:mono_debugger_runtime_invoke">mono_debugger_runtime_invoke</a></h4>
<h4><a name="api:mono_debugger_unlock">mono_debugger_unlock</a></h4>
<h4><a name="api:mono_debugger_run_finally">mono_debugger_run_finally</a></h4>
<h3>Debugging Symbols</h3>
<h4><a name="api:mono_debug_open_mono_symbols">mono_debug_open_mono_symbols</a></h4>
<h4><a name="api:mono_debug_symfile_free_location">mono_debug_symfile_free_location</a></h4>
<h4><a name="api:mono_debug_symfile_is_loaded">mono_debug_symfile_is_loaded</a></h4>
<h4><a name="api:mono_debug_symfile_lookup_locals">mono_debug_symfile_lookup_locals</a></h4>
<h4><a name="api:mono_debug_symfile_lookup_location">mono_debug_symfile_lookup_location</a></h4>
<h4><a name="api:mono_debug_symfile_lookup_method">mono_debug_symfile_lookup_method</a></h4>
<h3>Internal Debugging </h3>
<h4><a name="api:mono_debug_add_delegate_trampoline">mono_debug_add_delegate_trampoline</a></h4>
<h4><a name="api:mono_debug_close_image">mono_debug_close_image</a></h4>
<h4><a name="api:mono_debug_domain_create">mono_debug_domain_create</a></h4>
<h4><a name="api:mono_debug_domain_unload">mono_debug_domain_unload</a></h4>
<h4><a name="api:mono_debug_enabled">mono_debug_enabled</a></h4>
<h4><a name="api:mono_debug_free_method_jit_info">mono_debug_free_method_jit_info</a></h4>
<h4><a name="api:mono_debug_free_source_location">mono_debug_free_source_location</a></h4>
<h4><a name="api:mono_debug_lookup_locals">mono_debug_lookup_locals</a></h4>
<h4><a name="api:mono_debug_lookup_method">mono_debug_lookup_method</a></h4>
<h4><a name="api:mono_debug_lookup_method_addresses">mono_debug_lookup_method_addresses</a></h4>
<h4><a name="api:mono_debug_lookup_source_location">mono_debug_lookup_source_location</a></h4>
<h4><a name="api:mono_debug_open_image_from_memory">mono_debug_open_image_from_memory</a></h4>
<h4><a name="api:mono_debug_print_stack_frame">mono_debug_print_stack_frame</a></h4>
<h4><a name="api:mono_debug_remove_method">mono_debug_remove_method</a></h4>
<h4><a name="api:mono_debug_il_offset_from_address">mono_debug_il_offset_from_address</a></h4>
<h4><a name="api:mono_debug_add_method">mono_debug_add_method</a></h4>
<h4><a name="api:mono_debug_close_mono_symbol_file">mono_debug_close_mono_symbol_file</a></h4>
<h4><a name="api:mono_debug_find_method">mono_debug_find_method</a></h4>
-19
View File
@@ -1,19 +0,0 @@
<h1>Decimal Support</h1>
<p>You can use the mono_decimal functions to access and
manipulate <tt>System.Decimal</tt> types from C.
<h4><a name="api:mono_decimal2double">mono_decimal2double</a></h4>
<h4><a name="api:mono_decimal2Int64">mono_decimal2Int64</a></h4>
<h4><a name="api:mono_decimal2string">mono_decimal2string</a></h4>
<h4><a name="api:mono_decimal2UInt64">mono_decimal2UInt64</a></h4>
<h4><a name="api:mono_decimalCompare">mono_decimalCompare</a></h4>
<h4><a name="api:mono_decimalDiv">mono_decimalDiv</a></h4>
<h4><a name="api:mono_decimalFloorAndTrunc">mono_decimalFloorAndTrunc</a></h4>
<h4><a name="api:mono_decimalIncr">mono_decimalIncr</a></h4>
<h4><a name="api:mono_decimalIntDiv">mono_decimalIntDiv</a></h4>
<h4><a name="api:mono_decimalMult">mono_decimalMult</a></h4>
<h4><a name="api:mono_decimalRound">mono_decimalRound</a></h4>
<h4><a name="api:mono_decimalSetExponent">mono_decimalSetExponent</a></h4>
<h4><a name="api:mono_double2decimal">mono_double2decimal</a></h4>
<h4><a name="api:mono_string2decimal">mono_string2decimal</a></h4>
+12 -3
View File
@@ -2,7 +2,7 @@
<h3>Synopsis</h3>
<div class="header">
<div class="mapi-header">
#include &lt;metadata/appdomain.h&gt;
/* Managed AppDomain */
@@ -34,21 +34,30 @@ typedef struct _MonoAppContext MonoAppContext
<h4><a name="api:mono_domain_assembly_open">mono_domain_assembly_open</a></h4>
<h4><a name="api:mono_domain_create">mono_domain_create</a></h4>
<h4><a name="api:mono_domain_create_appdomain">mono_domain_create_appdomain</a></h4>
<h4><a name="api:mono_domain_finalize">mono_domain_finalize</a></h4>
<h4><a name="api:mono_domain_foreach">mono_domain_foreach</a></h4>
<h4><a name="api:mono_domain_free">mono_domain_free</a></h4>
<h4><a name="api:mono_domain_from_appdomain">mono_domain_from_appdomain</a></h4>
<h4><a name="api:mono_domain_get_by_id">mono_domain_get_by_id</a></h4>
<h4><a name="api:mono_domain_get_friendly_name">mono_domain_get_friendly_name</a></h4>
<h4><a name="api:mono_domain_get_id">mono_domain_get_id</a></h4>
<h4><a name="api:mono_domain_get">mono_domain_get</a></h4>
<h4><a name="api:mono_domain_has_type_resolve">mono_domain_has_type_resolve</a></h4>
<h4><a name="api:mono_domain_is_unloading">mono_domain_is_unloading</a></h4>
<h4><a name="api:mono_domain_owns_vtable_slot">mono_domain_owns_vtable_slot</a></h4>
<h4><a name="api:mono_domain_set_config">mono_domain_set_config</a></h4>
<h4><a name="api:mono_domain_set_internal">mono_domain_set_internal</a></h4>
<h4><a name="api:mono_domain_set">mono_domain_set</a></h4>
<h4><a name="api:mono_domain_try_type_resolve">mono_domain_try_type_resolve</a></h4>
<h4><a name="api:mono_domain_owns_vtable_slot">mono_domain_owns_vtable_slot</a></h4>
<h4><a name="api:mono_domain_try_unload">mono_domain_try_unload</a></h4>
<h4><a name="api:mono_domain_unload">mono_domain_unload</a></h4>
<h3>Contexts</h3>
<h4><a name="api:mono_context_init">mono_context_init</a></h4>
<h4><a name="api:mono_context_get">mono_context_get</a></h4>
<h4><a name="api:mono_context_get_domain_id">mono_context_get_domain_id</a></h4>
<h4><a name="api:mono_context_get_id">mono_context_get_id</a></h4>
<h4><a name="api:mono_context_set">mono_context_set</a></h4>
<h4><a name="api:mono_context_get_desc">mono_context_get_desc</a></h4>
+1 -1
View File
@@ -1,4 +1,4 @@
<h2>Dynamic Code Generation</h2>
<h2>Internal: Dynamic Code Generation</h2>
<p>The dynamic code generation interface inside the Mono
runtime is similar to the API exposed by
+34 -14
View File
@@ -1,5 +1,18 @@
<h2>Embedding Mono</h2>
<p>The Mono runtime can be embedded into C and C++
applications. Your C/C++ code can invoke managed code
running in the Mono/.NET world and you can also surface your
internal application APIs to Mono and .NET.
<p>For an overview of how to embed Mono into your application
and the strategies that you can use to embed Mono, check the
Mono
website's <a href="http://www.mono-project.com/docs/advanced/embedding/">Embedding
Mono</a> page.
<p>This page is the companion API reference for the above guide.
<p>The simplest way of embedding Mono is illustrated here:
<pre>
int main (int argc, char *argv)
@@ -48,13 +61,14 @@ getMessage ()
</pre>
<h4><a name="api:mono_jit_init">mono_jit_init</a></h4>
<h4><a name="api:mono_jit_parse_options">mono_jit_parse_options</a></h4>
<h4><a name="api:mono_jit_exec">mono_jit_exec</a></h4>
<h4><a name="api:mono_set_dirs">mono_set_dirs</a></h4>
<h4><a name="api:mono_main">mono_main</a></h4>
<h4><a name="api:mono_parse_default_optimizations">mono_parse_default_optimizations</a></h4>
<h4><a name="api:mono_runtime_set_main_args">mono_runtime_set_main_args</a></h4>
<h4><a name="api:mono_jit_cleanup">mono_jit_cleanup</a></h4>
<h4><a name="api:mono_set_defaults">mono_set_defaults</a></h4>
<h4><a name="api:mono_jit_set_trace_options">mono_jit_set_trace_options</a></h4>
<h3>Internal Calls</h3>
@@ -141,19 +155,16 @@ getMessage ()
<p>The following APIs expose this functionality:
<h4><a name="api:mono_config_cleanup">mono_config_cleanup</a></h4>
<h4><a name="api:mono_config_is_server_mode">mono_config_is_server_mode</a></h4>
<h4><a name="api:mono_config_parse">mono_config_parse</a></h4>
<h4><a name="api:mono_config_parse_memory">mono_config_parse_memory</a></h4>
<h4><a name="api:mono_config_set_server_mode">mono_config_set_server_mode</a></h4>
<h4><a name="api:mono_config_string_for_assembly_file">mono_config_string_for_assembly_file</a></h4>
<h4><a name="api:mono_get_config_dir">mono_get_config_dir</a></h4>
<h3>Function Pointers</h3>
<p>To wrap a function pointer into something that the Mono
runtime can consume, you should use the mono_create_ftnptr.
This is only important if you plan on running on the IA64
architecture. Otherwise you can just use the function
pointer address.
<h4><a name="api:mono_create_ftnptr">mono_create_ftnptr</a></h4>
<h4><a name="api:mono_get_machine_config">mono_get_machine_config</a></h4>
<h4><a name="api:mono_register_machine_config">mono_register_machine_config</a></h4>
<h4><a name="api:mono_set_config_dir">mono_set_config_dir</a></h4>
<h3>Advanced Execution Setups</h3>
@@ -163,6 +174,15 @@ getMessage ()
<h4><a name="api:mono_runtime_exec_managed_code">mono_runtime_exec_managed_code</a></h4>
<h4><a name="api:mono_runtime_exec_main">mono_runtime_exec_main</a></h4>
<h4><a name="api:mono_init_from_assembly">mono_init_from_assembly</a></h4>
<h4><a name="api:mono_init">mono_init</a></h4>
<h4><a name="api:mono_init_from_assembly">mono_init_from_assembly</a></h4>
<h4><a name="api:mono_init_version">mono_init_version</a></h4>
<h4><a name="api:mono_jit_exec">mono_jit_exec</a></h4>
<h4><a name="api:mono_jit_set_aot_mode">mono_jit_set_aot_mode</a></h4>
<h4><a name="api:mono_set_break_policy">mono_set_break_policy</a></h4>
<h4><a name="api:mono_get_runtime_build_info">mono_get_runtime_build_info</a></h4>
<h3>Signal Chaining</h3>
<h4><a name="api:mono_set_signal_chaining">mono_set_signal_chaining</a></h4>
<h4><a name="api:mono_set_crash_chaining">mono_set_crash_chaining</a></h4>
+28 -4
View File
@@ -1,16 +1,32 @@
<h2>Exception Handling</h2>
<div class="header">
@API_IDX@
</div>
<p>Mono's exception handling contains methods
to <a href="#creating">create `MonoException*` objects</a>
that can be <a href="api:mono_raise_exception">raised</a>.
<p>Alternatively, you can obtain an exception that you can
raise from some of the most <a href="#common">common</a>
exceptions in the .NET Runtime.
<h3>Raising and Catching exceptions</h3>
<p>If you plan on running your code in Mono's Cooperative mode
for the Garbage Collector (for example, if you are using pure
Bitcode code generation), it you should avoid raising an
exception from any method that is not the entry point to the
internal call.
<p>It is recommended that if you need to raise an error
condition from nested parts of your code, surface this error
to the topmost method that is surfaced as an internal call and
raise the exception there.
<h4><a name="api:mono_raise_exception">mono_raise_exception</a></h4>
<h4><a name="api:mono_unhandled_exception">mono_unhandled_exception</a></h4>
<h4><a name="api:mono_print_unhandled_exception">mono_print_unhandled_exception</a></h4>
<a name="creating"/>
<h3>Exception Types: General API</h3>
<h4><a name="api:mono_exception_from_name_domain">mono_exception_from_name_domain</a></h4>
@@ -18,6 +34,7 @@
<h4><a name="api:mono_exception_from_name_msg">mono_exception_from_name_msg</a></h4>
<h4><a name="api:mono_exception_from_name_two_strings">mono_exception_from_name_two_strings</a></h4>
<a name="common"/>
<h3>Obtaining Common Exceptions</h3>
<p>There are a number of common exceptions that are used by
@@ -56,3 +73,10 @@
<h4><a name="api:mono_get_exception_missing_field">mono_get_exception_missing_field</a></h4>
<h4><a name="api:mono_get_exception_not_supported">mono_get_exception_not_supported</a></h4>
<h4><a name="api:mono_get_exception_reflection_type_load">mono_get_exception_reflection_type_load</a></h4>
<h4><a name="api:mono_exception_from_token_two_strings">mono_exception_from_token_two_strings</a></h4>
<h4><a name="api:mono_get_exception_bad_image_format2">mono_get_exception_bad_image_format2</a></h4>
<h4><a name="api:mono_get_exception_field_access">mono_get_exception_field_access</a></h4>
<h4><a name="api:mono_get_exception_method_access">mono_get_exception_method_access</a></h4>
<h4><a name="api:mono_get_exception_out_of_memory">mono_get_exception_out_of_memory</a></h4>
<h4><a name="api:mono_get_exception_runtime_wrapped">mono_get_exception_runtime_wrapped</a></h4>
<h4><a name="api:mono_get_exception_thread_interrupted">mono_get_exception_thread_interrupted</a></h4>
+109 -1
View File
@@ -4,9 +4,117 @@
<p>The public interface of the Mono GC is fairly limited, and
its the only one that embedders should be using:
<h3>Garbage Collector</h3>
<h4><a name="api:mono_gc_collect">mono_gc_collect</a></h4>
<h4><a name="api:mono_gc_collection_count">mono_gc_collection_count</a></h4>
<h4><a name="api:mono_gc_max_generation">mono_gc_max_generation</a></h4>
<h4><a name="api:mono_gc_get_generation">mono_gc_get_generation</a></h4>
<h4><a name="api:mono_gc_get_heap_size">mono_gc_get_heap_size</a></h4>
<h4><a name="api:mono_gc_get_used_size">mono_gc_get_used_size</a></h4>
<h4><a name="api:mono_gc_walk_heap">mono_gc_walk_heap</a></h4>
<h3>Reference Queues</h3>
<h4><a name="api:mono_gc_reference_queue_add">mono_gc_reference_queue_add</a></h4>
<h4><a name="api:mono_gc_reference_queue_free">mono_gc_reference_queue_free</a></h4>
<h4><a name="api:mono_gc_reference_queue_new">mono_gc_reference_queue_new</a></h4>
<h3>SGen Bridge</h3>
<p>The bridge is a mechanism for SGen to let clients override
the death of some unreachable objects. We use it in monodroid
to do garbage collection across the Mono and Java heaps.
<p>The client can designate some objects as "bridged", which
means that they participate in the bridge processing step once
SGen considers them unreachable, i.e., dead. Bridged objects
must be registered for finalization.
<p>When SGen is done marking, it puts together a list of all
dead bridged objects and then does a strongly connected
component analysis over their object graph. That graph will
usually contain non-bridged objects, too.
<p>The output of the SCC analysis is passed to the
`cross_references()` callback. It is expected to set the
`is_alive` flag on those strongly connected components that it
wishes to be kept alive. The value of `is_alive` will be
ignored on any SCCs which lack bridges.
<p>In monodroid each bridged object has a corresponding Java
mirror object. In the bridge callback it reifies the Mono
object graph in the Java heap so that the full, combined
object graph is now instantiated on the Java side. Then it
triggers a Java GC, waits for it to finish, and checks which
of the Java mirror objects are still alive. For those it sets
the `is_alive` flag and returns from the callback.
<p>The SCC analysis is done while the world is stopped, but
the callback is made with the world running again. Weak links
to bridged objects and other objects reachable from them are
kept until the callback returns, at which point all links to
bridged objects that don't have `is_alive` set are nulled.
Note that weak links to non-bridged objects reachable from
bridged objects are not nulled. This might be considered a
bug.
<div class="mapi-header">
enum {
SGEN_BRIDGE_VERSION = 5
};
typedef enum {
/* Instances of this class should be scanned when computing the transitive dependency among bridges. E.g. List of object*/
GC_BRIDGE_TRANSPARENT_CLASS,
/* Instances of this class should not be scanned when computing the transitive dependency among bridges. E.g. String*/
GC_BRIDGE_OPAQUE_CLASS,
/* Instances of this class should be bridged and have their dependency computed. */
GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS,
/* Instances of this class should be bridged but no dependencies should not be calculated. */
GC_BRIDGE_OPAQUE_BRIDGE_CLASS,
} MonoGCBridgeObjectKind;
typedef struct {
mono_bool is_alive; /* to be set by the cross reference callback */
int num_objs;
MonoObject *objs [MONO_ZERO_LEN_ARRAY];
} MonoGCBridgeSCC;
typedef struct {
int src_scc_index;
int dst_scc_index;
} MonoGCBridgeXRef;
typedef struct {
int bridge_version;
/*
* Tells the runtime which classes to even consider when looking for
* bridged objects. If subclasses are to be considered as well, the
* subclass check must be done in the callback.
*/
MonoGCBridgeObjectKind (*bridge_class_kind) (MonoClass *klass);
/*
* This is only called on objects for whose classes
* `bridge_class_kind()` returned `XXX_BRIDGE_CLASS`.
*/
mono_bool (*is_bridge_object) (MonoObject *object);
void (*cross_references) (int num_sccs, MonoGCBridgeSCC **sccs, int num_xrefs, MonoGCBridgeXRef *xrefs);
} MonoGCBridgeCallbacks;
</div>
<h4><a name="api:mono_gc_register_bridge_callbacks">mono_gc_register_bridge_callbacks</a></h4>
<h4><a name="api:mono_gc_wait_for_bridge_processing">mono_gc_wait_for_bridge_processing</a></h4>
<h3>Write Barriers</h3>
<h4><a name="api:mono_gc_wbarrier_arrayref_copy">mono_gc_wbarrier_arrayref_copy</a></h4>
<h4><a name="api:mono_gc_wbarrier_generic_nostore">mono_gc_wbarrier_generic_nostore</a></h4>
<h4><a name="api:mono_gc_wbarrier_generic_store">mono_gc_wbarrier_generic_store</a></h4>
<h4><a name="api:mono_gc_wbarrier_generic_store_atomic">mono_gc_wbarrier_generic_store_atomic</a></h4>
<h4><a name="api:mono_gc_wbarrier_object_copy">mono_gc_wbarrier_object_copy</a></h4>
<h4><a name="api:mono_gc_wbarrier_set_arrayref">mono_gc_wbarrier_set_arrayref</a></h4>
<h4><a name="api:mono_gc_wbarrier_set_field">mono_gc_wbarrier_set_field</a></h4>
<h4><a name="api:mono_gc_wbarrier_value_copy">mono_gc_wbarrier_value_copy</a></h4>
+26 -25
View File
@@ -2,7 +2,7 @@
<h3>Synopsys</h3>
<div class="header">
<div class="mapi-header">
@API_IDX@
</div>
@@ -31,7 +31,8 @@
<tt>mono_gchandle_get_target</tt>.
<p>For example, consider the following C code:
<div class="code">
<div class="mapi-code">
static MonoObject* o = NULL;
</div>
@@ -41,22 +42,22 @@ static MonoObject* o = NULL;
it from being collected, you need to acquire a GC handle for
it.
<div class="code">
guint32 handle = mono_gchandle_new (my_object, TRUE);
<div class="mapi-code">
guint32 handle = mono_gchandle_new (my_object, TRUE);
</div>
<p>TRUE means the object will be pinned, so it won't move in
memory when we'll use a moving GC. You can access the
MonoObject* referenced by a handle with:
<div class="code">
MonoObject* obj = mono_gchandle_get_target (handle);
<div class="mapi-code">
MonoObject* obj = mono_gchandle_get_target (handle);
</div>
<p>When you don't need the handle anymore you need to call:
<div class="code">
mono_gchandle_free (handle);
<div class="mapi-code">
mono_gchandle_free (handle);
</div>
<p>Note that if you assign a new object to the C var, you need
@@ -65,27 +66,27 @@ static MonoObject* o = NULL;
<p>So code that looked like this:
<div class="code">
static MonoObject* o = NULL;
...
o = mono_object_new (...);
/* use o */
...
/* when done to allow the GC to collect o */
o = NULL;
<div class="mapi-code">
static MonoObject* obj = NULL;
...
obj = mono_object_new (...);
// use obj
...
// when done to allow the GC to collect obj
obj = NULL;
</div>
<p>should now be changed to:
<div class="code">
static guint32 o_handle;
...
MonoObject *o = mono_object_new (...);
o_handle = mono_gchandle_new (o, TRUE);
/* use o or mono_gchandle_get_target (o_handle) */
...
/* when done to allow the GC to collect o */
mono_gchandle_free (o_handle);
<div class="mapi-code">
static guint32 o_handle;
...
MonoObject *obj = mono_object_new (...);
o_handle = mono_gchandle_new (obj, TRUE);
// use o or mono_gchandle_get_target (o_handle)
...
// when done to allow the GC to collect obj
mono_gchandle_free (o_handle);
</div>
<h4><a name="api:mono_gchandle_new">mono_gchandle_new</a></h4>
+12 -2
View File
@@ -6,7 +6,7 @@
<h3>Synopsis</h3>
<div class="header">
<div class="mapi-header">
#include &lt;metadata/image.h&gt;
typedef struct _MonoImage MonoImage;
@@ -25,7 +25,6 @@ typedef enum {
<p>Images are the actual elements in the runtime that contain
the actual code being executed.
<a name="cil_image_open"/>
<h3>Opening and closing MonoImages</h3>
<h4><a name="api:mono_image_open">mono_image_open</a></h4>
@@ -35,6 +34,8 @@ typedef enum {
<h4><a name="api:mono_image_close">mono_image_close</a></h4>
<h4><a name="api:mono_image_addref">mono_image_addref</a></h4>
<h4><a name="api:mono_image_load_file_for_image">mono_image_load_file_for_image</a></h4>
<h4><a name="api:mono_image_open_from_data_with_name">mono_image_open_from_data_with_name</a></h4>
<h4><a name="api:mono_image_load_module">mono_image_load_module</a></h4>
<h3>Image Information</h3>
@@ -51,6 +52,7 @@ typedef enum {
<h4><a name="api:mono_image_loaded">mono_image_loaded</a></h4>
<h4><a name="api:mono_image_lookup_resource">mono_image_lookup_resource</a></h4>
<h4><a name="api:mono_image_strerror">mono_image_strerror</a></h4>
<h4><a name="api:mono_get_method_constrained">mono_get_method_constrained</a></h4>
<h3>Public Keys, Strong Names and Certificates</h3>
@@ -64,3 +66,11 @@ typedef enum {
<h4><a name="api:mono_image_rva_map">mono_image_rva_map</a></h4>
<h4><a name="api:mono_image_ensure_section_idx">mono_image_ensure_section_idx</a></h4>
<h4><a name="api:mono_image_ensure_section">mono_image_ensure_section</a></h4>
<h4><a name="api:mono_image_init">mono_image_init</a></h4>
<h4><a name="api:mono_images_init">mono_images_init</a></h4>
<h4><a name="api:mono_images_cleanup">mono_images_cleanup</a></h4>
<h4><a name="api:mono_image_add_to_name_cache">mono_image_add_to_name_cache</a></h4>
<h4><a name="api:mono_image_fixup_vtable">mono_image_fixup_vtable</a></h4>
<h4><a name="api:mono_image_loaded_by_guid_full">mono_image_loaded_by_guid_full</a></h4>
<h4><a name="api:mono_image_loaded_full">mono_image_loaded_full</a></h4>
<h4><a name="api:mono_lookup_icall_symbol">mono_lookup_icall_symbol</a></h4>
+23 -44
View File
@@ -4,6 +4,29 @@
inside Mono that developers extending or altering Mono might
want to use.
<h2>Strings</h2>
<h3>Other Encodings</h3>
<p>These routines are used when coping with strings that come
from Mono's environment, and might be encoded in one or more
of the external encodings.
<p>For example, some file systems might historically contain a
mix of file names with both old and new encodings, typically
UTF8 for new files, and the old files would be encoded in an 8
bit character set (ISO-8859-1 for example).
<p>These routines try a number of encodings, those specified
in the <tt>MONO_ENCODINGS</tt> environment variable and return
unicode strings that can be used internally.
<p>See the mono(1) man page for more details.
<h4><a name="api:mono_unicode_from_external">mono_unicode_from_external</a></h4>
<h4><a name="api:mono_unicode_to_external">mono_unicode_to_external</a></h4>
<h4><a name="api:mono_utf8_from_external">mono_utf8_from_external</a></h4>
<h2>Marshalling functions</h2>
<h4><a name="api:mono_marshal_alloc">mono_marshal_alloc</a></h4>
@@ -17,7 +40,6 @@
<h4><a name="api:mono_marshal_get_delegate_invoke">mono_marshal_get_delegate_invoke</a></h4>
<h4><a name="api:mono_marshal_get_icall_wrapper">mono_marshal_get_icall_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_isinst">mono_marshal_get_isinst</a></h4>
<h4><a name="api:mono_marshal_get_ldfld_remote_wrapper">mono_marshal_get_ldfld_remote_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_ldfld_wrapper">mono_marshal_get_ldfld_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_managed_wrapper">mono_marshal_get_managed_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_native_wrapper">mono_marshal_get_native_wrapper</a></h4>
@@ -28,7 +50,6 @@
<h4><a name="api:mono_marshal_get_remoting_invoke_with_check">mono_marshal_get_remoting_invoke_with_check</a></h4>
<h4><a name="api:mono_marshal_get_runtime_invoke">mono_marshal_get_runtime_invoke</a></h4>
<h4><a name="api:mono_marshal_get_stelemref">mono_marshal_get_stelemref</a></h4>
<h4><a name="api:mono_marshal_get_stfld_remote_wrapper">mono_marshal_get_stfld_remote_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_stfld_wrapper">mono_marshal_get_stfld_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_struct_to_ptr">mono_marshal_get_struct_to_ptr</a></h4>
<h4><a name="api:mono_marshal_get_synchronized_wrapper">mono_marshal_get_synchronized_wrapper</a></h4>
@@ -36,47 +57,9 @@
<h4><a name="api:mono_marshal_get_xappdomain_invoke">mono_marshal_get_xappdomain_invoke</a></h4>
<h4><a name="api:mono_marshal_load_type_info">mono_marshal_load_type_info</a></h4>
<h4><a name="api:mono_marshal_method_from_wrapper">mono_marshal_method_from_wrapper</a></h4>
<h4><a name="api:mono_marshal_realloc">mono_marshal_realloc</a></h4>
<h4><a name="api:mono_marshal_set_last_error">mono_marshal_set_last_error</a></h4>
<h4><a name="api:mono_marshal_type_size">mono_marshal_type_size</a></h4>
<h2>Metadata Loading Errors</h2>
<p>The routines in this section are used to cope with errors
during metadata loading. Errors in metadata handling can
happen for many reason, and these include (this is not an
exhaustive list).
<ul>
<li>An assembly referenced is missing.
<li>Fields referenced are missing.
<li>Methods referenced are missing.
</ul>
<p>The <tt>mono_loader_set_*</tt> routines are invoked during
metadata loading to flag that an error has happened. The
class loading errros are flagged in a per-thread basis.
<P>In various spots in the runtime the
<tt>mono_loader_get_last_error</tt> routine is called to check
if there was a problem, and then errors are propagated upwards
on the stack until we reach a point where an exception can be
raised and no runtime locks are held.
<p>The <tt>mono_loader_error_prepare_exception</tt> takes a
<tt>MonoLoaderError</tt> structure (the value returned from
<tt>mono_loader_get_last_error</tt>), turns that into an
exception and clears the error condition from the current
thread.
<h4><a name="api:mono_loader_set_error_field_load">mono_loader_set_error_field_load</a></h4>
<h4><a name="api:mono_loader_set_error_method_load">mono_loader_set_error_method_load</a></h4>
<h4><a name="api:mono_loader_set_error_type_load">mono_loader_set_error_type_load</a></h4>
<h4><a name="api:mono_loader_get_last_error">mono_loader_get_last_error</a></h4>
<h4><a name="api:mono_loader_clear_error">mono_loader_clear_error</a></h4>
<h4><a name="api:mono_loader_error_prepare_exception">mono_loader_error_prepare_exception</a></h4>
<h2>Metadata Loader Locking: Internals</h2>
<p>The locking functions here are used by code in class.c and
@@ -91,10 +74,6 @@
<p>The internal interface of the Mono GC is the interface used
between the runtime engine and the garbage collector.
<h4><a name="api:mono_gc_disable">mono_gc_disable</a></h4>
<h4><a name="api:mono_gc_enable">mono_gc_enable</a></h4>
<h4><a name="api:mono_gc_start_world">mono_gc_start_world</a></h4>
<h4><a name="api:mono_gc_stop_world">mono_gc_stop_world</a></h4>
<h4><a name="api:mono_gc_alloc_fixed">mono_gc_alloc_fixed</a></h4>
<h4><a name="api:mono_gc_free_fixed">mono_gc_free_fixed</a></h4>
<h4><a name="api:mono_gc_make_descr_from_bitmap">mono_gc_make_descr_from_bitmap</a></h4>
+26 -4
View File
@@ -1,9 +1,26 @@
<h2>Synopsis</h2>
<div class="header">
<p>These functions are used to get some runtime information
from the Just in Time compiler and also to control some
aspects of the initialization and shutdown of the runtime.
<div class="mapi-header">
typedef struct _MonoJitInfo MonoJitInfo;
@API_IDX@
</div>
<h3>Just-in-Time Compiled Method Information</h3>
<p>Use the `MonoJitInfo` API to get data about a JITed
method. These APIs are typically used by profiler modules
added to Mono.
<h4><a name="api:mono_jit_info_table_find">mono_jit_info_table_find</a></h4>
<h4><a name="api:mono_jit_info_get_code_size">mono_jit_info_get_code_size</a></h4>
<h4><a name="api:mono_jit_info_get_code_start">mono_jit_info_get_code_start</a></h4>
<h4><a name="api:mono_jit_info_get_method">mono_jit_info_get_method</a></h4>
<h3>Useful Debugging Functions</h3>
<p>These functions are useful when running the Mono VM inside
@@ -14,7 +31,12 @@
<h4><a name="api:mono_print_thread_dump">mono_print_thread_dump</a></h4>
<h4><a name="api:mono_threads_request_thread_dump">mono_threads_request_thread_dump</a></h4>
<h3>Helper Tools For Native Ports</h3>
<h4><a name="api:mono_inst_name">mono_inst_name</a></h4>
<h3>Advanced</h3></h4>
<h4><a name="api:mono_assemblies_init">mono_assemblies_init</a></h4>
<h4><a name="api:mono_assemblies_cleanup">mono_assemblies_cleanup</a></h4>
<h4><a name="api:mono_environment_exitcode_get">mono_environment_exitcode_get</a></h4>
<h4><a name="api:mono_environment_exitcode_set">mono_environment_exitcode_set</a></h4>
<h4><a name="api:mono_install_runtime_cleanup">mono_install_runtime_cleanup</a></h4>
<h4><a name="api:mono_runtime_set_shutting_down">mono_runtime_set_shutting_down</a></h4>
<h4><a name="api:mono_security_set_core_clr_platform_callback">mono_security_set_core_clr_platform_callback</a></h4>
+116 -3
View File
@@ -1,4 +1,119 @@
<h1>Notification Interface</h1>
<h2>Internal Runtime Utility Functions</h2>
<h3>SHA1 Signatures</h3>
<h4><a name="api:mono_sha1_init">mono_sha1_init</a></h4>
<h4><a name="api:mono_sha1_update">mono_sha1_update</a></h4>
<h4><a name="api:mono_sha1_get_digest_from_file">mono_sha1_get_digest_from_file</a></h4>
<h4><a name="api:mono_sha1_get_digest">mono_sha1_get_digest</a></h4>
<h4><a name="api:mono_sha1_final">mono_sha1_final</a></h4>
<h3>MD5 Signatures</h3>
<h4><a name="api:mono_md5_init">mono_md5_init</a></h4>
<h4><a name="api:mono_md5_update">mono_md5_update</a></h4>
<h4><a name="api:mono_md5_get_digest_from_file">mono_md5_get_digest_from_file</a></h4>
<h4><a name="api:mono_md5_get_digest">mono_md5_get_digest</a></h4>
<h4><a name="api:mono_md5_final">mono_md5_final</a></h4>
<h4><a name="api:mono_digest_get_public_token">mono_digest_get_public_token</a></h4>
<h3>Hashtables</h3>
<p><tt>GHashTable</tt> is used when you need to store object
references into a hashtable, objects stored in a
<tt>MonoGHashTable</tt> are properly tracked by the garbage
collector.
<p>The <tt>MonoGHashTable</tt> data type has the same API as
the GLIB.
<h4><a name="api:mono_g_hash_table_destroy">mono_g_hash_table_destroy</a></h4>
<h4><a name="api:mono_g_hash_table_foreach">mono_g_hash_table_foreach</a></h4>
<h4><a name="api:mono_g_hash_table_foreach_remove">mono_g_hash_table_foreach_remove</a></h4>
<h4><a name="api:mono_g_hash_table_insert">mono_g_hash_table_insert</a></h4>
<h4><a name="api:mono_g_hash_table_lookup">mono_g_hash_table_lookup</a></h4>
<h4><a name="api:mono_g_hash_table_lookup_extended">mono_g_hash_table_lookup_extended</a></h4>
<h4><a name="api:mono_g_hash_table_remove">mono_g_hash_table_remove</a></h4>
<h4><a name="api:mono_g_hash_table_replace">mono_g_hash_table_replace</a></h4>
<h4><a name="api:mono_g_hash_table_size">mono_g_hash_table_size</a></h4>
<h3>Memory Pools</h3>
<p>Memory pools are a convenient way of tracking memory
allocations that are used for one specific task, they are also
faster than using the standard memory allocation procedures,
as they are designed to be used only by a single thread at a
time.
<p><tt>MonoMemPool</tt> objects are not thread safe, which
means that you should not share the objects across multiple
threads without providing proper locking around it (unlike
<tt>malloc</tt> and <tt>free</tt> which are thread safe).
<p>When a <tt>MonoMemPool</tt> is released with
<tt>mono_mempool_destroy</tt> all of the of the memory
allocated from that memory pool with
<tt>mono_mempool_alloc</tt> and <tt>mono_mempool_alloc0</tt>
is released.
<h4><a name="api:mono_mempool_new">mono_mempool_new</a></h4>
<h4><a name="api:mono_mempool_destroy">mono_mempool_destroy</a></h4>
<h4><a name="api:mono_mempool_alloc">mono_mempool_alloc</a></h4>
<h4><a name="api:mono_mempool_alloc0">mono_mempool_alloc0</a></h4>
<h4><a name="api:mono_mempool_invalidate">mono_mempool_invalidate</a></h4>
<h4><a name="api:mono_mempool_stats">mono_mempool_stats</a></h4>
<h4><a name="api:mono_mempool_contains_addr">mono_mempool_contains_addr</a></h4>
<h3>Bitsets</h3>
<p>MonoBitsets are a set of routines used to manipulate sets
of bits.
<h4><a name="api:mono_bitset_alloc_size">mono_bitset_alloc_size</a></h4>
<h4><a name="api:mono_bitset_clear">mono_bitset_clear</a></h4>
<h4><a name="api:mono_bitset_clear_all">mono_bitset_clear_all</a></h4>
<h4><a name="api:mono_bitset_clone">mono_bitset_clone</a></h4>
<h4><a name="api:mono_bitset_copyto">mono_bitset_copyto</a></h4>
<h4><a name="api:mono_bitset_count">mono_bitset_count</a></h4>
<h4><a name="api:mono_bitset_equal">mono_bitset_equal</a></h4>
<h4><a name="api:mono_bitset_find_first">mono_bitset_find_first</a></h4>
<h4><a name="api:mono_bitset_find_last">mono_bitset_find_last</a></h4>
<h4><a name="api:mono_bitset_find_start">mono_bitset_find_start</a></h4>
<h4><a name="api:mono_bitset_foreach">mono_bitset_foreach</a></h4>
<h4><a name="api:mono_bitset_free">mono_bitset_free</a></h4>
<h4><a name="api:mono_bitset_intersection">mono_bitset_intersection</a></h4>
<h4><a name="api:mono_bitset_invert">mono_bitset_invert</a></h4>
<h4><a name="api:mono_bitset_mem_new">mono_bitset_mem_new</a></h4>
<h4><a name="api:mono_bitset_new">mono_bitset_new</a></h4>
<h4><a name="api:mono_bitset_set">mono_bitset_set</a></h4>
<h4><a name="api:mono_bitset_set_all">mono_bitset_set_all</a></h4>
<h4><a name="api:mono_bitset_size">mono_bitset_size</a></h4>
<h4><a name="api:mono_bitset_sub">mono_bitset_sub</a></h4>
<h4><a name="api:mono_bitset_test">mono_bitset_test</a></h4>
<h4><a name="api:mono_bitset_test_bulk">mono_bitset_test_bulk</a></h4>
<h4><a name="api:mono_bitset_union">mono_bitset_union</a></h4>
<h4><a name="api:mono_bitset_find_first_unset">mono_bitset_find_first_unset</a></h4>
<h4><a name="api:mono_bitset_intersection_2">mono_bitset_intersection_2</a></h4>
<h3>JIT utilities</h3>
<h4><a name="api:mono_signbit_double">mono_signbit_double</a></h4>
<h4><a name="api:mono_signbit_float">mono_signbit_float</a></h4>
<h3>Function Pointers</h3>
<p>To wrap a function pointer into something that the Mono
runtime can consume, you should use the mono_create_ftnptr.
This is only important if you plan on running on the IA64
architecture. Otherwise you can just use the function
pointer address.
<h4><a name="api:mono_create_ftnptr">mono_create_ftnptr</a></h4>
<h2>Notification Interface</h2>
<p>This is an internal profiler interface. In general, users
would not be using this interface, but would be using the
@@ -32,6 +147,4 @@
<h4><a name="api:mono_profiler_startup">mono_profiler_startup</a></h4>
<h4><a name="api:mono_profiler_gc_event">mono_profiler_gc_event</a></h4>
<h4><a name="api:mono_profiler_gc_heap_resize">mono_profiler_gc_heap_resize</a></h4>
<h4><a name="api:mono_profiler_gc_event">mono_profiler_gc_event</a></h4>
<h4><a name="api:mono_profiler_gc_heap_resize">mono_profiler_gc_heap_resize</a></h4>
<h4><a name="api:mono_profiler_stat_hit">mono_profiler_stat_hit</a></h4>
-6
View File
@@ -1,6 +0,0 @@
<h4><a name="api:mono_delegate_free_ftnptr">mono_delegate_free_ftnptr</a></h4>
<h4><a name="api:mono_delegate_to_ftnptr">mono_delegate_to_ftnptr</a></h4>
<h4><a name="api:mono_ftnptr_to_delegate">mono_ftnptr_to_delegate</a></h4>
<h4><a name="api:mono_marshal_string_to_utf16">mono_marshal_string_to_utf16</a></h4>
+4 -7
View File
@@ -617,7 +617,6 @@ MONO_TYPESPEC_SIZE
<h4><a name="api:mono_image_get_table_info">mono_image_get_table_info</a></h4>
<h4><a name="api:mono_image_get_table_rows">mono_image_get_table_rows</a></h4>
<h4><a name="api:mono_metadata_get_table">mono_metadata_get_table</a></h4>
<h4><a name="api:mono_metadata_decode_row_col">mono_metadata_decode_row_col</a></h4>
<h4><a name="api:mono_metadata_decode_row">mono_metadata_decode_row</a></h4>
<h4><a name="api:mono_metadata_compute_size">mono_metadata_compute_size</a></h4>
@@ -631,9 +630,10 @@ MONO_TYPESPEC_SIZE
<p>This is the low-level API for accessing the metadata
images.
<h4><a name="api:mono_cli_rva_image_map">mono_cli_rva_image_map</a></h4>
<h4><a name="api:mono_pe_file_open">mono_pe_file_open</a></h4>
<h4><a name="api:mono_metadata_events_from_typedef">mono_metadata_events_from_typedef</a></h4>
<h4><a name="api:mono_metadata_decode_table_row">mono_metadata_decode_table_row</a></h4>
<h4><a name="api:mono_metadata_decode_table_row_col">mono_metadata_decode_table_row_col</a></h4>
<h4><a name="api:mono_metadata_field_info">mono_metadata_field_info</a></h4>
<h4><a name="api:mono_metadata_free_array">mono_metadata_free_array</a></h4>
<h4><a name="api:mono_metadata_free_marshal_spec">mono_metadata_free_marshal_spec</a></h4>
@@ -652,6 +652,7 @@ MONO_TYPESPEC_SIZE
<h4><a name="api:mono_metadata_packing_from_typedef">mono_metadata_packing_from_typedef</a></h4>
<h4><a name="api:mono_metadata_properties_from_typedef">mono_metadata_properties_from_typedef</a></h4>
<h4><a name="api:mono_metadata_token_from_dor">mono_metadata_token_from_dor</a></h4>
<h4><a name="api:mono_metadata_translate_token_index">mono_metadata_translate_token_index</a></h4>
<h4><a name="api:mono_metadata_typedef_from_field">mono_metadata_typedef_from_field</a></h4>
<h4><a name="api:mono_metadata_typedef_from_method">mono_metadata_typedef_from_method</a></h4>
<h4><a name="api:mono_metadata_type_equal">mono_metadata_type_equal</a></h4>
@@ -661,24 +662,20 @@ MONO_TYPESPEC_SIZE
<h3>Retrieving Objects from Tokens</h3>
<h4><a name="api:mono_metadata_parse_array">mono_metadata_parse_array</a></h4>
<h4><a name="api:mono_metadata_parse_custom_mod">mono_metadata_parse_custom_mod</a></h4>
<h4><a name="api:mono_metadata_parse_field_type">mono_metadata_parse_field_type</a></h4>
<h4><a name="api:mono_metadata_parse_marshal_spec">mono_metadata_parse_marshal_spec</a></h4>
<h4><a name="api:mono_metadata_parse_method_signature_full">mono_metadata_parse_method_signature_full</a></h4>
<h4><a name="api:mono_metadata_parse_method_signature">mono_metadata_parse_method_signature</a></h4>
<h4><a name="api:mono_metadata_parse_mh_full">mono_metadata_parse_mh_full</a></h4>
<h4><a name="api:mono_metadata_parse_mh">mono_metadata_parse_mh</a></h4>
<h4><a name="api:mono_metadata_parse_param">mono_metadata_parse_param</a></h4>
<h4><a name="api:mono_metadata_parse_signature">mono_metadata_parse_signature</a></h4>
<h4><a name="api:mono_metadata_parse_typedef_or_ref">mono_metadata_parse_typedef_or_ref</a></h4>
<h4><a name="api:mono_metadata_parse_type_full">mono_metadata_parse_type_full</a></h4>
<h4><a name="api:mono_metadata_parse_type">mono_metadata_parse_type</a></h4>
<h2>Generics Support</h2>
<h4><a name="api:mono_metadata_generic_class_is_valuetype">mono_metadata_generic_class_is_valuetype</a></h4>
<h4><a name="api:mono_metadata_inflate_generic_inst">mono_metadata_inflate_generic_inst</a></h4>
<h4><a name="api:mono_metadata_load_generic_params">mono_metadata_load_generic_params</a></h4>
<h2>Tokens</h2>
+159 -24
View File
@@ -1,5 +1,159 @@
<h3>Methods</h3>
<h2>Methods</h2>
<p>Methods are represented by the <code>MonoMethod*</code>
instances. Various APIs surface these instances, but usually
you will use the <a href="#method-desc">method description</a>
API to get a handle to a Mono Method. You can <a href="method-invoking">invoke</a> those methods from C,
or you can probe <a href="method-working">probe various properties</a> of a method, and in particular
its <a href="method-signature">method signature</a> or get
some <a href="method-header">low-level information</a> about them.
<p>The following code snippet from the Mono runtime shows you
how to create a managed <code>System.Version</code> instance
with four integers by looking up the constructor in the
managed implementation of System.Version, creating an instance
of the object, and then invoking the constructor on it.
<div class="mapi-header">
MonoObject*
create_version (MonoDomain *domain, guint32 major, guint32 minor, guint32 build, guint32 revision)
{
MonoClass *System_Version;
MonoMethod *create_version;
MonoError error;
MonoObject *result;
gpointer args [4];
System_Version = mono_class_from_name (mono_defaults.corlib, "System", "Version");
// Create a method description that we use to search for the
// constructor method
MonoMethodDesc *desc = mono_method_desc_new (":.ctor(int,int,int,int)", FALSE);
create_version = mono_method_desc_search_in_class (desc, System_Version);
mono_method_desc_free (desc);
// Setup the parameters to pass.
args [0] = &major;
args [1] = &minor;
args [2] = &build;
args [3] = &revision;
// Create the object instance
result = mono_object_new_checked (domain, System_Version, &error);
// Raise an exception in case of an error
mono_error_raise_exception (&error);
// Otherwise, invoke the constructor
mono_runtime_invoke (create_version, result, args, NULL);
// Return ther esult
return result;
}
</div>
<a name="method-desc"></a>
<h3>Method Descriptions</h3>
<p>Methods are represented by the <code>MonoMethod*</code>
instances. To simplify the process of getting
a <code>MonoMethod*</code>, you use Method Descriptors, which
are C-strings that describe the method that you are looking
for, and then you perform a search in either
a <a href="mono-api-type.html">type</a>, or a
loaded <a href="mono-api-image.html">image</a>.
<p>To describe a method, you use the Method Description API.
Method descriptions are used to locate a method in the
executing program. They can either be fully specified, that
is, they would include the namespace, class, method name and
all of its arguments or they omit the namespace and arguments
and even use wildcard matches for the class name and method names.
<p>You use the fully specified version to identify a
particular method, or you can use the partial version to find
a method or a family of methods in the code.
<p>Method descriptions are typically created from a C string
representation, and take the following form:
<p><code>[namespace.]classname:methodname[(args...)]</code>
<p>Both classname and methodname can contain the '*' character
which can be used to match anything. Arguments are separated
by commas.
<p>You can use the type shortcuts to match the fully qualified
parameter types. The supported type shortcuts are:
<code>char</code>,
<code>bool</code>,
<code>byte</code>,
<code>sbyte</code>,
<code>uint16</code>,
<code>int16</code>,
<code>uint</code>,
<code>int</code>,
<code>ulong</code>,
<code>long</code>,
<code>uintptr</code>,
<code>intptr</code>,
<code>single</code>,
<code>double</code>,
<code>string</code> and
<code>object</code>.
<p>The type parameters can use the "&" and "*" type modifiers.
<p>Examples of method descriptions:
<ul>
<li>"Monitor:Exit": matches classes and methods called "Monitor.Exit"
<li>"Monitor:enter_with_atomic_var(object,bool&)":
matches a method in the class Monitor with two
specific type parameters.
<li>":.ctor(int,int,int,int)": matches constructors
that take four integers.
<li>"System.Globalization.CultureInfo:CreateCulture(string,bool)":
matches the CreateCultureMethod that takes a string
and a boolean on the System.Globalization.CultureInfo class.
</ul>
<p>You can
then <a href="api:mono_method_desc_search_in_image">search for
methods in MonoImages</a>
or <a href="api:mono_method_desc_search_in_class">search for
methods in classes</a>.
<h4><a name="api:mono_method_desc_new">mono_method_desc_new</a></h4>
<h4><a name="api:mono_method_desc_free">mono_method_desc_free</a></h4>
<h4><a name="api:mono_method_desc_from_method">mono_method_desc_from_method</a></h4>
<h4><a name="api:mono_method_desc_full_match">mono_method_desc_full_match</a></h4>
<h4><a name="api:mono_method_desc_match">mono_method_desc_match</a></h4>
<h4><a name="api:mono_method_desc_search_in_class">mono_method_desc_search_in_class</a></h4>
<h4><a name="api:mono_method_desc_search_in_image">mono_method_desc_search_in_image</a></h4>
<a name="method-working"></a>
<h3>Working with Methods</h3>
<h4><a name="api:mono_method_full_name">mono_method_full_name</a></h4>
<h4><a name="api:mono_method_get_class">mono_method_get_class</a></h4>
<h4><a name="api:mono_method_get_flags">mono_method_get_flags</a></h4>
<h4><a name="api:mono_method_get_last_managed">mono_method_get_last_managed</a></h4>
<h4><a name="api:mono_method_get_marshal_info">mono_method_get_marshal_info</a></h4>
<h4><a name="api:mono_method_get_name">mono_method_get_name</a></h4>
<h4><a name="api:mono_method_get_object">mono_method_get_object</a></h4>
<h4><a name="api:mono_method_get_param_names">mono_method_get_param_names</a></h4>
<h4><a name="api:mono_method_get_param_token">mono_method_get_param_token</a></h4>
<h4><a name="api:mono_method_get_signature">mono_method_get_signature</a></h4>
<h4><a name="api:mono_method_get_index">mono_method_get_index</a></h4>
<h4><a name="api:mono_method_get_signature_full">mono_method_get_signature_full</a></h4>
<h4><a name="api:mono_method_get_token">mono_method_get_token</a></h4>
<h4><a name="api:mono_method_get_unmanaged_thunk">mono_method_get_unmanaged_thunk</a></h4>
<h4><a name="api:mono_method_has_marshal_info">mono_method_has_marshal_info</a></h4>
<h4><a name="api:mono_method_verify">mono_method_verify</a></h4>
<a name="method-invoking"></a>
<h3>Invoking Methods</h3>
<h4><a name="api:mono_runtime_invoke">mono_runtime_invoke</a></h4>
@@ -8,7 +162,7 @@ If you want to invoke generic methods, you must call the method on the
"inflated" class, which you can obtain from the
<tt>mono_object_get_class()</tt>
<div class="code">
<div class="mapi-code">
MonoClass *clazz;
MonoMethod *method;
@@ -29,29 +183,8 @@ mono_runtime_invoke (method, obj, args, &amp;exception);
<h4><a name="api:mono_runtime_delegate_invoke">mono_runtime_delegate_invoke</a></h4>
<h4><a name="api:mono_method_body_get_object">mono_method_body_get_object</a></h4>
<h4><a name="api:mono_method_desc_free">mono_method_desc_free</a></h4>
<h4><a name="api:mono_method_desc_from_method">mono_method_desc_from_method</a></h4>
<h4><a name="api:mono_method_desc_full_match">mono_method_desc_full_match</a></h4>
<h4><a name="api:mono_method_desc_match">mono_method_desc_match</a></h4>
<h4><a name="api:mono_method_desc_new">mono_method_desc_new</a></h4>
<h4><a name="api:mono_method_desc_search_in_class">mono_method_desc_search_in_class</a></h4>
<h4><a name="api:mono_method_desc_search_in_image">mono_method_desc_search_in_image</a></h4>
<h4><a name="api:mono_method_full_name">mono_method_full_name</a></h4>
<h4><a name="api:mono_method_get_class">mono_method_get_class</a></h4>
<h4><a name="api:mono_method_get_flags">mono_method_get_flags</a></h4>
<h4><a name="api:mono_method_get_last_managed">mono_method_get_last_managed</a></h4>
<h4><a name="api:mono_method_get_marshal_info">mono_method_get_marshal_info</a></h4>
<h4><a name="api:mono_method_get_name">mono_method_get_name</a></h4>
<h4><a name="api:mono_method_get_object">mono_method_get_object</a></h4>
<h4><a name="api:mono_method_get_param_names">mono_method_get_param_names</a></h4>
<h4><a name="api:mono_method_get_param_token">mono_method_get_param_token</a></h4>
<h4><a name="api:mono_method_get_signature">mono_method_get_signature</a></h4>
<h4><a name="api:mono_method_get_index">mono_method_get_index</a></h4>
<h4><a name="api:mono_method_get_signature_full">mono_method_get_signature_full</a></h4>
<h4><a name="api:mono_method_get_token">mono_method_get_token</a></h4>
<h4><a name="api:mono_method_has_marshal_info">mono_method_has_marshal_info</a></h4>
<h4><a name="api:mono_method_verify">mono_method_verify</a></h4>
<a name="method-signature"></a>
<h3>Method Signatures</h3>
<h4><a name="api:mono_method_signature">mono_method_signature</a></h4>
@@ -63,11 +196,13 @@ mono_runtime_invoke (method, obj, args, &amp;exception);
<h4><a name="api:mono_signature_get_return_type">mono_signature_get_return_type</a></h4>
<h4><a name="api:mono_signature_hash">mono_signature_hash</a></h4>
<h4><a name="api:mono_signature_is_instance">mono_signature_is_instance</a></h4>
<h4><a name="api:mono_signature_param_is_out">mono_signature_param_is_out</a></h4>
<h4><a name="api:mono_signature_vararg_start">mono_signature_vararg_start</a></h4>
<h4><a name="api:mono_param_get_objects">mono_param_get_objects</a></h4>
<h4><a name="api:mono_get_method_full">mono_get_method_full</a></h4>
<h4><a name="api:mono_get_method">mono_get_method</a></h4>
<a name="method-header"></a>
<h3>Methods Header Operations</h3>
<h4><a name="api:mono_method_get_header">mono_method_get_header</a></h4>
+48 -24
View File
@@ -6,15 +6,17 @@
<p>The object API has methods for accessing <a
href="#fields">fields</a>, <a
href="#properties">properties</a>, <a
href="#properties">properties</a>, <a href="mono-api-methods.html">methods</a>, <a
href="#events">events</a>, <a href="#delegates">delegates</a>.
<p>There are some advanced uses that are useful to document
here dealing with <a href="#remote">remote fields</a>.
<h2>Synopsis</h2>
<div class="header">
<div class="mapi-header">
#include &lt;metadata/object.h&gt;
typedef struct MonoVTable MonoVTable;
@@ -43,7 +45,7 @@ typedef struct {
@API_IDX@
</div>
<p>MonoObject is the base definition for all managed objects
<p>`MonoObject` is the base definition for all managed objects
in the Mono runtime, it represents the <a
href="http://www.mono-project.com/monodoc/T:System.Object">System.Object</a>
managed type.
@@ -54,12 +56,11 @@ typedef struct {
following the pattern where the parent class is the first
field of a structure definition, for example:
<div class="code">
typedef struct {
MonoObject parent;
int my_new_field;
} MyNewObject
</div>
<div class="mapi-code">
typedef struct {
MonoObject parent;
int my_new_field;
} MyNewObject</div>
<a name="objects"></a>
<h2>Core Object Methods</h2>
@@ -69,7 +70,7 @@ typedef struct {
<p>For example, if you wanted to create an object of type
System.Version, you would use a piece of code like this:
<div class="code">
<div class="mapi-code">
MonoClass *version_class;
MonoObject *result;
@@ -79,7 +80,7 @@ version_class = mono_class_from_name (mono_get_corlib (),
/* Create an object of that class */
result = mono_object_new (mono_domain_get (), version_class);
</div>
</div>
<h4><a name="api:mono_object_new_alloc_specific">mono_object_new_alloc_specific</a></h4>
<h4><a name="api:mono_object_new_fast">mono_object_new_fast</a></h4>
@@ -94,6 +95,8 @@ result = mono_object_new (mono_domain_get (), version_class);
<h4><a name="api:mono_object_unbox">mono_object_unbox</a></h4>
<h4><a name="api:mono_object_castclass_mbyref">mono_object_castclass_mbyref</a></h4>
<h4><a name="api:mono_object_get_size">mono_object_get_size</a></h4>
<h4><a name="api:mono_object_hash">mono_object_hash</a></h4>
<h4><a name="api:mono_object_to_string">mono_object_to_string</a></h4>
<a name="valuetypes"></a>
<h2>Value Types</h2>
@@ -112,19 +115,17 @@ result = mono_object_new (mono_domain_get (), version_class);
elements of type <tt>System.Byte</tt>, and sets the values
0xca and 0xfe on it:
<pre class="code">
<pre class="mapi-code">
MonoArray *CreateByteArray (MonoDomain *domain)
{
MonoArray *data;
MonoArray *CreateByteArray (MonoDomain *domain)
{
MonoArray *data;
data = mono_array_new (domain, mono_get_byte_class (), 2);
mono_array_set (data, guint8, 0, 0xca);
mono_array_set (data, guint8, 0, 0xfe);
return data;
}
data = mono_array_new (domain, mono_get_byte_class (), 2);
mono_array_set (data, guint8, 0, 0xca);
mono_array_set (data, guint8, 0, 0xfe);
return data;
}
</pre>
<h3>Creating Arrays</h3>
@@ -137,12 +138,31 @@ result = mono_object_new (mono_domain_get (), version_class);
<h3>Using Arrays</h3>
<p>Arrays are represented by the `MonoArray` data type and are
instances of `MonoObject`. While you can use the `bounds`
and `max_length` fields of the type, the actual storage
(represented by `vector`) is not very useful. Instead you
should use one of the accesor methods described below to
fetch or set the values in the array.
<p>When setting values in an array, you should
use <a href="api:mono_array_set">mono_array_set</a> for
setting elements in an array that contains value types, and
<a
href="api:mono_array_setref">mono_array_setref</a> for arrays
that contain reference types.
<p>The <a href="api:mono_array_get">mono_array_get</a>,
<a href="api:mono_array_set">mono_array_set</a> and <a
href="api:mono_array_setref">mono_array_setref</a> are C
macros that wrap the underlying array access.
<h4><a name="api:mono_array_get">mono_array_get</a></h4>
<h4><a name="api:mono_array_length">mono_array_length</a></h4>
<h4><a name="api:mono_array_set">mono_array_set</a></h4>
<h4><a name="api:mono_array_setref">mono_array_setref</a></h4>
<h4><a name="api:mono_array_length">mono_array_length</a></h4>
<h4><a name="api:mono_array_addr">mono_array_addr</a></h4>
<h4><a name="api:mono_array_addr_with_size">mono_array_addr_with_size</a></h4>
<h4><a name="api:mono_array_get">mono_array_get</a></h4>
<h4><a name="api:mono_array_element_size">mono_array_element_size</a></h4>
<a name="fields"></a>
@@ -190,3 +210,7 @@ result = mono_object_new (mono_domain_get (), version_class);
<h4><a name="api:mono_store_remote_field">mono_store_remote_field</a></h4>
<h4><a name="api:mono_store_remote_field_new">mono_store_remote_field_new</a></h4>
<a name="delegates"></a>
<h2>Delegates</h2>
<h4><a name="api:mono_get_delegate_begin_invoke">mono_get_delegate_begin_invoke</a></h4>
<h4><a name="api:mono_get_delegate_end_invoke">mono_get_delegate_end_invoke</a></h4>
+7 -2
View File
@@ -1,11 +1,16 @@
<h2>Fetching Types, and Basic Reflection</h2>
<h4><a name="api:mono_reflection_get_custom_attrs_blob">mono_reflection_get_custom_attrs_blob</a></h4>
<h4><a name="api:mono_reflection_get_custom_attrs">mono_reflection_get_custom_attrs</a></h4>
<h4><a name="api:mono_custom_attrs_get_attr">mono_custom_attrs_get_attr</a></h4>
<h4><a name="api:mono_reflection_assembly_get_assembly">mono_reflection_assembly_get_assembly</a></h4>
<h4><a name="api:mono_reflection_free_type_info">mono_reflection_free_type_info</a></h4>
<h4><a name="api:mono_reflection_get_custom_attrs_blob">mono_reflection_get_custom_attrs_blob</a></h4>
<h4><a name="api:mono_reflection_get_custom_attrs_by_type">mono_reflection_get_custom_attrs_by_type</a></h4>
<h4><a name="api:mono_reflection_get_custom_attrs_data">mono_reflection_get_custom_attrs_data</a></h4>
<h4><a name="api:mono_reflection_get_custom_attrs">mono_reflection_get_custom_attrs</a></h4>
<h4><a name="api:mono_reflection_get_token">mono_reflection_get_token</a></h4>
<h4><a name="api:mono_reflection_get_type">mono_reflection_get_type</a></h4>
<h4><a name="api:mono_reflection_parse_type">mono_reflection_parse_type</a></h4>
<h4><a name="api:mono_reflection_type_get_type">mono_reflection_type_get_type</a></h4>
<h4><a name="api:mono_reflection_type_from_name">mono_reflection_type_from_name</a></h4>
<h4><a name="api:mono_reflection_get_custom_attrs_info">mono_reflection_get_custom_attrs_info</a></h4>
-2
View File
@@ -1,7 +1,5 @@
<h3>Security Manager</h3>
<h4><a name="api:mono_get_context_capture_method">mono_get_context_capture_method</a></h4>
<h3>Declarative Security</h3>
<h4><a name="api:mono_declsec_flags_from_assembly">mono_declsec_flags_from_assembly</a></h4>
+8 -24
View File
@@ -4,7 +4,7 @@
<h3>Synopsis</h3>
<div class="header">
<div class="mapi-header">
#include &lt;metadata/object.h&gt;
typedef struct {
@@ -17,10 +17,10 @@ typedef struct {
</div>
<p>All of the operations on strings are done on pointers to
MonoString objects, like this:
`MonoString` objects, like this:
<div class="code">
MonoString *hello = mono_string_new (mono_domain_get (), "hello, world");
<div class="mapi-code">
MonoString *hello = mono_string_new (mono_domain_get (), "hello, world");
</div>
<p>Strings are bound to a particular application domain, which
@@ -37,12 +37,16 @@ typedef struct {
<h4><a name="api:mono_string_new_len">mono_string_new_len</a></h4>
<h4><a name="api:mono_string_new_size">mono_string_new_size</a></h4>
<h4><a name="api:mono_string_new_utf16">mono_string_new_utf16</a></h4>
<h4><a name="api:mono_string_new_utf32">mono_string_new_utf32</a></h4>
<h4><a name="api:mono_string_from_utf16">mono_string_from_utf16</a></h4>
<h4><a name="api:mono_string_from_utf32">mono_string_from_utf32</a></h4>
<h3>Conversions</h3>
<h4><a name="api:mono_string_to_utf16">mono_string_to_utf16</a></h4>
<h4><a name="api:mono_string_to_utf8">mono_string_to_utf8</a></h4>
<h4><a name="api:mono_string_to_utf8_checked">mono_string_to_utf8_checked</a></h4>
<h4><a name="api:mono_string_to_utf32">mono_string_to_utf32</a></h4>
<h3>Methods</h3>
@@ -55,23 +59,3 @@ typedef struct {
<h4><a name="api:mono_string_length">mono_string_length</a></h4>
<h3>Other Encodings</h3>
<p>These routines are used when coping with strings that come
from Mono's environment, and might be encoded in one or more
of the external encodings.
<p>For example, some file systems might historically contain a
mix of file names with both old and new encodings, typically
UTF8 for new files, and the old files would be encoded in an 8
bit character set (ISO-8859-1 for example).
<p>These routines try a number of encodings, those specified
in the <tt>MONO_ENCODINGS</tt> environment variable and return
unicode strings that can be used internally.
<p>See the mono(1) man page for more details.
<h4><a name="api:mono_unicode_from_external">mono_unicode_from_external</a></h4>
<h4><a name="api:mono_unicode_to_external">mono_unicode_to_external</a></h4>
<h4><a name="api:mono_utf8_from_external">mono_utf8_from_external</a></h4>
+11 -2
View File
@@ -6,19 +6,28 @@
<h4><a name="api:mono_thread_current">mono_thread_current</a></h4>
<h4><a name="api:mono_thread_detach">mono_thread_detach</a></h4>
<h4><a name="api:mono_thread_exit">mono_thread_exit</a></h4>
<h4><a name="api:mono_thread_get_managed_id">mono_thread_get_managed_id</a></h4>
<h4><a name="api:mono_thread_get_name_utf8">mono_thread_get_name_utf8</a></h4>
<h4><a name="api:mono_thread_is_foreign">mono_thread_is_foreign</a></h4>
<h4><a name="api:mono_thread_manage">mono_thread_manage</a></h4>
<h4><a name="api:mono_thread_new_init">mono_thread_new_init</a></h4>
<h4><a name="api:mono_threads_get_default_stacksize">mono_threads_get_default_stacksize</a></h4>
<h4><a name="api:mono_threads_install_cleanup">mono_threads_install_cleanup</a></h4>
<h4><a name="api:mono_threads_set_default_stacksize">mono_threads_set_default_stacksize</a></h4>
<h4><a name="api:mono_thread_set_manage_callback">mono_thread_set_manage_callback</a></h4>
<h4><a name="api:mono_thread_stop">mono_thread_stop</a></h4>
<h4><a name="api:mono_thread_get_main">mono_thread_get_main</a></h4>
<h4><a name="api:mono_thread_set_main">mono_thread_set_main</a></h4>
<h4><a name="api:mono_pthread_key_for_tls">mono_pthread_key_for_tls</a></h4>
<h3>Monitors</h3>
<h4><a name="api:mono_monitor_enter">mono_monitor_enter</a></h4>
<h4><a name="api:mono_monitor_enter_v4">mono_monitor_enter_v4</a></h4>
<h4><a name="api:mono_monitor_exit">mono_monitor_exit</a></h4>
<h4><a name="api:mono_monitor_try_enter">mono_monitor_try_enter</a></h4>
<h3>Initialization and Shutdown</h3>
<h4><a name="api:mono_thread_cleanup">mono_thread_cleanup</a></h4>
<h4><a name="api:mono_thread_detach_if_exiting">mono_thread_detach_if_exiting</a></h4>
<h4><a name="api:mono_thread_init">mono_thread_init</a></h4>
+6 -2
View File
@@ -2,7 +2,7 @@
<h3>Synopsis</h3>
<div class="header">
<div class="mapi-header">
#include &lt;metadata/metadata.h&gt;
#include &lt;metadata/class.h&gt;
@@ -19,13 +19,17 @@ typedef struct _MonoType MonoType;
<h4><a name="api:mono_type_full_name">mono_type_full_name</a></h4>
<h4><a name="api:mono_type_get_array_type">mono_type_get_array_type</a></h4>
<h4><a name="api:mono_type_get_class">mono_type_get_class</a></h4>
<h4><a name="api:mono_type_get_desc">mono_type_get_desc</a></h4>
<h4><a name="api:mono_type_get_modifiers">mono_type_get_modifiers</a></h4>
<h4><a name="api:mono_type_get_name">mono_type_get_name</a></h4>
<h4><a name="api:mono_type_get_ptr_type">mono_type_get_ptr_type</a></h4>
<h4><a name="api:mono_type_get_signature">mono_type_get_signature</a></h4>
<h4><a name="api:mono_type_get_type">mono_type_get_type</a></h4>
<h4><a name="api:mono_type_get_underlying_type">mono_type_get_underlying_type</a></h4>
<h4><a name="api:mono_type_is_byref">mono_type_is_byref</a></h4>
<h4><a name="api:mono_type_is_pointer">mono_type_is_pointer</a></h4>
<h4><a name="api:mono_type_is_reference">mono_type_is_reference</a></h4>
<h4><a name="api:mono_type_is_struct">mono_type_is_struct</a></h4>
<h4><a name="api:mono_type_is_void">mono_type_is_void</a></h4>
<h4><a name="api:mono_type_size">mono_type_size</a></h4>
<h4><a name="api:mono_type_stack_size">mono_type_stack_size</a></h4>
<h4><a name="api:mono_type_to_unmanaged">mono_type_to_unmanaged</a></h4>
-9
View File
@@ -5,8 +5,6 @@
<h4><a name="api:mono_compile_method">mono_compile_method</a></h4>
<h4><a name="api:mono_config_for_assembly">mono_config_for_assembly</a></h4>
<h4><a name="api:mono_dllmap_insert">mono_dllmap_insert</a></h4>
<h4><a name="api:mono_environment_exitcode_get">mono_environment_exitcode_get</a></h4>
<h4><a name="api:mono_environment_exitcode_set">mono_environment_exitcode_set</a></h4>
<h4><a name="api:mono_free_method">mono_free_method</a></h4>
<h4><a name="api:mono_free_verify_list">mono_free_verify_list</a></h4>
<h4><a name="api:mono_get_config_dir">mono_get_config_dir</a></h4>
@@ -15,13 +13,8 @@
<h4><a name="api:mono_get_method_full">mono_get_method_full</a></h4>
<h4><a name="api:mono_get_method">mono_get_method</a></h4>
<h4><a name="api:mono_get_root_domain">mono_get_root_domain</a></h4>
<h4><a name="api:mono_init_from_assembly">mono_init_from_assembly</a></h4>
<h4><a name="api:mono_init">mono_init</a></h4>
<h4><a name="api:mono_init_version">mono_init_version</a></h4>
<h4><a name="api:mono_jit_exec">mono_jit_exec</a></h4>
<h4><a name="api:mono_lookup_internal_call">mono_lookup_internal_call</a></h4>
<h4><a name="api:mono_lookup_pinvoke_call">mono_lookup_pinvoke_call</a></h4>
<h4><a name="api:mono_main">mono_main</a></h4>
<h4><a name="api:mono_parse_default_optimizations">mono_parse_default_optimizations</a></h4>
<h4><a name="api:mono_ptr_class_get">mono_ptr_class_get</a></h4>
<h4><a name="api:mono_register_bundled_assemblies">mono_register_bundled_assemblies</a></h4>
@@ -34,6 +27,4 @@
<h4><a name="api:mono_runtime_quit">mono_runtime_quit</a></h4>
<h4><a name="api:mono_runtime_run_main">mono_runtime_run_main</a></h4>
<h4><a name="api:mono_table_info_get_rows">mono_table_info_get_rows</a></h4>
<h4><a name="api:mono_upgrade_remote_class_wrapper">mono_upgrade_remote_class_wrapper</a></h4>
<h4><a name="api:mono_verify_corlib">mono_verify_corlib</a></h4>
<h4><a name="api:mono_vtable_get_static_field_data">mono_vtable_get_static_field_data</a></h4>
+1 -108
View File
@@ -1,111 +1,5 @@
<h2>Utility Methods</h2>
<h3>Bitsets</h3>
<p>MonoBitsets are a set of routines used to manipulate sets
of bits.
<h4><a name="api:mono_bitset_alloc_size">mono_bitset_alloc_size</a></h4>
<h4><a name="api:mono_bitset_clear">mono_bitset_clear</a></h4>
<h4><a name="api:mono_bitset_clear_all">mono_bitset_clear_all</a></h4>
<h4><a name="api:mono_bitset_clone">mono_bitset_clone</a></h4>
<h4><a name="api:mono_bitset_copyto">mono_bitset_copyto</a></h4>
<h4><a name="api:mono_bitset_count">mono_bitset_count</a></h4>
<h4><a name="api:mono_bitset_equal">mono_bitset_equal</a></h4>
<h4><a name="api:mono_bitset_find_first">mono_bitset_find_first</a></h4>
<h4><a name="api:mono_bitset_find_last">mono_bitset_find_last</a></h4>
<h4><a name="api:mono_bitset_find_start">mono_bitset_find_start</a></h4>
<h4><a name="api:mono_bitset_foreach">mono_bitset_foreach</a></h4>
<h4><a name="api:mono_bitset_free">mono_bitset_free</a></h4>
<h4><a name="api:mono_bitset_intersection">mono_bitset_intersection</a></h4>
<h4><a name="api:mono_bitset_invert">mono_bitset_invert</a></h4>
<h4><a name="api:mono_bitset_mem_new">mono_bitset_mem_new</a></h4>
<h4><a name="api:mono_bitset_new">mono_bitset_new</a></h4>
<h4><a name="api:mono_bitset_set">mono_bitset_set</a></h4>
<h4><a name="api:mono_bitset_set_all">mono_bitset_set_all</a></h4>
<h4><a name="api:mono_bitset_size">mono_bitset_size</a></h4>
<h4><a name="api:mono_bitset_sub">mono_bitset_sub</a></h4>
<h4><a name="api:mono_bitset_test">mono_bitset_test</a></h4>
<h4><a name="api:mono_bitset_test_bulk">mono_bitset_test_bulk</a></h4>
<h4><a name="api:mono_bitset_union">mono_bitset_union</a></h4>
<h4><a name="api:mono_bitset_find_first_unset">mono_bitset_find_first_unset</a></h4>
<h4><a name="api:mono_bitset_intersection_2">mono_bitset_intersection_2</a></h4>
<h3>Hashtables</h3>
<p><tt>GHashTable</tt> is used when you need to store object
references into a hashtable, objects stored in a
<tt>MonoGHashTable</tt> are properly tracked by the garbage
collector.
<p>The <tt>MonoGHashTable</tt> data type has the same API as
the GLIB.
<h4><a name="api:mono_g_hash_table_destroy">mono_g_hash_table_destroy</a></h4>
<h4><a name="api:mono_g_hash_table_foreach">mono_g_hash_table_foreach</a></h4>
<h4><a name="api:mono_g_hash_table_foreach_remove">mono_g_hash_table_foreach_remove</a></h4>
<h4><a name="api:mono_g_hash_table_foreach_steal">mono_g_hash_table_foreach_steal</a></h4>
<h4><a name="api:mono_g_hash_table_insert">mono_g_hash_table_insert</a></h4>
<h4><a name="api:mono_g_hash_table_lookup">mono_g_hash_table_lookup</a></h4>
<h4><a name="api:mono_g_hash_table_lookup_extended">mono_g_hash_table_lookup_extended</a></h4>
<h4><a name="api:mono_g_hash_table_new">mono_g_hash_table_new</a></h4>
<h4><a name="api:mono_g_hash_table_new_full">mono_g_hash_table_new_full</a></h4>
<h4><a name="api:mono_g_hash_table_remap">mono_g_hash_table_remap</a></h4>
<h4><a name="api:mono_g_hash_table_remove">mono_g_hash_table_remove</a></h4>
<h4><a name="api:mono_g_hash_table_replace">mono_g_hash_table_replace</a></h4>
<h4><a name="api:mono_g_hash_table_size">mono_g_hash_table_size</a></h4>
<h4><a name="api:mono_g_hash_table_steal">mono_g_hash_table_steal</a></h4>
<h3>SHA1 Signatures</h3>
<h4><a name="api:mono_sha1_init">mono_sha1_init</a></h4>
<h4><a name="api:mono_sha1_update">mono_sha1_update</a></h4>
<h4><a name="api:mono_sha1_get_digest_from_file">mono_sha1_get_digest_from_file</a></h4>
<h4><a name="api:mono_sha1_get_digest">mono_sha1_get_digest</a></h4>
<h4><a name="api:mono_sha1_final">mono_sha1_final</a></h4>
<h3>MD5 Signatures</h3>
<h4><a name="api:mono_md5_init">mono_md5_init</a></h4>
<h4><a name="api:mono_md5_update">mono_md5_update</a></h4>
<h4><a name="api:mono_md5_get_digest_from_file">mono_md5_get_digest_from_file</a></h4>
<h4><a name="api:mono_md5_get_digest">mono_md5_get_digest</a></h4>
<h4><a name="api:mono_md5_final">mono_md5_final</a></h4>
<h4><a name="api:mono_digest_get_public_token">mono_digest_get_public_token</a></h4>
<h3>Memory Pools</h3>
<p>Memory pools are a convenient way of tracking memory
allocations that are used for one specific task, they are also
faster than using the standard memory allocation procedures,
as they are designed to be used only by a single thread at a
time.
<p><tt>MonoMemPool</tt> objects are not thread safe, which
means that you should not share the objects across multiple
threads without providing proper locking around it (unlike
<tt>malloc</tt> and <tt>free</tt> which are thread safe).
<p>When a <tt>MonoMemPool</tt> is released with
<tt>mono_mempool_destroy</tt> all of the of the memory
allocated from that memory pool with
<tt>mono_mempool_alloc</tt> and <tt>mono_mempool_alloc0</tt>
is released.
<h4><a name="api:mono_mempool_new">mono_mempool_new</a></h4>
<h4><a name="api:mono_mempool_destroy">mono_mempool_destroy</a></h4>
<h4><a name="api:mono_mempool_alloc">mono_mempool_alloc</a></h4>
<h4><a name="api:mono_mempool_alloc0">mono_mempool_alloc0</a></h4>
<h4><a name="api:mono_mempool_empty">mono_mempool_empty</a></h4>
<h4><a name="api:mono_mempool_invalidate">mono_mempool_invalidate</a></h4>
<h4><a name="api:mono_mempool_stats">mono_mempool_stats</a></h4>
<h4><a name="api:mono_mempool_contains_addr">mono_mempool_contains_addr</a></h4>
<h3>JIT utilities</h3>
<h4><a name="api:mono_signbit_double">mono_signbit_double</a></h4>
<h4><a name="api:mono_signbit_float">mono_signbit_float</a></h4>
<h3>Disassembling Generated Code</h3>
@@ -116,11 +10,10 @@
<h3>Walking the Stack</h3>
<h4><a name="api:mono_walk_stack">mono_walk_stack</a></h4>
<h4><a name="api:mono_stack_walk_no_il">mono_stack_walk_no_il</a></h4>
<h4><a name="api:mono_stack_walk_async_safe">mono_stack_walk_async_safe</a></h4>
<h3>Others</h3>
<h4><a name="api:mono_escape_uri_string">mono_escape_uri_string</a></h4>
<h4><a name="api:mono_guid_to_string">mono_guid_to_string</a></h4>
+18 -36
View File
@@ -12,6 +12,12 @@
<param name="Local" value="DoesNotExist"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Embedding Mono"/>
<param name="Local" value="deploy/mono-api-embedding.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Assemblies"/>
@@ -48,30 +54,12 @@
<param name="Local" value="deploy/mono-api-class.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Code Generation"/>
<param name="Local" value="deploy/mono-api-codegen.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Decimal Representation"/>
<param name="Local" value="deploy/mono-api-decimal.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Application Domains"/>
<param name="Local" value="deploy/mono-api-domains.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Dynamic Code Generation"/>
<param name="Local" value="deploy/mono-api-dynamic-codegen.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Exceptions"/>
@@ -90,24 +78,12 @@
<param name="Local" value="deploy/mono-api-gc.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Embedding Mono"/>
<param name="Local" value="deploy/mono-api-embedding.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Just in Time Compiler"/>
<param name="Local" value="deploy/mono-api-jit.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Marshalling"/>
<param name="Local" value="deploy/mono-api-marshal.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Metadata access"/>
@@ -140,12 +116,6 @@
</object>
</li>
-->
<li>
<object type="text/sitemap">
<param name="Name" value="JIT Counters"/>
<param name="Local" value="deploy/mono-api-counters.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Types"/>
@@ -182,12 +152,24 @@
<param name="Local" value="deploy/mono-api-utils.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="JIT Counters"/>
<param name="Local" value="deploy/mono-api-counters.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Unsorted"/>
<param name="Local" value="deploy/mono-api-unsorted.html"/>
</object>
</li>
<li>
<object type="text/sitemap">
<param name="Name" value="Internal: Dynamic Code Generation"/>
<param name="Local" value="deploy/mono-api-dynamic-codegen.html"/>
</object>
</li>
</ul>
</body>
</html>
-22
View File
@@ -1,22 +0,0 @@
/
/depcomp
/config.guess
/config.sub
/ltmain.sh
/eglib-*.tar.gz
/missing
/install-sh
/compile
/Makefile
/Makefile.in
/stamp-h1
/config.h.in
/libtool
/autom4te.cache
/aclocal.m4
/config.log
/configure
/config.h
/config.status
/INSTALL
dolt*
-17
View File
@@ -1,17 +0,0 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-1564
View File
File diff suppressed because it is too large. Load diff
-19
View File
@@ -1,19 +0,0 @@
ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = $(WERROR_CFLAGS)
if HOST_WIN32
SUBDIRS = m4 src
else
if PLATFORM_DARWIN
SUBDIRS = m4 src
else
if CROSS_COMPILING
SUBDIRS = m4 src
else
SUBDIRS = m4 src test
endif
endif
endif
EXTRA_DIST = autogen.sh README NEWS AUTHORS ChangeLog winconfig.h
-54
View File
@@ -1,54 +0,0 @@
The purpose of eglib is to be an X11-licensed subset of glib that can
be used with Mono when the Mono runtime is explicitly relicensed under
a different license by Novell.
The implementation is done from the public documentation available here:
http://developer.gnome.org/doc/API/2.0/glib/
Currently this is only being built standalone, use:
./autogen.sh --prefix=/tmp/test
Currently all the definitions go into a single file: glib.h, there are
no separate files, please try to follow the convetions in the source code
* Tests
Please read the README in tests/
* Features
The source code is designed to allow for different operating
system builds of the eglib code.
Files in src that:
* Have a plain name: are cross platform, and should work on
every operating system.
* That end in -unix.c: These files contain Unix specific code.
* That end in -win32.c: These files contain Win32 specific code.
* That end in -posix.c: Will work on both Windows and Unix,
but should not be included for other operating systems.
* Plans: short and long term.
The short term plans for eglib is to allow Mono to optionally
build with it instead of using glib, gmodule and gthread, but
the default build will continue to be done against glib 2.0.
In the long-term we are considering dropping glib as a
dependency, considering that Mono requires a modern Unix
system to run anyways (for its thread support) it would allow
us to fix some of the glib API limitations we have to live
with (explicit thread support for example), rework the API to
use types from stdint.h and we would be able to drop three
external shared libraries.
This would reduce memory usage for the handful of routines
that we use from glib, dynamic linker overhead for those and
would allow us to tune the implementation to Mono's needs.
-33
View File
@@ -1,33 +0,0 @@
* Missing code
* Process launching
3 g_shell_quote
1 g_shell_unquote
----------------------------------------------------------------------
* Should implement, for better performance:
Macros:
6 G_UNLIKELY
4 G_LIKELY
* Unimplemented, not supported currently:
(none as yet.)
* Dead Code
The GMainLoop code was no longer in use in Mono.
* Windows implementations needed
Directory, File manipulation:
g_dir_open, g_dir_close, g_dir_read_name
We're missing a native windows implementation. The unix one is in place.
* Information retrieval
1 g_win32_getlocale
-182
View File
@@ -1,182 +0,0 @@
dnl dolt, a replacement for libtool
dnl Copyright © 2007-2008 Josh Triplett <[email protected]>
dnl Copying and distribution of this file, with or without modification,
dnl are permitted in any medium without royalty provided the copyright
dnl notice and this notice are preserved.
dnl
dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
dnl installed when running autoconf on your project.
AC_DEFUN([DOLT], [
AC_REQUIRE([AC_CANONICAL_HOST])
# dolt, a replacement for libtool
# Josh Triplett <[email protected]>
AC_PATH_PROG(DOLT_BASH, bash)
AC_MSG_CHECKING([if dolt supports this host])
dolt_supported=yes
if test x$DOLT_BASH = x; then
dolt_supported=no
fi
if test x$GCC != xyes; then
dolt_supported=no
fi
case $host in
i?86-*-linux*|i?86-apple-darwin*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-linux* \
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*|x86_64-apple-darwin*|aarch64*)
pic_options='-fPIC'
;;
?86-pc-cygwin*|i?86-pc-cygwin*|i?86-pc-mingw32*)
pic_options='-DDLL_EXPORT'
;;
i?86-apple-darwin*|arm-apple-darwin*)
pic_options='-fno-common'
;;
*)
dolt_supported=no
;;
esac
if test x$dolt_supported = xno ; then
AC_MSG_RESULT([no, falling back to libtool])
LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
else
AC_MSG_RESULT([yes, replacing libtool])
dnl Start writing out doltcompile.
cat <<__DOLTCOMPILE__EOF__ >doltcompile
#!$DOLT_BASH
__DOLTCOMPILE__EOF__
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
args=("$[]@")
for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
if test x"${args@<:@$arg@:>@}" = x-o ; then
objarg=$((arg+1))
break
fi
done
if test x$objarg = x ; then
echo 'Error: no -o on compiler command line' 1>&2
exit 1
fi
lo="${args@<:@$objarg@:>@}"
obj="${lo%.lo}"
if test x"$lo" = x"$obj" ; then
echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
exit 1
fi
objbase="${obj##*/}"
__DOLTCOMPILE__EOF__
dnl Write out shared compilation code.
if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
libobjdir="${obj%$objbase}.libs"
if test ! -d "$libobjdir" ; then
mkdir_out="$(mkdir "$libobjdir" 2>&1)"
mkdir_ret=$?
if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
echo "$mkdir_out" 1>&2
exit $mkdir_ret
fi
fi
pic_object="$libobjdir/$objbase.o"
args@<:@$objarg@:>@="$pic_object"
__DOLTCOMPILE__EOF__
cat <<__DOLTCOMPILE__EOF__ >>doltcompile
"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
__DOLTCOMPILE__EOF__
fi
dnl Write out static compilation code.
dnl Avoid duplicate compiler output if also building shared objects.
if test x$enable_static = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
non_pic_object="$obj.o"
args@<:@$objarg@:>@="$non_pic_object"
__DOLTCOMPILE__EOF__
if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
"${args@<:@@@:>@}" || exit $?
__DOLTCOMPILE__EOF__
fi
fi
dnl Write out the code to write the .lo file.
dnl The second line of the .lo file must match "^# Generated by .*libtool"
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
{
echo "# $lo - a libtool object file"
echo "# Generated by doltcompile, not libtool"
__DOLTCOMPILE__EOF__
if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo "pic_object='.libs/${objbase}.o'"
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo pic_object=none
__DOLTCOMPILE__EOF__
fi
if test x$enable_static = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo "non_pic_object='${objbase}.o'"
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo non_pic_object=none
__DOLTCOMPILE__EOF__
fi
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
} > "$lo"
__DOLTCOMPILE__EOF__
dnl Done writing out doltcompile; substitute it for libtool compilation.
chmod +x doltcompile
LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'
dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
dnl a target, so write out a libtool wrapper to handle that case.
dnl Note that doltlibtool does not handle inferred tags or option arguments
dnl without '=', because automake does not use them.
cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
#!$DOLT_BASH
__DOLTLIBTOOL__EOF__
cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
top_builddir_slash="${0%%doltlibtool}"
: ${top_builddir_slash:=./}
args=()
modeok=false
tagok=false
for arg in "$[]@"; do
case "$arg" in
--silent) ;;
--mode=compile) modeok=true ;;
--tag=CC|--tag=CXX) tagok=true ;;
--quiet) ;;
*) args@<:@${#args[@]}@:>@="$arg" ;;
esac
done
if $modeok && $tagok ; then
. ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
else
exec ${top_builddir_slash}libtool "$[]@"
fi
__DOLTLIBTOOL__EOF__
dnl Done writing out doltlibtool; substitute it for libtool.
chmod +x doltlibtool
LIBTOOL='$(top_builddir)/doltlibtool'
fi
AC_SUBST(LTCOMPILE)
AC_SUBST(LTCXXCOMPILE)
# end dolt
])
-136
View File
@@ -1,136 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
# Ripped off from GNOME macros version
DIE=0
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
if [ -n "$MONO_PATH" ]; then
# from -> /mono/lib:/another/mono/lib
# to -> /mono /another/mono
for i in `echo ${MONO_PATH} | tr ":" " "`; do
i=`dirname ${i}`
if [ -n "{i}" -a -d "${i}/share/aclocal" ]; then
ACLOCAL_FLAGS="-I ${i}/share/aclocal $ACLOCAL_FLAGS"
fi
if [ -n "{i}" -a -d "${i}/bin" ]; then
PATH="${i}/bin:$PATH"
fi
done
export PATH
fi
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed to compile Mono."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
if [ -z "$LIBTOOL" ]; then
LIBTOOL=`which glibtool 2>/dev/null`
if [ ! -x "$LIBTOOL" ]; then
LIBTOOL=`which libtool`
fi
fi
(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed to compile Mono."
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && {
grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
(gettext --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`gettext' installed to compile Mono."
echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed to compile Mono."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
NO_AUTOMAKE=yes
}
# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed doesn't appear recent enough."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
if test x$NOCONFIGURE = x && test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
case $CC in
xlc )
am_opt=--include-deps;;
esac
if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
if test -z "$NO_LIBTOOLIZE" ; then
echo "Running libtoolize..."
${LIBTOOL}ize --force --copy
fi
fi
echo "Running aclocal -I m4 $ACLOCAL_FLAGS ..."
aclocal -I m4 $ACLOCAL_FLAGS || {
echo
echo "**Error**: aclocal failed. This may mean that you have not"
echo "installed all of the packages you need, or you may need to"
echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
echo "for the prefix where you installed the packages whose"
echo "macros were not found"
exit 1
}
if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then
echo "Running autoheader..."
autoheader || { echo "**Error**: autoheader failed."; exit 1; }
fi
echo "Running automake --gnu $am_opt ..."
automake --add-missing --gnu $am_opt ||
{ echo "**Error**: automake failed."; exit 1; }
echo "Running autoconf ..."
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
conf_flags="--enable-maintainer-mode" #--enable-compile-warnings --enable-iso-c
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" \
&& echo Now type \`make\' to compile $PKG_NAME || exit 1
else
echo Skipping configure process.
fi
-672
View File
@@ -1,672 +0,0 @@
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2010 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <[email protected]>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Code taken from libtool.m4's _LT_CC_BASENAME.
for cc_temp in $CC""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's _LT_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix*)
wl='-Wl,'
;;
darwin*)
case $cc_basename in
xlc*)
wl='-Wl,'
;;
esac
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
newsos6)
;;
linux* | k*bsd*-gnu)
case $cc_basename in
ecc*)
wl='-Wl,'
;;
icc* | ifort*)
wl='-Wl,'
;;
lf95*)
wl='-Wl,'
;;
pgcc | pgf77 | pgf90)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
wl='-Wl,'
;;
esac
;;
esac
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
wl='-Wl,'
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
wl='-Wl,'
;;
sysv4*MP*)
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
wl='-Wl,'
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in
aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# Samuel A. Falvo II <[email protected]> reports
# that the semantics of dynamic libraries on AmigaOS, at least up
# to version 4, is to share data among multiple programs linked
# with the same dynamic library. Since this doesn't match the
# behavior of shared libraries on other platforms, we cannot use
# them.
ld_shlibs=no
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32* | cegcc*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
else
ld_shlibs=no
fi
;;
esac
;;
sunos4*)
hardcode_direct=yes
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = no; then
hardcode_libdir_flag_spec=
fi
else
case "$host_os" in
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
fi
hardcode_direct=yes
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
hardcode_direct=unsupported
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# see comment about different semantics on the GNU ld section
ld_shlibs=no
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=no
if test "$GCC" = yes ; then
:
else
case $cc_basename in
xlc*)
;;
*)
ld_shlibs=no
;;
esac
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd1*)
ld_shlibs=no
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
freebsd2*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
hpux10*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
hpux11*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
;;
*)
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
newsos6)
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
case "$host_os" in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
else
ld_shlibs=no
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*)
if test "$GCC" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
sysv4)
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
;;
sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
hardcode_libdir_separator=':'
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
aix3*)
library_names_spec='$libname.a'
;;
aix[4-9]*)
library_names_spec='$libname$shrext'
;;
amigaos*)
library_names_spec='$libname.a'
;;
beos*)
library_names_spec='$libname$shrext'
;;
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
cygwin* | mingw* | pw32* | cegcc*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
darwin* | rhapsody*)
shrext=.dylib
library_names_spec='$libname$shrext'
;;
dgux*)
library_names_spec='$libname$shrext'
;;
freebsd1*)
;;
freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
library_names_spec='$libname$shrext$versuffix' ;;
*)
library_names_spec='$libname$shrext' ;;
esac
;;
gnu*)
library_names_spec='$libname$shrext'
;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
shrext=.so
;;
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
library_names_spec='$libname$shrext'
;;
interix[3-9]*)
library_names_spec='$libname$shrext'
;;
irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
linux* | k*bsd*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
library_names_spec='$libname$shrext'
;;
netbsd*)
library_names_spec='$libname$shrext'
;;
newsos6)
library_names_spec='$libname$shrext'
;;
nto-qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
library_names_spec='$libname$shrext$versuffix'
;;
os2*)
libname_spec='$name'
shrext=.dll
library_names_spec='$libname.a'
;;
osf3* | osf4* | osf5*)
library_names_spec='$libname$shrext'
;;
rdos*)
;;
solaris*)
library_names_spec='$libname$shrext'
;;
sunos4*)
library_names_spec='$libname$shrext$versuffix'
;;
sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;;
sysv4*MP*)
library_names_spec='$libname$shrext'
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
uts4*)
library_names_spec='$libname$shrext'
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
# Static library suffix (normally "a").
libext="$libext"
# Shared library suffix (normally "so").
shlibext="$shlibext"
# Format of library name prefix.
libname_spec="$escaped_libname_spec"
# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
EOF
-264
View File
@@ -1,264 +0,0 @@
#
# Copyright 2012 Xamarin Inc
#
AC_INIT(eglib, [0.3],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip foreign])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_PROG_CC
AM_PROG_LIBTOOL
# Use dolt (http://dolt.freedesktop.org/) instead of libtool for building.
DOLT
GNUC_PRETTY=
GNUC_UNUSED=
BREAKPOINT="G_STMT_START { raise (SIGTRAP); } G_STMT_END"
if test x$GCC = xyes; then
GNUC_UNUSED='__attribute__((__unused__))'
GNUC_NORETURN='__attribute__((__noreturn__))'
case $host_cpu in
i*86|x86_64) BREAKPOINT="G_STMT_START { __asm__ (\"int \$03\"); } G_STMT_END" ;;
esac
fi
AC_SUBST(GNUC_PRETTY)
AC_SUBST(GNUC_UNUSED)
AC_SUBST(GNUC_NORETURN)
AC_SUBST(BREAKPOINT)
# We use a separate variable to pass down CPPFLAGS and CFLAGS from the main mono
# configure, because of autoconf brokeness
if test "x$CPPFLAGS_FOR_EGLIB" != "x"; then
CPPFLAGS=$CPPFLAGS_FOR_EGLIB
fi
if test "x$CFLAGS_FOR_EGLIB" != "x"; then
CFLAGS=$CFLAGS_FOR_EGLIB
fi
CFLAGS="$CFLAGS -g -D_GNU_SOURCE"
AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
platform_darwin=no
platform_android=no
case $host in
*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
PATHSEP='\\'
SEARCHSEP=';'
OS="WIN32"
PIDTYPE='void *'
;;
*-*darwin*)
platform_darwin=yes
PATHSEP='/'
SEARCHSEP=':'
OS="UNIX"
PIDTYPE='int'
;;
*-*-linux-android*)
platform_android=yes
AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
PATHSEP='/'
SEARCHSEP=':'
OS="UNIX"
PIDTYPE='int'
;;
*)
PATHSEP='/'
SEARCHSEP=':'
OS="UNIX"
PIDTYPE='int'
;;
esac
case $host in
*-*-solaris*)
CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"
;;
esac
case $target in
arm*-darwin*|aarch64*-*)
CFLAGS="$CFLAGS -U_FORTIFY_SOURCE"
;;
i*86-*-darwin*)
ORDER=G_LITTLE_ENDIAN
;;
*-*-openbsd*)
CFLAGS="$CFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
;;
esac
target_osx=no
target_ios=no
if test "x$platform_darwin" = "xyes"; then
AC_TRY_COMPILE([#include "TargetConditionals.h"],[
#if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
#error fail this for ios
#endif
return 0;
], [
AC_DEFINE(TARGET_OSX,1,[The JIT/AOT targets OSX])
target_osx=yes
], [
AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
target_ios=yes
])
AC_DEFINE(TARGET_MACH,1,[The JIT/AOT targets Apple platforms])
fi
AC_SUBST(ORDER)
AC_SUBST(CFLAGS)
AC_SUBST(PATHSEP)
AC_SUBST(SEARCHSEP)
AC_SUBST(OS)
AC_SUBST(PIDTYPE)
AM_CONDITIONAL(HOST_WIN32, test x$OS = xWIN32)
AM_CONDITIONAL(TARGET_WIN32, test x$OS = xWIN32)
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf)
AC_CHECK_FUNCS(getrlimit)
AC_CHECK_FUNCS(fork execv execve)
#
# Mono currently supports 10.6, but strndup is not available prior to 10.7; avoiding
# the detection of strndup on OS X so Mono built on 10.7+ still runs on 10.6. This can be
# removed once support for 10.6 is dropped.
#
# iOS detection of strndup and getpwuid_r is faulty for some reason so let's simply avoid it
#
if test x$target_osx = xyes; then
AC_CHECK_FUNCS(getpwuid_r)
elif test x$target_ios = xno; then
AC_CHECK_FUNCS(strndup getpwuid_r)
fi
AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno )
AM_ICONV()
AC_SEARCH_LIBS(sqrtf, m)
# nanosleep may not be part of libc, also search it in other libraries
AC_SEARCH_LIBS(nanosleep, rt)
AC_SEARCH_LIBS(dlopen, dl)
old_ldflags="${LDFLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
AC_TRY_LINK(, [int i;], found_export_dynamic=yes, found_export_dynamic=no)
if test $found_export_dynamic = no; then
LDFLAGS="${old_ldflags}"
fi
AC_MSG_CHECKING(for varargs macros)
AC_TRY_COMPILE([],[
int foo (int i, int j);
#define bar(...) foo (1, __VA_ARGS__)
void main () {
bar (2);
}
],have_iso_varargs=yes,have_iso_varargs=no)
AC_MSG_RESULT($have_iso_varargs)
G_HAVE_ISO_VARARGS=0
if test "x$have_iso_varargs" = "xyes"; then
G_HAVE_ISO_VARARGS=1
fi
AC_SUBST(G_HAVE_ISO_VARARGS)
AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h sys/types.h sys/resource.h)
AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+="-liconv -lcharset"])])
AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
AC_SUBST(HAVE_ALLOCA_H)
if test $ac_cv_sizeof_void_p = $ac_cv_sizeof_int; then
GPOINTER_TO_INT="((gint) (ptr))"
GPOINTER_TO_UINT="((guint) (ptr))"
GINT_TO_POINTER="((gpointer) (v))"
GUINT_TO_POINTER="((gpointer) (v))"
GSIZE="int"
GSIZE_FORMAT='"u"'
G_GUINT64_FORMAT='"llu"'
G_GINT64_FORMAT='"lld"'
G_GUINT32_FORMAT='"lu"'
G_GINT32_FORMAT='"ld"'
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long; then
GPOINTER_TO_INT="((gint)(long) (ptr))"
GPOINTER_TO_UINT="((guint)(long) (ptr))"
GINT_TO_POINTER="((gpointer)(glong) (v))"
GUINT_TO_POINTER="((gpointer)(gulong) (v))"
GSIZE="long"
GSIZE_FORMAT='"lu"'
G_GUINT64_FORMAT='"lu"'
G_GINT64_FORMAT='"ld"'
G_GUINT32_FORMAT='"u"'
G_GINT32_FORMAT='"d"'
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long_long; then
GPOINTER_TO_INT="((gint)(long long) (ptr))"
GPOINTER_TO_UINT="((guint)(unsigned long long) (ptr))"
GINT_TO_POINTER="((gpointer)(long long) (v))"
GUINT_TO_POINTER="((gpointer)(unsigned long long) (v))"
GSIZE="long long"
GSIZE_FORMAT='"I64u"'
G_GUINT64_FORMAT='"I64u"'
G_GINT64_FORMAT='"I64i"'
G_GUINT32_FORMAT='"I32u"'
G_GINT32_FORMAT='"I32i"'
else
AC_MSG_ERROR([unsupported pointer size])
fi
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
pkg_config_path=
AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir Change pkg-config dir to custom dir],
if test x$with_crosspkgdir = "x"; then
if test -s $PKG_CONFIG_PATH; then
pkg_config_path=$PKG_CONFIG_PATH
fi
else
pkg_config_path=$with_crosspkgdir
PKG_CONFIG_PATH=$pkg_config_path
export PKG_CONFIG_PATH
fi
)
AC_ARG_ENABLE(werror, [ --enable-werror Pass -Werror to the C compiler], werror_flag=$enableval, werror_flag=no)
if test x$werror_flag = xyes; then
WERROR_CFLAGS="-Werror"
fi
AC_SUBST([WERROR_CFLAGS])
AC_SUBST(GPOINTER_TO_INT)
AC_SUBST(GPOINTER_TO_UINT)
AC_SUBST(GINT_TO_POINTER)
AC_SUBST(GUINT_TO_POINTER)
AC_SUBST(GSIZE)
AC_SUBST(GSIZE_FORMAT)
AC_SUBST(G_GUINT64_FORMAT)
AC_SUBST(G_GINT64_FORMAT)
AC_SUBST(G_GUINT32_FORMAT)
AC_SUBST(G_GINT32_FORMAT)
AC_OUTPUT([
Makefile
m4/Makefile
src/Makefile
src/eglib-config.h
test/Makefile
])
Loaded 100 of 21052 files, more files were not shown because too many files have changed in this diff. Show more