Compare commits

...
2907 Commits
Author SHA1 Message Date
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
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 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
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 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
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
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
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
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
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
Matthias Mailänder bec6f78249 reference libgdiplus with the proper .so name 2016-01-04 21:58:11 +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
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
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
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
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
15729 changed files with 3856245 additions and 124778 deletions

No files matched your search

+1
View File
@@ -38,6 +38,7 @@ obj/
[Rr]elease*/
Ankh.NoLoad
*.gpState
.vscode/
# Tooling
_ReSharper*/
+6 -4
View File
@@ -20,10 +20,6 @@
[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
@@ -33,3 +29,9 @@
[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/buildtools"]
path = external/buildtools
url = git://github.com/mono/buildtools.git
+6 -17
View File
@@ -21,29 +21,18 @@ 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.
For other parts of the project that are dual-licensed, please state
on your commit(s) what license you are contributing the changes under.
Contributions are now taken under the [.NET Foundation CLA] (https://cla2.dotnetfoundation.org/).
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.
+1406 -102
View File
File diff suppressed because it is too large. Load diff
+22 -9
View File
@@ -4,18 +4,17 @@ AM_CFLAGS = $(WERROR_CFLAGS)
MONOTOUCH_SUBDIRS = $(libgc_dir) eglib/src 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) acceptance-tests
# 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 acceptance-tests
tools_dir =
else
SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) acceptance-tests
# 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 acceptance-tests
tools_dir = tools
endif
SUBDIRS = po $(libgc_dir) eglib 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) eglib 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'
@@ -32,7 +31,8 @@ EXTRA_DIST= \
mono-uninstalled.pc.in \
winconfig.h \
code_of_conduct.md \
external
external \
mcs/class/referencesource
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
@@ -67,6 +67,14 @@ get-monolite-latest:
cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
cd $(mcslib) && mv -f monolite-* monolite
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
$(MAKE) mcs-do-tests
@@ -152,6 +160,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
@@ -163,3 +172,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.
+52 -17
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)
@@ -17,28 +19,30 @@ standards for C# and the Common Language Runtime.
Officially supported architectures:
| 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] |
| ubuntu-1404-amd64 | ubuntu-1404-i386 | debian-8-armel | debian-8-armhf | debian-8-arm64 | windows-amd64 |
|------------------------------|-----------------------------|---------------------------|---------------------------|-----------------------------|----------------------------|
| [![ubuntu-1404-amd64][1]][2] | [![ubuntu-1404-i386][3]][4] | [![debian-8-armel][5]][6] | [![debian-8-armhf][7]][8] | [![debian-8-arm64][9]][10] | [![windows-amd64][11]][12] |
Community supported architectures:
| centos-s390x |
|---------------------------|
| [![centos-s390x][11]][12] |
| [![centos-s390x][13]][14] |
[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]: https://jenkins.mono-project.com/job/z/label=centos-s390x/badge/icon
[12]: https://jenkins.mono-project.com/job/z/label=centos-s390x
[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://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true
[12]: https://ci.appveyor.com/project/ajlennon/mono-817/branch/master
[13]: https://jenkins.mono-project.com/job/z/label=centos-s390x/badge/icon
[14]: https://jenkins.mono-project.com/job/z/label=centos-s390x
Compilation and Installation
============================
@@ -104,6 +108,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.
@@ -181,7 +187,7 @@ while `mono-sgen` uses the Simple Generational GC.
* `--with-gc=[included, boehm, 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.
@@ -505,3 +511,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
File diff suppressed because it is too large. Load diff
+31 -10
View File
@@ -1,14 +1,35 @@
This directory contains acceptance tests, handled by optional non git submodule based submodules. Run the tests via "make check-full" (there are also targets for individual test suites).
Acceptance tests
================
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.
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.
By convention, submodules repositories are at the same level as the mono repository.
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.
Make targets available:
## Usage
make check-<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.
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.
+2 -2
View File
@@ -10,7 +10,7 @@
{
"name": "coreclr",
"url": "git://github.com/mono/coreclr.git",
"rev": "96cf61f96b42cf9d013e641609cb7787f6e3a71f",
"rev": "c7da48acf72c40c0c0ed1a80ebfacea21bb3a271",
"remote-branch": "origin/mono",
"branch": "mono",
"directory": "coreclr"
@@ -18,7 +18,7 @@
{
"name": "ms-test-suite",
"url": "[email protected]:xamarin/ms-test-suite.git",
"rev": "8eb26bd72a38e2c78675db45b13e89237dbdf4f2",
"rev": "840653918efed24f00f5e166094f06354cae7255",
"remote-branch": "origin/master",
"branch": "master",
"directory": "ms-test-suite"
File diff suppressed because it is too large. Load diff
+2
View File
@@ -0,0 +1,2 @@
*
!.gitignore
+10
View File
@@ -0,0 +1,10 @@
check-ms-test-suite:
@if $(MAKE) validate-ms-test-suite RESET_VERSIONS=1; then \
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -t:library -warn:1 -r:nunit.framework" && \
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-console.exe -nologo -exclude=MonoBug,BadTest" NUNIT_XML_RESULT=$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml || EXIT_CODE=1; \
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug -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
+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
+2 -117
View File
@@ -1,127 +1,12 @@
.PHONY: validate-versions reset-versions
CONFIG=SUBMODULES.json
# usage $(call ValidateVersionTemplate (name,MAKEFILE VAR,repo name))
# usage $(call ValidateVersionTemplate (mono,MONO,mono))
define ValidateVersionTemplate
#$(eval REPOSITORY_$(2):=$(shell test -z $(3) && echo $(1) || echo "$(3)"))
#$(eval DIRECTORY_$(2):=$(shell python versions.py get-dir $(1)))
#$(eval DIRECTORY_$(2):=$(shell test -z $(DIRECTORY_$(2)) && echo $(1) || echo $(DIRECTORY_$(2))))
#$(eval MODULE_$(2):=$(shell python versions.py get-url $(1)))
#$(eval NEEDED_$(2)_VERSION:=$(shell python versions.py get-rev $(1)))
#$(eval $(2)_BRANCH_AND_REMOTE:=$(shell python versions.py get-remote-branch $(1)))
#$(eval $(2)_VERSION:=$$$$(shell cd $($(2)_PATH) 2>/dev/null && git rev-parse HEAD ))
#$(eval NEEDED_$(2)_BRANCH:=$(word 2, $(subst /, ,$($(2)_BRANCH_AND_REMOTE))))
#$(eval NEEDED_$(2)_REMOTE:=$(word 1, $(subst /, ,$($(2)_BRANCH_AND_REMOTE))))
#$(eval $(2)_BRANCH:=$$$$(shell cd $($(2)_PATH) 2>/dev/null && git symbolic-ref --short HEAD 2>/dev/null))
validate-$(1)::
@if test x$$(IGNORE_$(2)_VERSION) = "x"; then \
if test ! -d $($(2)_PATH); then \
if test x$$(RESET_VERSIONS) != "x"; then \
$(MAKE) reset-$(1) || exit 1; \
else \
echo "Your $(1) checkout is missing, please run 'make reset-$(1)'"; \
touch .validate-versions-failure; \
fi; \
else \
if test "x$($(2)_VERSION)" != "x$(NEEDED_$(2)_VERSION)" ; then \
if test x$$(RESET_VERSIONS) != "x"; then \
$(MAKE) reset-$(1) || exit 1; \
else \
echo "Your $(1) version is out of date, please run 'make reset-$(1)' (found $($(2)_VERSION), expected $(NEEDED_$(2)_VERSION))"; \
test -z "$(BUILD_REVISION)" || $(MAKE) test-$(1); \
touch .validate-versions-failure; \
fi; \
elif test "x$($(2)_BRANCH)" != "x$(NEEDED_$(2)_BRANCH)" ; then \
if test x$$(RESET_VERSIONS) != "x"; then \
test -z "$(BUILD_REVISION)" || $(MAKE) test-$(1); \
$(MAKE) reset-$(1) || exit 1; \
else \
echo "Your $(1) branch is out of date, please run 'make reset-$(1)' (found $($(2)_BRANCH), expected $(NEEDED_$(2)_BRANCH))"; \
touch .validate-versions-failure; \
fi; \
fi; \
fi; \
fi
test-$(1)::
@echo $(1)
@echo " REPOSITORY_$(2)=$(REPOSITORY_$(2))"
@echo " DIRECTORY_$(2)=$(DIRECTORY_$(2))"
@echo " MODULE_$(2)=$(MODULE_$(2))"
@echo " NEEDED_$(2)_VERSION=$(NEEDED_$(2)_VERSION)"
@echo " $(2)_VERSION=$($(2)_VERSION)"
@echo " $(2)_BRANCH_AND_REMOTE=$($(2)_BRANCH_AND_REMOTE)"
@echo " NEEDED_$(2)_BRANCH=$(NEEDED_$(2)_BRANCH)"
@echo " NEEDED_$(2)_REMOTE=$(NEEDED_$(2)_REMOTE)"
@echo " $(2)_BRANCH=$($(2)_BRANCH)"
@echo " $(2)_PATH=$($(2)_PATH) => $(abspath $($(2)_PATH))"
reset-$(1)::
@if test -d $($(2)_PATH); then \
if ! (cd $($(2)_PATH) && git show $(NEEDED_$(2)_VERSION) >/dev/null 2>&1 && git log -1 $(NEEDED_$(2)_REMOTE) >/dev/null 2>&1) ; then \
echo "*** git fetch `basename $$($(2)_PATH)`" && (cd $($(2)_PATH) && git fetch); \
fi; \
else \
echo "*** git clone $(MODULE_$(2)) --recursive $(DIRECTORY_$(2))" && (cd `dirname $($(2)_PATH)` && git clone $(MODULE_$(2)) --recursive $(DIRECTORY_$(2)) || exit 1 ); \
fi
@if test x$$(IGNORE_$(2)_VERSION) = "x"; then \
echo "*** [$(1)] git checkout -f" $(NEEDED_$(2)_BRANCH) && (cd $($(2)_PATH) ; git checkout -f $(NEEDED_$(2)_BRANCH) || git checkout -f -b $($(2)_BRANCH_AND_REMOTE)); \
echo "*** [$(1)] git reset --hard $(NEEDED_$(2)_VERSION)" && (cd $($(2)_PATH) && git reset --hard $(NEEDED_$(2)_VERSION)); \
fi
@echo "*** [$(1)] git submodule update --init --recursive" && (cd $($(2)_PATH) && git submodule update --init --recursive)
print-$(1)::
@printf "*** %-16s %-45s %s (%s)\n" "$(DIRECTORY_$(2))" "$(MODULE_$(2))" "$(NEEDED_$(2)_VERSION)" "$(NEEDED_$(2)_BRANCH)"
.PHONY: validate-$(1) reset-$(1) print-$(1)
reset-versions:: reset-$(1)
validate-versions:: Validate-$(1)
print-versions:: print-$(1)
endef
SUBMODULES_CONFIG_FILE = $(top_srcdir)/acceptance-tests/SUBMODULES.json
include $(top_srcdir)/scripts/submodules/versions.mk
$(eval $(call ValidateVersionTemplate,roslyn,ROSLYN))
$(eval $(call ValidateVersionTemplate,coreclr,CORECLR))
$(eval $(call ValidateVersionTemplate,ms-test-suite,MSTESTSUITE))
reset-versions::
validate-versions::
@if test -e .validate-versions-failure; then \
rm .validate-versions-failure; \
echo One or more modules needs update; \
exit 1; \
else \
echo All dependent modules up to date; \
fi
reset:
@$(MAKE) validate-versions RESET_VERSIONS=1
__bump-version-%:
@if [ "$(REV)" = "" ]; then echo "Usage: make bump-version-$* REV=<ref>"; exit 1; fi
python versions.py set-rev $* $(REV)
@if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to pick up $(REV)." | git commit -F - $(CONFIG); fi
__bump-branch-%:
@if [ "$(BRANCH)" = "" ]; then echo "Usage: make bump-branch-$* BRANCH=<branch> REMOTE_BRANCH=<remote branch>"; exit 1; fi
@if [ "$(REMOTE_BRANCH)" == "" ]; then echo "Usage: make bump-branch-$* BRANCH=<branch> REMOTE_BRANCH=<remote branch>"; exit 1; fi
python versions.py set-branch $* $(BRANCH)
python versions.py set-remote-branch $* $(REMOTE_BRANCH)
@if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to switch to $(BRANCH) $(REMOTE BRANCH)." | git commit -F - $(CONFIG); fi
__bump-current-version-%:
REV=$(shell cd $(TOP)/../$* && git log -1 --pretty=format:%H); \
python versions.py set-rev $* $$REV; \
if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to pick up $$REV:" | git commit -F - $(CONFIG); fi
# Bump the given submodule to the revision given by the REV make variable
# If COMMIT is 1, commit the change
bump-roslyn: __bump-version-roslyn
-52
View File
@@ -1,52 +0,0 @@
#!/usr/bin/env python
import sys
import json
def find_module(submodules, name):
for item in submodules:
if item["name"] == name:
return item
print "Not found"
sys.exit(1)
if len(sys.argv) < 2:
print "Usage: versions.py <command>"
sys.exit(1)
CONFIG_FILE = "SUBMODULES.json"
command = sys.argv[1]
submodules = json.load(open(CONFIG_FILE))
if command == "get-rev":
mod = find_module(submodules, sys.argv[2])
print mod["rev"]
elif command == "get-url":
mod = find_module(submodules, sys.argv[2])
print mod["url"]
elif command == "get-dir":
mod = find_module(submodules, sys.argv[2])
print mod["directory"]
elif command == "get-remote-branch":
mod = find_module(submodules, sys.argv[2])
print mod["remote-branch"]
elif command == "set-rev":
mod = find_module(submodules, sys.argv[2])
mod["rev"] = sys.argv[3]
json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2)
elif command == "set-branch":
mod = find_module(submodules, sys.argv[2])
mod["branch"] = sys.argv[3]
json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2)
elif command == "set-remote-branch":
mod = find_module(submodules, sys.argv[2])
mod["remote-branch"] = sys.argv[3]
json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2)
elif command == "cat":
print json.dumps(submodules, indent = 2)
else:
print "Unknown command "" + command + ""."
sys.exit(1)
+4 -1
View File
@@ -160,8 +160,11 @@ if test -d $srcdir/eglib; then
echo Done running eglib/autogen.sh ...
fi
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
+476 -214
View File
@@ -1,7 +1,8 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [4.3.3],
# when bumping version number below, keep it in sync with man/mono.1 too
AC_INIT(mono, [4.7.0],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
@@ -92,11 +93,11 @@ case "$host" in
host_win32=yes
mono_cv_clang=no
if test "x$cross_compiling" = "xno"; then
if test "x$host" == "x$build" -a "x$host" == "x$target"; then
if test "x$host" = "x$build" -a "x$host" = "x$target"; then
target_win32=yes
fi
else
if test "x$host" == "x$target"; then
if test "x$host" = "x$target"; then
target_win32=yes
fi
fi
@@ -272,8 +273,6 @@ case "$host" in
need_link_unlink=yes
libmono_cflags="-D_REENTRANT"
libgc_threads=pthreads
# This doesn't seem to work on solaris/x86, but the configure test runs
with_tls=pthread
has_dtrace=yes
use_sigposix=yes
enable_solaris_tar_check=yes
@@ -354,6 +353,18 @@ AM_CONDITIONAL(PLATFORM_DARWIN, test x$host_darwin = xyes)
AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
if test -z "$PLATFORM_DARWIN_TRUE"; then :
PLATFORM_AOT_SUFFIX=.dylib
fi
if test -z "$PLATFORM_LINUX_TRUE"; then :
PLATFORM_AOT_SUFFIX=.so
fi
AC_SUBST(PLATFORM_AOT_SUFFIX)
## PLATFORM_AOT_SUFFIX not so simple for windows :-)
AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
AC_CHECK_TOOL(CXX, g++, g++)
@@ -521,6 +532,9 @@ if test x"$GCC" = xyes; then
# We rely on signed overflow to behave
CFLAGS="$CFLAGS -fwrapv"
# We rely on zero length arrays in structs
CFLAGS="$CFLAGS -Wno-zero-length-array"
CFLAGS="$CFLAGS -DMONO_DLL_EXPORT"
if test x"$disable_visibility_hidden" = xno; then
# Don't export any symbols by default
@@ -728,6 +742,202 @@ AC_ARG_ENABLE(system-aot, [ --enable-system-aot Enable the Ahead-Of-Time compi
DISABLED_FEATURES=none
#
# Set the build profiles and options before things which use them
#
AC_ARG_WITH(profile4_x, [ --with-profile4=yes,no If you want to install the 4.x FX (defaults to yes)], [], [with_profile4_x=default])
AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=default])
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=default])
AC_ARG_WITH(monotouch_watch, [ --with-monotouch_watch=yes,no If you want to build the Xamarin.WatchOS assemblies (defaults to no)],[], [with_monotouch_watch=default])
AC_ARG_WITH(monotouch_tv, [ --with-monotouch_tv=yes,no If you want to build the Xamarin.TVOS assemblies (defaults to no)], [], [with_monotouch_tv=default])
AC_ARG_WITH(bitcode, [ --with-bitcode=yes,no If bitcode is enabled (defaults to no)], [], [with_bitcode=default])
AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=default])
AC_ARG_WITH(mobile_static, [ --with-mobile_static=yes,no If you want to build the mobile_static assemblies (defaults to no)], [], [with_mobile_static=default])
AC_ARG_WITH(runtime_preset, [ --with-runtime_preset=net_4_x,all,mobile_static,bitcode_mobile_static Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
dnl
dnl Profile defaults
dnl
TEST_PROFILE=default
enable_llvm_default=no
INVARIANT_AOT_OPTIONS=nimt-trampolines=900,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=2800
if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
DISABLE_MCS_DOCS_default=yes
with_profile4_x_default=no
with_monodroid_default=no
with_monotouch_default=no
with_monotouch_watch_default=no
with_monotouch_tv_default=no
with_xammac_default=no
with_mobile_static_default=no
with_bitcode_default=no
with_cooperative_gc_default=no
elif test x$with_runtime_preset = xnet_4_x; then
with_cooperative_gc_default=no
with_profile4_x_default=yes
with_monodroid_default=no
with_monotouch_default=no
with_monotouch_watch_default=no
with_monotouch_tv_default=no
with_xammac_default=no
with_mobile_static_default=no
with_bitcode_default=no
elif test x$with_runtime_preset = xall; then
with_cooperative_gc_default=no
with_profile4_x_default=yes
with_monodroid_default=yes
with_monotouch_default=yes
with_monotouch_watch_default=yes
with_monotouch_tv_default=yes
with_xammac_default=yes
with_mobile_static_default=no
with_bitcode_default=no
elif test x$with_runtime_preset = xmobile_static; then
DISABLE_MCS_DOCS_default=yes
with_cooperative_gc_default=no
with_profile4_x_default=no
with_monodroid_default=no
with_monotouch_default=no
with_monotouch_watch_default=no
with_monotouch_tv_default=no
with_xammac_default=no
with_mobile_static_default=yes
with_bitcode_default=no
with_cooperative_gc_default=no
TEST_PROFILE=mobile_static
mono_feature_disable_com='yes'
mono_feature_disable_remoting='yes'
mono_feature_disable_reflection_emit_save='yes'
mono_feature_disable_reflection_emit='yes'
mono_feature_disable_appdomains='yes'
AOT_BUILD_FLAGS="-O=gsharedvt --aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--full-aot"
elif test x$with_runtime_preset = xbitcode_mobile_static; then
DISABLE_MCS_DOCS_default=yes
with_profile4_x_default=no
with_monodroid_default=no
with_monotouch_default=no
with_monotouch_watch_default=no
with_monotouch_tv_default=no
with_xammac_default=no
with_mobile_static_default=yes
with_bitcode_default=yes
with_cooperative_gc_default=yes
TEST_PROFILE=mobile_static
enable_llvm_default=yes
mono_feature_disable_com='yes'
mono_feature_disable_remoting='yes'
mono_feature_disable_reflection_emit_save='yes'
mono_feature_disable_reflection_emit='yes'
mono_feature_disable_appdomains='yes'
AOT_BUILD_FLAGS="--aot=llvmonly,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--llvmonly"
else
with_profile4_x_default=yes
with_monodroid_default=no
with_monotouch_default=no
with_monotouch_watch_default=no
with_monotouch_tv_default=no
with_bitcode_default=no
with_xammac_default=no
with_mobile_static_default=no
with_cooperative_gc_default=no
fi
if test "x$AOT_BUILD_FLAGS" != "x"; then :
AC_SUBST(AOT_BUILD_FLAGS)
AC_SUBST(AOT_RUN_FLAGS)
# For llvmonlycheck + fullaotcheck
AC_SUBST(INVARIANT_AOT_OPTIONS)
fi
AC_SUBST(TEST_PROFILE)
if test "x$with_profile4_x" = "xdefault"; then
with_profile4_x=$with_profile4_x_default
fi
if test "x$with_monodroid" = "xdefault"; then
with_monodroid=$with_monodroid_default
fi
if test "x$with_monotouch" = "xdefault"; then
with_monotouch=$with_monotouch_default
fi
if test "x$with_monotouch_watch" = "xdefault"; then
with_monotouch_watch=$with_monotouch_watch_default
fi
if test "x$with_monotouch_tv" = "xdefault"; then
with_monotouch_tv=$with_monotouch_tv_default
fi
if test "x$with_bitcode" = "xdefault"; then
with_bitcode=$with_bitcode_default
fi
if test "x$with_xammac" = "xdefault"; then
with_xammac=$with_xammac_default
fi
if test "x$with_mobile_static" = "xdefault"; then
with_mobile_static=$with_mobile_static_default
fi
AM_CONDITIONAL(INSTALL_4_x, [test "x$with_profile4_x" = "xyes"])
AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"])
AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" != "xno"])
AM_CONDITIONAL(INSTALL_MONOTOUCH_WATCH, [test "x$with_monotouch_watch" != "xno"])
AM_CONDITIONAL(INSTALL_MONOTOUCH_TV, [test "x$with_monotouch_tv" != "xno"])
AM_CONDITIONAL(BITCODE, test "x$with_bitcode" = "xyes")
AM_CONDITIONAL(INSTALL_XAMMAC, [test "x$with_xammac" != "xno"])
AM_CONDITIONAL(INSTALL_MOBILE_STATIC, [test "x$with_mobile_static" != "xno"])
AC_SUBST(INSTALL_MOBILE_STATIC)
default_profile=net_4_x
if test -z "$INSTALL_MONODROID_TRUE"; then :
default_profile=monodroid
fi
if test -z "$INSTALL_MONOTOUCH_TRUE"; then :
default_profile=monotouch
fi
if test -z "$INSTALL_XAMMAC_TRUE"; then :
default_profile=xammac
fi
if test -z "$INSTALL_MOBILE_STATIC_TRUE"; then :
default_profile=mobile_static
fi
if test -z "$INSTALL_4_x_TRUE"; then :
default_profile=net_4_x
fi
DEFAULT_PROFILE=$default_profile
AC_SUBST(DEFAULT_PROFILE)
#
# End build profile configuration
#
if test x$USE_NLS = xprofile_default; then
if test x$host_darwin = xyes; then
# We make the default value for USE_NLS
# "no" on OSX because it isn't available on most
# default OSX installs. The most common configurations will
# all disable it, so this saves us typing.
USE_NLS=no
AC_SUBST([USE_NLS])
AC_MSG_RESULT([$USE_NLS])
else
USE_NLS=yes
AC_SUBST([USE_NLS])
AC_MSG_RESULT([$USE_NLS])
fi
fi
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, assembly_remapping, shared_perfcounters, remoting,
@@ -929,15 +1139,8 @@ if test x$has_extension_module != xno ; then
AC_MSG_NOTICE([Enabling mono extension module.])
fi
AC_ARG_ENABLE(gsharedvt, [ --enable-gsharedvt Enable generic valuetype sharing], enable_gsharedvt=$enableval, enable_gsharedvt=no)
if test x$enable_gsharedvt = xyes; then
AC_DEFINE(ENABLE_GSHAREDVT,1,[Gsharedvt])
fi
AC_ARG_ENABLE(native-types, [ --enable-native-types Enable native types], enable_native_types=$enableval, enable_native_types=no)
if test x$enable_native_types = xyes; then
AC_DEFINE(MONO_NATIVE_TYPES,1,[native types])
fi
# Deprecated
AC_ARG_ENABLE(gsharedvt, [ --enable-gsharedvt Enable generic valuetype sharing (Deprecated)], enable_gsharedvt=$enableval, enable_gsharedvt=no)
AC_MSG_CHECKING(for visibility __attribute__)
AC_COMPILE_IFELSE([
@@ -976,72 +1179,76 @@ AC_ARG_WITH(libgc, [ --with-gc=included,none Controls the Boehm GC config, d
AC_ARG_ENABLE(boehm, [ --disable-boehm Disable the Boehm GC.], support_boehm=$enableval,support_boehm=${support_boehm:-yes})
AM_CONDITIONAL(SUPPORT_BOEHM, test x$support_boehm = xyes)
AC_ARG_ENABLE(parallel-mark, [ --enable-parallel-mark Enables Boehm GC Parallel Marking], enable_parallel_mark=$enableval, enable_parallel_mark=$parallel_mark)
if test x$enable_parallel_mark = xyes; then
libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
if test "x$support_boehm" = "xyes"; then
AC_ARG_ENABLE(parallel-mark, [ --enable-parallel-mark Enables Boehm GC Parallel Marking], enable_parallel_mark=$enableval, enable_parallel_mark=$parallel_mark)
if test x$enable_parallel_mark = xyes; then
libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
fi
gc_msg=""
LIBGC_CPPFLAGS=
LIBGC_LIBS=
LIBGC_STATIC_LIBS=
libgc_dir=
case "x$libgc" in
xincluded)
if test "x$support_boehm" = "xyes"; then
libgc_dir=libgc
fi
LIBGC_CPPFLAGS='-I$(top_srcdir)/libgc/include'
LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
LIBGC_STATIC_LIBS='$(top_builddir)/libgc/libmonogc-static.la'
BOEHM_DEFINES="-DHAVE_BOEHM_GC"
if test x$target_win32 = xyes; then
BOEHM_DEFINES="$BOEHM_DEFINES -DGC_NOT_DLL"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DGC_BUILD -DGC_NOT_DLL"
fi
gc_msg="Included Boehm GC with typed GC"
if test x$enable_parallel_mark = xyes; then
AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "Included Boehm (with typed GC and Parallel Mark)", [GC description])
gc_msg="$gc_msg and parallel mark"
else
AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "Included Boehm (with typed GC)", [GC description])
fi
;;
xboehm|xbohem|xyes)
AC_MSG_WARN("External Boehm is no longer supported")
;;
xsgen)
AC_MSG_WARN("Use --with-sgen instead, --with-gc= controls Boehm configuration")
;;
xnone)
AC_MSG_WARN("Compiling mono without GC.")
AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "none", [GC description])
AC_DEFINE(HAVE_NULL_GC,1,[No GC support.])
gc_msg="none"
;;
*)
AC_MSG_ERROR([Invalid argument to --with-gc.])
;;
esac
AC_ARG_WITH(large-heap, [ --with-large-heap=yes,no Enable support for GC heaps larger than 3GB (defaults to no)], [large_heap=$withval], [large_heap=no])
if test "x$large_heap" = "xyes"; then
CPPFLAGS="$CPPFLAGS -DLARGE_CONFIG"
fi
AC_SUBST(LIBGC_CPPFLAGS)
AC_SUBST(LIBGC_LIBS)
AC_SUBST(LIBGC_STATIC_LIBS)
AC_SUBST(libgc_dir)
AC_SUBST(BOEHM_DEFINES)
fi
gc_msg=""
LIBGC_CPPFLAGS=
LIBGC_LIBS=
LIBGC_STATIC_LIBS=
libgc_dir=
case "x$libgc" in
xincluded)
if test "x$support_boehm" = "xyes"; then
libgc_dir=libgc
fi
LIBGC_CPPFLAGS='-I$(top_srcdir)/libgc/include'
LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
LIBGC_STATIC_LIBS='$(top_builddir)/libgc/libmonogc-static.la'
BOEHM_DEFINES="-DHAVE_BOEHM_GC"
if test x$target_win32 = xyes; then
BOEHM_DEFINES="$BOEHM_DEFINES -DGC_NOT_DLL"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DGC_BUILD -DGC_NOT_DLL"
fi
gc_msg="Included Boehm GC with typed GC"
if test x$enable_parallel_mark = xyes; then
AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "Included Boehm (with typed GC and Parallel Mark)", [GC description])
gc_msg="$gc_msg and parallel mark"
else
AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "Included Boehm (with typed GC)", [GC description])
fi
;;
xboehm|xbohem|xyes)
AC_MSG_WARN("External Boehm is no longer supported")
;;
xsgen)
AC_MSG_WARN("Use --with-sgen instead, --with-gc= controls Boehm configuration")
;;
xnone)
AC_MSG_WARN("Compiling mono without GC.")
AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "none", [GC description])
AC_DEFINE(HAVE_NULL_GC,1,[No GC support.])
gc_msg="none"
;;
*)
AC_MSG_ERROR([Invalid argument to --with-gc.])
;;
esac
AC_ARG_WITH(large-heap, [ --with-large-heap=yes,no Enable support for GC heaps larger than 3GB (defaults to no)], [large_heap=$withval], [large_heap=no])
if test "x$large_heap" = "xyes"; then
CPPFLAGS="$CPPFLAGS -DLARGE_CONFIG"
fi
AC_SUBST(LIBGC_CPPFLAGS)
AC_SUBST(LIBGC_LIBS)
AC_SUBST(LIBGC_STATIC_LIBS)
AC_SUBST(libgc_dir)
AC_SUBST(BOEHM_DEFINES)
dnl
dnl End of Boehm GC Configuration
dnl
@@ -1083,6 +1290,7 @@ if test x$host_win32 = xno; then
dnl hires monotonic clock support
AC_SEARCH_LIBS(clock_gettime, rt)
AC_CHECK_FUNCS(clock_nanosleep)
dnl dynamic loader support
AC_CHECK_FUNC(dlopen, DL_LIB="",
@@ -1156,6 +1364,7 @@ if test x$host_win32 = xno; then
AC_CHECK_FUNCS(getrlimit)
AC_CHECK_FUNCS(prctl)
AC_CHECK_FUNCS(sched_getaffinity)
AC_CHECK_FUNCS(sched_setaffinity)
AC_CHECK_FUNCS(sched_getcpu)
@@ -2323,6 +2532,9 @@ else
#include <winsock2.h>
#include <ws2tcpip.h>
], [
#ifndef inet_pton
(void) inet_pton;
#endif
inet_pton (0, NULL, NULL);
], [
# Yes, we have it...
@@ -2455,7 +2667,7 @@ fi
AC_ARG_ENABLE(bcl-opt, [ --disable-bcl-opt BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes)
AC_ARG_ENABLE(perf-events, [ --enable-perf-events Enable using `perf` for profiling on Linux], test_perf_events=$enableval, test_perf_events=no)
if test "x$test_perf_events" == "xyes"; then
if test "x$test_perf_events" = "xyes"; then
AC_DEFINE(ENABLE_PERF_EVENTS, 1, [Enable using `perf` for profiling on Linux])
AC_SUBST(ENABLE_PERF_EVENTS)
fi
@@ -2553,9 +2765,6 @@ if test "x$enable_nacl_codegen" = "xyes"; then
MONO_NACL_ALIGN_MASK_OFF=1
AC_DEFINE(TARGET_NACL, 1, [...])
AC_DEFINE(__native_client_codegen__, 1, [...])
else
MONO_NACL_ALIGN_MASK_OFF=0
AC_DEFINE(__default_codegen__, 1, [...])
fi
if test "x$enable_nacl_gc" = "xyes"; then
if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86"; then
@@ -2579,13 +2788,17 @@ dnl **************
dnl *** LLVM ***
dnl **************
AC_ARG_ENABLE(llvm,[ --enable-llvm Enable the LLVM back-end], enable_llvm=$enableval, enable_llvm=no)
AC_ARG_ENABLE(llvm,[ --enable-llvm Enable the LLVM back-end], enable_llvm=$enableval, enable_llvm=default)
AC_ARG_ENABLE(loadedllvm,[ --enable-loadedllvm Load the LLVM back-end dynamically], enable_llvm=$enableval && enable_loadedllvm=$enableval, enable_loadedllvm=no)
AC_ARG_ENABLE(llvm-version-check,[ --enable-llvm-version-check Check that the LLVM matches the version expected by mono], enable_llvm_version_check=$enableval, enable_llvm_version_check=no)
AC_ARG_ENABLE(llvm-runtime,[ --enable-llvm-runtime Enable runtime support for llvmonly code], enable_llvm_runtime=$enableval, enable_llvm_runtime=no)
AC_ARG_WITH(llvm, [ --with-llvm=<llvm prefix> Enable the LLVM back-end], enable_llvm=yes,)
if test "x$enable_llvm" = "xdefault"; then
enable_llvm=$enable_llvm_default
fi
if test "x$enable_llvm" = "xyes"; then
if test "x$with_llvm" != "x"; then
LLVM_CONFIG=$with_llvm/bin/llvm-config
@@ -2611,20 +2824,50 @@ if test "x$enable_llvm" = "xyes"; then
if test "x$host_win32" = "xno"; then
# Should be something like '2.6' or '2.7svn'
llvm_version=`$LLVM_CONFIG --version`
llvm_api_version=`$LLVM_CONFIG --mono-api-version 2>/dev/null`
AC_MSG_CHECKING(LLVM version)
AC_MSG_RESULT($llvm_version $llvm_api_version)
if echo $llvm_version | grep -q 'mono'; then
if test "x$enable_llvm_version_check" = "xyes"; then
if test "$llvm_version" != "$expected_llvm_version"; then
AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"])
fi
fi
else
AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
fi
# The output of --cflags seems to include optimizations flags too
LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
if test $llvm_api_version -gt 100; then
# The --cflags argument includes all kinds of warnings -pendantic etc.
LLVM_CFLAGS="-I$with_llvm/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
LLVM_CXXFLAGS="-I$with_llvm/include -std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
else
LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
fi
# LLVM is compiled with -fno-rtti, so we need this too, since our classes inherit
# from LLVM classes.
LLVM_CXXFLAGS="$LLVM_CXXFLAGS -fno-rtti -fexceptions"
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
# This might include empty lines
LLVM_SYSTEM_LIBS=`$LLVM_CONFIG --system-libs 2>/dev/null | grep -- -`
if test "x$host" != "x$target"; then
llvm_jit_supported=yes
llvm_jit_libs="jit mcjit $llvm_codegen"
if test $llvm_api_version -gt 100; then
# Based on llvm 3.9, only aot is currently supported
llvm_jit_libs="orcjit $llvm_codegen"
elif test "x$host" != "x$target"; then
# No need for jit libs
LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter`
else
LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter jit mcjit $llvm_codegen`
llvm_jit_supported=no
llvm_jit_libs=""
fi
LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter $llvm_jit_libs`
if test "x$LLVM_LIBS" = "x"; then
echo "$LLVM_CONFIG --libs failed."
exit 1
fi
LLVM_LIBS="$LLVM_LIBS $LLVM_LDFLAGS $LLVM_SYSTEM_LIBS"
# The c++ standard library used by llvm doesn't show up in $LLVM_SYSTEM_LIBS so add it manually
@@ -2636,21 +2879,6 @@ if test "x$enable_llvm" = "xyes"; then
expected_llvm_version="3.4svn-mono-mono/e656cac"
# Should be something like '2.6' or '2.7svn'
llvm_version=`$LLVM_CONFIG --version`
llvm_api_version=`$LLVM_CONFIG --mono-api-version 2>/dev/null`
AC_MSG_CHECKING(LLVM version)
AC_MSG_RESULT($llvm_version)
if echo $llvm_version | grep -q 'mono'; then
if test "x$enable_llvm_version_check" == "xyes"; then
if test "$llvm_version" != "$expected_llvm_version"; then
AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"])
fi
fi
else
AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
fi
else
LLVM_CFLAGS="-I$with_llvm/include -DNDEBUG -D__NO_CTYPE_INLINE -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
LLVM_CXXFLAGS="$LLVM_CFLAGS -std=gnu++11 -fvisibility-inlines-hidden -fno-rtti -Woverloaded-virtual -Wcast-qual"
@@ -2862,6 +3090,7 @@ case "$host" in
TARGET=ARM;
TARGET_SYS=WATCHOS
arch_target=arm;
arm_fpu=VFP_HARD
ACCESS_UNALIGNED="no"
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
;;
@@ -2879,6 +3108,12 @@ case "$host" in
AOT_SUPPORTED="yes"
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
;;
arm*-netbsd*-eabi*)
TARGET=ARM;
arch_target=arm;
ACCESS_UNALIGNED="no"
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
;;
# TODO: make proper support for NaCl host.
# arm*-*nacl)
# TARGET=ARM;
@@ -2891,6 +3126,7 @@ case "$host" in
TARGET=ARM64
arch_target=arm64
boehm_supported=false
AOT_SUPPORTED="yes"
;;
s390x-*-linux*)
TARGET=S390X;
@@ -2916,6 +3152,7 @@ if test "x$host" != "x$target"; then
with_tls=pthread
case "$target" in
armv7k-*)
arm_fpu=VFP_HARD
AC_DEFINE(TARGET_WATCHOS, 1, [...])
;;
esac
@@ -2993,6 +3230,17 @@ if test "x$host" != "x$target"; then
;;
esac
;;
arm*-netbsd*-eabi*)
TARGET=ARM;
arch_target=arm;
AC_DEFINE(TARGET_ARM, 1, [...])
ACCESS_UNALIGNED="no"
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
target_mach=no
;;
i686*-linux-*)
TARGET=X86;
arch_target=x86;
@@ -3020,6 +3268,7 @@ if test "x$host" != "x$target"; then
arch_target=amd64;
AC_DEFINE(TARGET_AMD64, 1, [...])
AC_DEFINE(TARGET_PS4, 1, [...])
AC_DEFINE(DISABLE_HW_TRAPS, 1, [...])
CPPFLAGS="$CPPFLAGS"
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
@@ -3083,6 +3332,45 @@ SPARC64)
;;
esac
case "$HOST" in
X86)
AC_DEFINE(HOST_X86, 1, [...])
;;
AMD64)
AC_DEFINE(HOST_AMD64, 1, [...])
;;
ARM)
AC_DEFINE(HOST_ARM, 1, [...])
;;
ARM64)
AC_DEFINE(HOST_ARM64, 1, [...])
;;
POWERPC)
AC_DEFINE(HOST_POWERPC, 1, [...])
;;
POWERPC64)
AC_DEFINE(HOST_POWERPC, 1, [...])
AC_DEFINE(HOST_POWERPC64, 1, [...])
;;
S390X)
AC_DEFINE(HOST_S390X, 1, [...])
;;
MIPS)
AC_DEFINE(HOST_MIPS, 1, [...])
;;
IA64)
AC_DEFINE(HOST_IA64, 1, [...])
;;
SPARC)
AC_DEFINE(HOST_SPARC, 1, [...])
;;
SPARC64)
AC_DEFINE(HOST_SPARC64, 1, [...])
;;
esac
dnl *************
dnl *** VTUNE ***
dnl *************
@@ -3189,11 +3477,23 @@ dnl
dnl Simple Generational checks (sgen)
dnl
SGEN_DEFINES=
AC_ARG_WITH(sgen, [ --with-sgen=yes,no Extra Generational GC, default=yes],[buildsgen=$with_sgen],[buildsgen=yes])
AC_ARG_WITH(sgen, [ --with-sgen=yes,no Extra Generational GC, default=yes],[buildsgen=$with_sgen],[buildsgen=yes])
AC_ARG_WITH(sgen-default-concurrent, [ --with-sgen-default-concurrent=yes,no Use Concurrent GC, default=no],[],[with_sgen_default_concurrent=no])
if test x$buildsgen = xyes; then
AC_DEFINE(HAVE_MOVING_COLLECTOR, 1, [Moving collector])
SGEN_DEFINES="-DHAVE_SGEN_GC"
gc_msg="sgen and $gc_msg"
conc_gc_msg=""
if test x$with_sgen_default_concurrent != xno; then
AC_DEFINE(HAVE_CONC_GC_AS_DEFAULT, 1, [Defaults to concurrent GC])
conc_gc_msg=" (concurrent by default)"
fi
if test "x$gc_msg" = "x"; then
gc_msg="sgen$conc_gc_msg"
else
gc_msg="sgen$conc_gc_msg and $gc_msg"
fi
fi
AC_SUBST(SGEN_DEFINES)
AM_CONDITIONAL(SUPPORT_SGEN, test x$buildsgen = xyes)
@@ -3214,8 +3514,10 @@ case "$host" in
GTKX11="libgtk-x11-2.0.dylib"
;;
*-*-*netbsd*)
LIBC="libc.so.12"
INTL="libintl.so.0"
LIBC="libc.so"
INTL="libintl.so"
SQLITE="libsqlite.so"
SQLITE3="libsqlite3.so"
;;
*-*-kfreebsd*-gnu)
LIBC="libc.so.0.1"
@@ -3263,6 +3565,12 @@ AC_ARG_WITH([libgdiplus],
# default install location
libgdiplus_install_loc=libgdiplus${libsuffix}
case "$host" in
*-*-*linux*)
libgdiplus_install_loc=libgdiplus${libsuffix}.0
;;
esac
case $with_libgdiplus in
no|installed)
libgdiplus_loc=
@@ -3371,6 +3679,10 @@ if test ${TARGET} = ARM; then
])
fi
if test x$arm_fpu != x; then
fpu=$arm_fpu
fi
AC_MSG_RESULT($fpu)
CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu=1"
unset fpu
@@ -3434,12 +3746,6 @@ if test ${TARGET} = ARM; then
fi
fi
if test ${TARGET} = ARM; then
if test "x${with_jumptables}" = "xyes"; then
AC_DEFINE(USE_JUMP_TABLES, 1, Use jump tables in JIT)
fi
fi
if test ${TARGET} = unknown; then
CPPFLAGS="$CPPFLAGS -DNO_PORT"
AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
@@ -3473,28 +3779,6 @@ case "x$libgc" in
;;
esac
AC_ARG_WITH(profile4_x, [ --with-profile4=yes,no If you want to install the 4.6 FX (defaults to yes)], [], [with_profile4_x=yes])
AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=no])
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=no])
AC_ARG_WITH(monotouch_watch, [ --with-monotouch_watch=yes,no If you want to build the Xamarin.WatchOS assemblies (defaults to no)],[], [with_monotouch_watch=no])
AC_ARG_WITH(monotouch_tv, [ --with-monotouch_tv=yes,no If you want to build the Xamarin.TVOS assemblies (defaults to no)], [], [with_monotouch_tv=no])
AC_ARG_WITH(bitcode, [ --with-bitcode=yes,no If bitcode is enabled (defaults to no)], [], [with_bitcode=no])
AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=no])
OPROFILE=no
AC_ARG_WITH(oprofile,[ --with-oprofile=no,<oprofile install dir> Enable oprofile support (defaults to no)],[
if test x$with_oprofile != xno; then
oprofile_include=$with_oprofile/include
if test ! -f $oprofile_include/opagent.h; then
AC_MSG_ERROR([oprofile include file not found at $oprofile_include/opagent.h])
fi
OPROFILE=yes
OPROFILE_CFLAGS="-I$oprofile_include"
OPROFILE_LIBS="-L$with_oprofile/lib/oprofile -lopagent"
AC_DEFINE(HAVE_OPROFILE,1,[Have oprofile support])
fi
])
MALLOC_MEMPOOLS=no
AC_ARG_WITH(malloc_mempools,[ --with-malloc-mempools=yes,no Use malloc for each single mempool allocation (only for runtime debugging, defaults to no)],[
if test x$with_malloc_mempools = xyes; then
@@ -3504,15 +3788,18 @@ AC_ARG_WITH(malloc_mempools,[ --with-malloc-mempools=yes,no Use malloc for eac
])
DISABLE_MCS_DOCS=no
DISABLE_MCS_DOCS=default
AC_ARG_WITH(mcs_docs,[ --with-mcs-docs=yes,no If you want to build the documentation under mcs (defaults to yes)],[
if test x$with_mcs_docs != xyes; then
DISABLE_MCS_DOCS=yes
fi
])
if test x$with_profile4_x != xyes; then
if test -n "$INSTALL_4_x_TRUE"; then :
DISABLE_MCS_DOCS=yes
fi
if test "x$DISABLE_MCS_DOCS" = "xdefault"; then
DISABLE_MCS_DOCS=$DISABLE_MCS_DOCS_default
fi
AC_ARG_WITH(lazy_gc_thread_creation, [ --with-lazy-gc-thread-creation=yes|no Enable lazy runtime thread creation, embedding host must do it explicitly (defaults to no)],[
if test x$with_lazy_gc_thread_creation != xno ; then
@@ -3520,42 +3807,47 @@ AC_ARG_WITH(lazy_gc_thread_creation, [ --with-lazy-gc-thread-creation=yes|no
fi
], [with_lazy_gc_thread_creation=no])
AC_ARG_WITH(cooperative_gc, [ --with-cooperative-gc=yes|no Enable cooperative stop-the-world garbage collection (sgen only) (defaults to no)],[
if test x$with_cooperative_gc != xno ; then
AC_DEFINE(USE_COOP_GC,1,[Enable cooperative stop-the-world garbage collection.])
fi
], [with_cooperative_gc=no])
AC_ARG_WITH(cooperative_gc, [ --with-cooperative-gc=yes|no Enable cooperative stop-the-world garbage collection (sgen only) (defaults to no)], [], [with_cooperative_gc=default])
AC_ARG_WITH(checked_build, [ --with-checked-build=yes|no Enable checked build (expensive asserts)) (defaults to no)],[
if test x$with_checked_build != xno ; then
AC_DEFINE(CHECKED_BUILD,1,[Enable checked build.])
fi
], [with_checked_build=no])
if test x$with_checked_build != xno ; then
DISABLED_CHECKED_BUILD_TEST=none
AC_ARG_ENABLE(checked_build_test, [ --enable-checked-build-test=LIST drop support for LIST checked build tests. LIST is a comma-separated list from: gc, metadata, thread.],
[
for feature in `echo "$enable_checked_build_test" | sed -e "s/,/ /g"`; do
eval "mono_checked_build_test_disable_$feature='yes'"
done
DISABLED_CHECKED_BUILD_TEST=$enable_checked_build_test
],[])
if test "x$mono_checked_build_test_disable_gc" = "xyes"; then
AC_DEFINE(DISABLE_CHECKED_BUILD_GC, 1, [Disable GC checked build])
fi
if test "x$mono_checked_build_test_disable_metadata" = "xyes"; then
AC_DEFINE(DISABLE_CHECKED_BUILD_METADATA, 1, [Disable metadata checked build])
fi
if test "x$mono_checked_build_test_disable_thread" = "xyes"; then
AC_DEFINE(DISABLE_CHECKED_BUILD_THREAD, 1, [Disable thread checked build])
fi
if test x$with_cooperative_gc = xdefault; then
with_cooperative_gc=$with_cooperative_gc_default
fi
if test x$with_cooperative_gc != xno; then
AC_DEFINE(USE_COOP_GC,1,[Enable cooperative stop-the-world garbage collection.])
fi
AM_CONDITIONAL([ENABLE_COOP], [test x$with_cooperative_gc != xno])
AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable checked build (expensive asserts), configure with a comma-separated LIST of checked build modules and then include that same list in the environment variable MONO_CHECK_MODE at runtime. Recognized checked build modules: all, gc, metadata, thread],[
if test x$enable_checked_build != x ; then
AC_DEFINE(ENABLE_CHECKED_BUILD,1,[Enable checked build])
fi
for feature in `echo "$enable_checked_build" | sed -e "s/,/ /g"`; do
eval "mono_checked_build_test_enable_$feature='yes'"
done
if test "x$mono_checked_build_test_enable_all" = "xyes"; then
eval "mono_checked_build_test_enable_gc='yes'"
eval "mono_checked_build_test_enable_metadata='yes'"
eval "mono_checked_build_test_enable_thread='yes'"
fi
if test "x$mono_checked_build_test_enable_gc" = "xyes"; then
AC_DEFINE(ENABLE_CHECKED_BUILD_GC, 1, [Enable GC checked build])
fi
if test "x$mono_checked_build_test_enable_metadata" = "xyes"; then
AC_DEFINE(ENABLE_CHECKED_BUILD_METADATA, 1, [Enable metadata checked build])
fi
if test "x$mono_checked_build_test_enable_thread" = "xyes"; then
AC_DEFINE(ENABLE_CHECKED_BUILD_THREAD, 1, [Enable thread checked build])
fi
], [])
AC_CHECK_HEADER([malloc.h],
[AC_DEFINE([HAVE_USR_INCLUDE_MALLOC_H], [1],
[Define to 1 if you have /usr/include/malloc.h.])],,)
@@ -3581,19 +3873,6 @@ else
fi
AC_SUBST(LIBMONO_LA)
dnl
dnl Consistency settings
dnl
if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
DISABLE_MCS_DOCS=yes
with_profile4_x=no
with_monodroid=no
with_monotouch=no
with_monotouch_watch=no
with_monotouch_tv=no
with_xammac=no
fi
if test x$DISABLE_MCS_DOCS = xyes; then
docs_dir=""
else
@@ -3604,20 +3883,8 @@ AC_SUBST(docs_dir)
## Maybe should also disable if mcsdir is invalid. Let's punt the issue for now.
AM_CONDITIONAL(BUILD_MCS, [test x$cross_compiling = xno && test x$enable_mcs_build != xno])
AM_CONDITIONAL(HAVE_OPROFILE, test x$OPROFILE = xyes)
AC_SUBST(OPROFILE_CFLAGS)
AC_SUBST(OPROFILE_LIBS)
libmono_ldflags="$libmono_ldflags $LIBS"
AM_CONDITIONAL(INSTALL_4_x, [test "x$with_profile4_x" = xyes])
AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"])
AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" != "xno"])
AM_CONDITIONAL(INSTALL_MONOTOUCH_WATCH, [test "x$with_monotouch_watch" != "xno"])
AM_CONDITIONAL(INSTALL_MONOTOUCH_TV, [test "x$with_monotouch_tv" != "xno"])
AM_CONDITIONAL(BITCODE, test "x$with_bitcode" = "xyes")
AM_CONDITIONAL(INSTALL_XAMMAC, [test "x$with_xammac" != "xno"])
AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
@@ -3672,22 +3939,6 @@ else
fi
AC_SUBST(mono_cfg_dir)
default_profile=net_4_x
if test -z "$INSTALL_MONODROID_TRUE"; then :
default_profile=monodroid
fi
if test -z "$INSTALL_MONOTOUCH_TRUE"; then :
default_profile=monotouch
fi
if test -z "$INSTALL_XAMMAC_TRUE"; then :
default_profile=xammac
fi
if test -z "$INSTALL_4_x_TRUE"; then :
default_profile=net_4_x
fi
DEFAULT_PROFILE=$default_profile
AC_SUBST(DEFAULT_PROFILE)
AC_CONFIG_FILES([po/mcs/Makefile.in])
AC_CONFIG_FILES([runtime/mono-wrapper],[chmod +x runtime/mono-wrapper])
@@ -3854,6 +4105,7 @@ AC_OUTPUT([
Makefile
mono-uninstalled.pc
acceptance-tests/Makefile
llvm/Makefile
scripts/mono-find-provides
scripts/mono-find-requires
mono/Makefile
@@ -3920,6 +4172,7 @@ tools/Makefile
tools/locale-builder/Makefile
tools/sgen/Makefile
tools/monograph/Makefile
tools/pedump/Makefile
runtime/Makefile
msvc/Makefile
po/Makefile
@@ -3990,6 +4243,10 @@ fi
echo "PLATFORM = darwin" >> $mcs_topdir/build/config.make
fi
if test "x$PLATFORM_AOT_SUFFIX" != "x"; then
echo "PLATFORM_AOT_SUFFIX = $PLATFORM_AOT_SUFFIX" >> $mcs_topdir/build/config.make
fi
if test x$AOT_SUPPORTED = xyes -a x$enable_system_aot = xdefault; then
enable_system_aot=yes
fi
@@ -4012,6 +4269,11 @@ fi
echo "BCL_OPTIMIZE = 1" >> $srcdir/$mcsdir/build/config.make
fi
if test "x$AOT_BUILD_FLAGS" != "x" ; then
echo "AOT_RUN_FLAGS=$AOT_RUN_FLAGS" >> $srcdir/$mcsdir/build/config.make
echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS" >> $srcdir/$mcsdir/build/config.make
fi
fi
)
@@ -4028,18 +4290,18 @@ echo "
TLS: $with_tls
SIGALTSTACK: $with_sigaltstack
Engine: $jit_status
oprofile: $OPROFILE
BigArrays: $enable_big_arrays
DTrace: $enable_dtrace
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm)
Libraries:
.NET 4.6: $with_profile4_x
.NET 4.x: $with_profile4_x
Xamarin.Android: $with_monodroid
Xamarin.iOS: $with_monotouch
Xamarin.WatchOS: $with_monotouch_watch
Xamarin.TVOS: $with_monotouch_tv
Xamarin.Mac: $with_xammac
mobile_static: $with_mobile_static
JNI support: $jdk_headers_found
libgdiplus: $libgdiplus_msg
zlib: $zlib_msg
+26 -2
View File
@@ -3,12 +3,22 @@
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-left: 3px;
padding-right: 3px;
padding: 0.1em 0.2em;
}
.mapi-header {
@@ -17,6 +27,20 @@
white-space: pre;
font-family: monospace;
border: 1px solid rgba(233,233,233,1);
background-color: rgba(249,249,249,1);
}
.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);
}
.mapi-code:first-line {
line-height: 0px;
}
.mapi-entry code {
+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) $<; }
+5 -5
View File
@@ -178,7 +178,6 @@ sub process_doc {
$body = "";
$functions[$fn++] = $func;
$deprecated = 0;
# Process arguments
while (<>){
s/NULL/<code>NULL<\/code>/g;
@@ -193,9 +192,9 @@ sub process_doc {
$returns =~ s/#(\w+)/<code>\1<\/code>/g;
$args =~ s/#(\w+)/<code>\1<\/code>/g;
$returns =~ s/\`([:\w\*]+)\`/<code>\1<\/code>/g;
$args =~ s/\`([:\w\*]+)\`/<code>\1<\/code>/g;
$body =~ s/\`([:\w\*]+)\`/<code>\1<\/code>/g;
$returns =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
$args =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
$body =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
$body =~ s/\n/ /;
$bodies{$func} = $body;
@@ -217,7 +216,7 @@ sub process_doc {
}
chop;
s/^\ \*//;
$_ = "\n<p>" if (/^\s+$/);
$_ = "<p>" if (/^\s*$/);
if ($inbody == 0){
if (/\s*(\w+):(.*)/){
@@ -230,6 +229,7 @@ sub process_doc {
} else {
$body = "\t$_\n";
$inbody = 1;
}
} elsif ($inbody == 1) {
+19 -11
View File
@@ -1,25 +1,32 @@
<h2>Exception Handling</h2>
<div class="mapi-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>With the introduction of the Cooperative mode/Bitcode for
the Mono garbage collector, it is no longer recommended for
embedded developers to raise exceptions from any method except
the topmost registered internal call.
<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.
<p>It is recommended that you raise an error condition from
nested parts of code, surface this error and in the topmost
frame raise the exception.
<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>
@@ -27,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
+25 -24
View File
@@ -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 -3
View File
@@ -1,16 +1,25 @@
<h2>Synopsis</h2>
<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>JIT Information</h3>
<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>
<h4><a name="api:mono_jit_info_table_find">mono_jit_info_table_find</a></h4>
<h3>Useful Debugging Functions</h3>
+1 -1
View File
@@ -162,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;
+38 -22
View File
@@ -45,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.
@@ -56,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>
@@ -71,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;
@@ -81,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>
@@ -116,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>
@@ -141,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>
+3 -3
View File
@@ -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
+11 -14
View File
@@ -138,6 +138,15 @@ AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf)
AC_CHECK_FUNCS(getrlimit)
AC_CHECK_FUNCS(fork execv execve)
AC_ARG_WITH([overridable-allocators], [ --with-overridable-allocators allow g_*alloc/g_free to call custom allocators set via g_mem_set_vtable])
if test x$with_overridable_allocators == xyes; then
AC_DEFINE(ENABLE_OVERRIDABLE_ALLOCATORS,1,[Overridable allocator support enabled])
AC_MSG_NOTICE([Overridable allocator support enabled])
else
AC_MSG_NOTICE([Overridable allocator support disabled])
fi
#
# 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
@@ -151,7 +160,7 @@ 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_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators == xyes)
AM_ICONV()
AC_SEARCH_LIBS(sqrtf, m)
@@ -181,7 +190,7 @@ if test "x$have_iso_varargs" = "xyes"; then
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_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.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)
@@ -193,10 +202,6 @@ if test $ac_cv_sizeof_void_p = $ac_cv_sizeof_int; then
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))"
@@ -204,10 +209,6 @@ elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long; then
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))"
@@ -215,10 +216,6 @@ elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long_long; then
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
+1 -11
View File
@@ -11,14 +11,6 @@ unix_files = \
gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c \
gmodule-unix.c gtimer-unix.c
# some unices and windows do not have an implementation of vasprintf
# used by eglib, use provided implementation instead
if NEED_VASPRINTF
vasprintf_files = vasprintf.c
else
vaprinttf_files = foo.c
endif
if HOST_WIN32
os_files = $(win_files)
else
@@ -32,7 +24,6 @@ libeglib_la_SOURCES = \
garray.c \
gbytearray.c \
gerror.c \
vasprintf.h \
ghashtable.c \
giconv.c \
gmem.c \
@@ -55,8 +46,7 @@ libeglib_la_SOURCES = \
gutf8.c \
gunicode.c \
unicode-data.h \
$(os_files) \
$(vasprintf_files)
$(os_files)
libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2
-4
View File
@@ -27,10 +27,6 @@ typedef unsigned @GSIZE@ gsize;
typedef signed @GSIZE@ gssize;
#define G_GSIZE_FORMAT @GSIZE_FORMAT@
#define G_GUINT64_FORMAT @G_GUINT64_FORMAT@
#define G_GINT64_FORMAT @G_GINT64_FORMAT@
#define G_GUINT32_FORMAT @G_GUINT32_FORMAT@
#define G_GINT32_FORMAT @G_GINT32_FORMAT@
#if @G_HAVE_ISO_VARARGS@ == 1
#define G_HAVE_ISO_VARARGS
-13
View File
@@ -26,27 +26,14 @@ typedef int pid_t;
#define G_SEARCHPATH_SEPARATOR_S ";"
#define G_SEARCHPATH_SEPARATOR ';'
#define G_GSIZE_FORMAT "d"
#define G_GUINT64_FORMAT "d"
#define G_GINT64_FORMAT "d"
#define GPOINTER_TO_INT(ptr) ((gint)(intptr_t) (ptr))
#define GPOINTER_TO_UINT(ptr) ((guint)(intptr_t) (ptr))
#define GINT_TO_POINTER(v) ((gpointer)(intptr_t) (v))
#define GUINT_TO_POINTER(v) ((gpointer)(intptr_t) (v))
/* VS 2010 and later have stdint.h */
#if defined(_MSC_VER) && _MSC_VER < 1600
#define INT32_MAX 2147483647
#define INT32_MIN (~ INT32_MAX)
#define INT64_MAX 9223372036854775807i64
#define INT64_MIN (~INT64_MAX)
#define UINT32_MAX 0xffffffffU
#define UINT64_MAX 0xffffffffffffffffULL
#endif
#define STDOUT_FILENO (int)(intptr_t)stdout
#define STDERR_FILENO (int)(intptr_t)stderr
/* FIXME: what should this be ?*/
#define X_OK 4 /* This is really read */
#define WNOHANG 1
+4 -6
View File
@@ -28,10 +28,8 @@
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <config.h>
#include <glib.h>
#include "vasprintf.h"
GError *
g_error_new (gpointer domain, gint code, const char *format, ...)
{
@@ -42,7 +40,7 @@ g_error_new (gpointer domain, gint code, const char *format, ...)
err->code = code;
va_start (args, format);
if (vasprintf (&err->message, format, args) == -1)
if (g_vasprintf (&err->message, format, args) == -1)
err->message = g_strdup_printf ("internal: invalid format string %s", format);
va_end (args);
@@ -57,7 +55,7 @@ g_error_vnew (gpointer domain, gint code, const char *format, va_list ap)
err->domain = domain;
err->code = code;
if (vasprintf (&err->message, format, ap) == -1)
if (g_vasprintf (&err->message, format, ap) == -1)
err->message = g_strdup_printf ("internal: invalid format string %s", format);
return err;
@@ -77,7 +75,7 @@ g_error_free (GError *error)
{
g_return_if_fail (error != NULL);
free (error->message);
g_free (error->message);
g_free (error);
}
+2 -35
View File
@@ -777,42 +777,9 @@ g_convert (const gchar *str, gssize len, const gchar *to_charset, const gchar *f
*/
/**
* from http://home.tiscali.nl/t876506/utf8tbl.html
* An explanation of the conversion can be found at:
* http://home.tiscali.nl/t876506/utf8tbl.html
*
* From Unicode UCS-4 to UTF-8:
* Start with the Unicode number expressed as a decimal number and call this ud.
*
* If ud <128 (7F hex) then UTF-8 is 1 byte long, the value of ud.
*
* If ud >=128 and <=2047 (7FF hex) then UTF-8 is 2 bytes long.
* byte 1 = 192 + (ud div 64)
* byte 2 = 128 + (ud mod 64)
*
* If ud >=2048 and <=65535 (FFFF hex) then UTF-8 is 3 bytes long.
* byte 1 = 224 + (ud div 4096)
* byte 2 = 128 + ((ud div 64) mod 64)
* byte 3 = 128 + (ud mod 64)
*
* If ud >=65536 and <=2097151 (1FFFFF hex) then UTF-8 is 4 bytes long.
* byte 1 = 240 + (ud div 262144)
* byte 2 = 128 + ((ud div 4096) mod 64)
* byte 3 = 128 + ((ud div 64) mod 64)
* byte 4 = 128 + (ud mod 64)
*
* If ud >=2097152 and <=67108863 (3FFFFFF hex) then UTF-8 is 5 bytes long.
* byte 1 = 248 + (ud div 16777216)
* byte 2 = 128 + ((ud div 262144) mod 64)
* byte 3 = 128 + ((ud div 4096) mod 64)
* byte 4 = 128 + ((ud div 64) mod 64)
* byte 5 = 128 + (ud mod 64)
*
* If ud >=67108864 and <=2147483647 (7FFFFFFF hex) then UTF-8 is 6 bytes long.
* byte 1 = 252 + (ud div 1073741824)
* byte 2 = 128 + ((ud div 16777216) mod 64)
* byte 3 = 128 + ((ud div 262144) mod 64)
* byte 4 = 128 + ((ud div 4096) mod 64)
* byte 5 = 128 + ((ud div 64) mod 64)
* byte 6 = 128 + (ud mod 64)
**/
gint
g_unichar_to_utf8 (gunichar c, gchar *outbuf)
+12 -27
View File
@@ -1,6 +1,5 @@
#ifndef __GLIB_H
#define __GLIB_H
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
@@ -9,15 +8,12 @@
#include <ctype.h>
#include <limits.h>
#ifdef _MSC_VER
#pragma include_alias(<eglib-config.h>, <eglib-config.hw>)
#endif
/* VS 2010 and later have stdint.h */
#if defined(_MSC_VER) && _MSC_VER < 1600
#else
#include <stdint.h>
#endif
#include <eglib-config.h>
#ifndef EGLIB_NO_REMAP
@@ -63,21 +59,6 @@ typedef const void * gconstpointer;
typedef char gchar;
typedef unsigned char guchar;
#if !G_TYPES_DEFINED
/* VS 2010 and later have stdint.h */
#if defined(_MSC_VER) && _MSC_VER < 1600
typedef __int8 gint8;
typedef unsigned __int8 guint8;
typedef __int16 gint16;
typedef unsigned __int16 guint16;
typedef __int32 gint32;
typedef unsigned __int32 guint32;
typedef __int64 gint64;
typedef unsigned __int64 guint64;
typedef float gfloat;
typedef double gdouble;
typedef int gboolean;
#else
/* Types defined in terms of the stdint.h */
typedef int8_t gint8;
typedef uint8_t guint8;
@@ -90,8 +71,6 @@ typedef uint64_t guint64;
typedef float gfloat;
typedef double gdouble;
typedef int32_t gboolean;
#endif
#endif
typedef guint16 gunichar2;
typedef guint32 gunichar;
@@ -135,6 +114,11 @@ typedef guint32 gunichar;
#define G_CONST_RETURN const
#define G_GUINT64_FORMAT PRIu64
#define G_GINT64_FORMAT PRIi64
#define G_GUINT32_FORMAT PRIu32
#define G_GINT32_FORMAT PRIi32
/*
* Allocation
*/
@@ -142,6 +126,7 @@ void g_free (void *ptr);
gpointer g_realloc (gpointer obj, gsize size);
gpointer g_malloc (gsize x);
gpointer g_malloc0 (gsize x);
gpointer g_calloc (gsize n, gsize x);
gpointer g_try_malloc (gsize x);
gpointer g_try_realloc (gpointer obj, gsize size);
@@ -154,7 +139,7 @@ gpointer g_try_realloc (gpointer obj, gsize size);
#define g_alloca(size) alloca (size)
gpointer g_memdup (gconstpointer mem, guint byte_size);
static inline gchar *g_strdup (const gchar *str) { if (str) {return strdup (str);} return NULL; }
static inline gchar *g_strdup (const gchar *str) { if (str) { return (gchar*) g_memdup (str, (guint)strlen (str) + 1); } return NULL; }
gchar **g_strdupv (gchar **str_array);
typedef struct {
@@ -162,11 +147,9 @@ typedef struct {
gpointer (*realloc) (gpointer mem, gsize n_bytes);
void (*free) (gpointer mem);
gpointer (*calloc) (gsize n_blocks, gsize n_block_bytes);
gpointer (*try_malloc) (gsize n_bytes);
gpointer (*try_realloc) (gpointer mem, gsize n_bytes);
} GMemVTable;
#define g_mem_set_vtable(x)
void g_mem_set_vtable (GMemVTable* vtable);
struct _GMemChunk {
guint alloc_size;
@@ -239,11 +222,11 @@ gint g_printf (gchar const *format, ...);
gint g_fprintf (FILE *file, gchar const *format, ...);
gint g_sprintf (gchar *string, gchar const *format, ...);
gint g_snprintf (gchar *string, gulong n, gchar const *format, ...);
gint g_vasprintf (gchar **ret, const gchar *fmt, va_list ap);
#define g_vprintf vprintf
#define g_vfprintf vfprintf
#define g_vsprintf vsprintf
#define g_vsnprintf vsnprintf
#define g_vasprintf vasprintf
gsize g_strlcpy (gchar *dest, const gchar *src, gsize dest_size);
gchar *g_stpcpy (gchar *dest, const char *src);
@@ -788,6 +771,8 @@ const gchar *g_get_user_name (void);
gchar *g_get_prgname (void);
void g_set_prgname (const gchar *prgname);
gboolean g_ensure_directory_exists (const gchar *filename);
/*
* Shell
*/
+1 -1
View File
@@ -367,7 +367,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
if (context->parser.end_element != NULL && context->state == START_ELEMENT){
context->parser.end_element (context, ename, context->user_data, error);
if (error != NULL && *error != NULL){
free (ename);
g_free (ename);
goto fail;
}
}
+47 -13
View File
@@ -25,15 +25,45 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <config.h>
#include <stdio.h>
#include <string.h>
#include <glib.h>
#if defined (ENABLE_OVERRIDABLE_ALLOCATORS)
static GMemVTable sGMemVTable = { malloc, realloc, free, calloc };
void
g_mem_set_vtable (GMemVTable* vtable)
{
sGMemVTable.calloc = vtable->calloc ? vtable->calloc : calloc;
sGMemVTable.realloc = vtable->realloc ? vtable->realloc : realloc;
sGMemVTable.malloc = vtable->malloc ? vtable->malloc : malloc;
sGMemVTable.free = vtable->free ? vtable->free : free;
}
#define G_FREE_INTERNAL sGMemVTable.free
#define G_REALLOC_INTERNAL sGMemVTable.realloc
#define G_CALLOC_INTERNAL sGMemVTable.calloc
#define G_MALLOC_INTERNAL sGMemVTable.malloc
#else
void
g_mem_set_vtable (GMemVTable* vtable)
{
}
#define G_FREE_INTERNAL free
#define G_REALLOC_INTERNAL realloc
#define G_CALLOC_INTERNAL calloc
#define G_MALLOC_INTERNAL malloc
#endif
void
g_free (void *ptr)
{
if (ptr != NULL)
free (ptr);
G_FREE_INTERNAL (ptr);
}
gpointer
@@ -58,7 +88,7 @@ gpointer g_realloc (gpointer obj, gsize size)
g_free (obj);
return 0;
}
ptr = realloc (obj, size);
ptr = G_REALLOC_INTERNAL (obj, size);
if (ptr)
return ptr;
g_error ("Could not allocate %i bytes", size);
@@ -70,27 +100,31 @@ g_malloc (gsize x)
gpointer ptr;
if (!x)
return 0;
ptr = malloc (x);
ptr = G_MALLOC_INTERNAL (x);
if (ptr)
return ptr;
g_error ("Could not allocate %i bytes", x);
}
gpointer g_calloc (gsize n, gsize x)
{
gpointer ptr;
if (!x || !n)
return 0;
ptr = G_CALLOC_INTERNAL (n, x);
if (ptr)
return ptr;
g_error ("Could not allocate %i (%i * %i) bytes", x*n, n, x);
}
gpointer g_malloc0 (gsize x)
{
gpointer ptr;
if (!x)
return 0;
ptr = calloc(1,x);
if (ptr)
return ptr;
g_error ("Could not allocate %i bytes", x);
return g_calloc (1,x);
}
gpointer g_try_malloc (gsize x)
{
if (x)
return malloc (x);
return G_MALLOC_INTERNAL (x);
return 0;
}
@@ -98,8 +132,8 @@ gpointer g_try_malloc (gsize x)
gpointer g_try_realloc (gpointer obj, gsize size)
{
if (!size) {
g_free (obj);
G_FREE_INTERNAL (obj);
return 0;
}
return realloc (obj, size);
return G_REALLOC_INTERNAL (obj, size);
}
+4 -1
View File
@@ -92,7 +92,7 @@ g_win32_getlocale(void)
gint ccBuf = GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, buf, 9);
buf[ccBuf - 1] = '-';
ccBuf += GetLocaleInfo(lcid, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
return strdup(buf);
return g_strdup (buf);
}
gboolean
@@ -128,6 +128,9 @@ g_get_home_dir (void)
}
}
g_free (drive);
g_free (path);
return home_dir;
}
+6 -8
View File
@@ -31,8 +31,6 @@
#include <stdlib.h>
#include <glib.h>
#include "vasprintf.h"
/* The current fatal levels, error is always fatal */
static GLogLevelFlags fatal = G_LOG_LEVEL_ERROR;
static GLogFunc default_log_func;
@@ -49,7 +47,7 @@ g_print (const gchar *format, ...)
va_list args;
va_start (args, format);
if (vasprintf (&msg, format, args) < 0)
if (g_vasprintf (&msg, format, args) < 0)
return;
va_end (args);
@@ -57,7 +55,7 @@ g_print (const gchar *format, ...)
stdout_handler = default_stdout_handler;
stdout_handler (msg);
free (msg);
g_free (msg);
}
void
@@ -67,7 +65,7 @@ g_printerr (const gchar *format, ...)
va_list args;
va_start (args, format);
if (vasprintf (&msg, format, args) < 0)
if (g_vasprintf (&msg, format, args) < 0)
return;
va_end (args);
@@ -75,7 +73,7 @@ g_printerr (const gchar *format, ...)
stderr_handler = default_stderr_handler;
stderr_handler (msg);
free (msg);
g_free (msg);
}
GLogLevelFlags
@@ -107,11 +105,11 @@ g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format,
if (!default_log_func)
default_log_func = g_log_default_handler;
if (vasprintf (&msg, format, args) < 0)
if (g_vasprintf (&msg, format, args) < 0)
return;
default_log_func (log_domain, log_level, msg, default_log_func_user_data);
free (msg);
g_free (msg);
}
void
+93
View File
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <glib.h>
#include <errno.h>
#include <sys/stat.h>
#ifdef G_OS_WIN32
#include <direct.h>
@@ -294,3 +295,95 @@ g_get_prgname (void)
{
return name;
}
gboolean
g_ensure_directory_exists (const gchar *filename)
{
#ifdef G_OS_WIN32
gchar *dir_utf8 = g_path_get_dirname (filename);
gunichar2 *p;
gunichar2 *dir_utf16 = NULL;
int retval;
if (!dir_utf8 || !dir_utf8 [0])
return FALSE;
dir_utf16 = g_utf8_to_utf16 (dir_utf8, strlen (dir_utf8), NULL, NULL, NULL);
g_free (dir_utf8);
if (!dir_utf16)
return FALSE;
p = dir_utf16;
/* make life easy and only use one directory seperator */
while (*p != '\0')
{
if (*p == '/')
*p = '\\';
p++;
}
p = dir_utf16;
/* get past C:\ )*/
while (*p++ != '\\')
{
}
while (1) {
gboolean bRet = FALSE;
p = wcschr (p, '\\');
if (p)
*p = '\0';
retval = _wmkdir (dir_utf16);
if (retval != 0 && errno != EEXIST) {
g_free (dir_utf16);
return FALSE;
}
if (!p)
break;
*p++ = '\\';
}
g_free (dir_utf16);
return TRUE;
#else
char *p;
gchar *dir = g_path_get_dirname (filename);
int retval;
struct stat sbuf;
if (!dir || !dir [0]) {
g_free (dir);
return FALSE;
}
if (stat (dir, &sbuf) == 0 && S_ISDIR (sbuf.st_mode)) {
g_free (dir);
return TRUE;
}
p = dir;
while (*p == '/')
p++;
while (1) {
p = strchr (p, '/');
if (p)
*p = '\0';
retval = mkdir (dir, 0777);
if (retval != 0 && errno != EEXIST) {
g_free (dir);
return FALSE;
}
if (!p)
break;
*p++ = '/';
}
g_free (dir);
return TRUE;
#endif
}
+39 -4
View File
@@ -32,13 +32,17 @@
#include <ctype.h>
#include <glib.h>
#include "vasprintf.h"
/*
* g_strndup and g_vasprintf need to allocate memory with g_malloc if
* ENABLE_OVERRIDABLE_ALLOCATORS is defined so that it can be safely freed with g_free
* rather than free.
*/
/* This is not a macro, because I dont want to put _GNU_SOURCE in the glib.h header */
gchar *
g_strndup (const gchar *str, gsize n)
{
#ifdef HAVE_STRNDUP
#if defined (HAVE_STRNDUP) && !defined (ENABLE_OVERRIDABLE_ALLOCATORS)
return strndup (str, n);
#else
if (str) {
@@ -52,6 +56,37 @@ g_strndup (const gchar *str, gsize n)
#endif
}
gint g_vasprintf (gchar **ret, const gchar *fmt, va_list ap)
{
#if defined (HAVE_VASPRINTF) && !defined (ENABLE_OVERRIDABLE_ALLOCATORS)
return vasprintf (ret, fmt, ap);
#else
char *buf;
int len;
size_t buflen;
va_list ap2;
#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR)
ap2 = ap;
len = _vscprintf(fmt, ap2); // NOTE MS specific extension ( :-( )
#else
va_copy(ap2, ap);
len = vsnprintf(NULL, 0, fmt, ap2);
#endif
if (len >= 0 && (buf = g_malloc ((buflen = (size_t) (len + 1)))) != NULL) {
len = vsnprintf(buf, buflen, fmt, ap);
*ret = buf;
} else {
*ret = NULL;
len = -1;
}
va_end(ap2);
return len;
#endif
}
void
g_strfreev (gchar **str_array)
{
@@ -133,7 +168,7 @@ g_strdup_vprintf (const gchar *format, va_list args)
int n;
char *ret;
n = vasprintf (&ret, format, args);
n = g_vasprintf (&ret, format, args);
if (n == -1)
return NULL;
@@ -148,7 +183,7 @@ g_strdup_printf (const gchar *format, ...)
int n;
va_start (args, format);
n = vasprintf (&ret, format, args);
n = g_vasprintf (&ret, format, args);
va_end (args);
if (n == -1)
return NULL;
+1 -6
View File
@@ -44,9 +44,6 @@
# define CODESET 1
# include <windows.h>
#else
# ifdef HAVE_LANGINFO_H
# include <langinfo.h>
# endif
# ifdef HAVE_LOCALCHARSET_H
# include <localcharset.h>
# endif
@@ -219,9 +216,7 @@ g_get_charset (G_CONST_RETURN char **charset)
is_utf8 = FALSE;
#else
/* These shouldn't be heap allocated */
#if defined(HAVE_LANGINFO_H)
my_charset = nl_langinfo (CODESET);
#elif defined(HAVE_LOCALCHARSET_H)
#if defined(HAVE_LOCALCHARSET_H)
my_charset = locale_charset ();
#else
my_charset = "UTF-8";
-31
View File
@@ -1,31 +0,0 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
int vasprintf(char **ret, const char *fmt, va_list ap)
{
char *buf;
int len;
size_t buflen;
va_list ap2;
#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR)
ap2 = ap;
len = _vscprintf(fmt, ap2); // NOTE MS specific extension ( :-( )
#else
va_copy(ap2, ap);
len = vsnprintf(NULL, 0, fmt, ap2);
#endif
if (len >= 0 && (buf = malloc ((buflen = (size_t) (len + 1)))) != NULL) {
len = vsnprintf(buf, buflen, fmt, ap);
*ret = buf;
} else {
*ret = NULL;
len = -1;
}
va_end(ap2);
return len;
}
-11
View File
@@ -1,11 +0,0 @@
#ifndef __VASPRINTF_H
#define __VASPRINTF_H
#include <stdarg.h>
#include <config.h>
#ifndef HAVE_VASPRINTF
int vasprintf(char **ret, const char *fmt, va_list ap);
#endif
#endif /* __VASPRINTF_H */
+1 -8
View File
@@ -46,13 +46,6 @@
#include "test.h"
extern gint global_passed, global_tests;
#ifndef HAVE_VASPRINTF
/* systen does not provide a vasprintf function, use the one
provided within eglib itself */
extern int vasprintf(char **ret, const char *format, va_list ap);
#endif
static gchar *last_result = NULL;
gboolean
@@ -183,7 +176,7 @@ FAILED(const gchar *format, ...)
return NULL;
#else
va_start(args, format);
n = vasprintf(&ret, format, args);
n = g_vasprintf(&ret, format, args);
va_end(args);
if(n == -1) {
+9
View File
@@ -0,0 +1,9 @@
This is a copy of a few libunwind headers from https://android.googlesource.com/platform/external/libunwind
We can't make the repo a git submodule because it contains a folder called 'aux' which
is reserved on Windows and would break on checkout there.
These files are unmodified from the originals and should preferably stay that
way to avoid merge hell.
Commit: 338c9755cfe3d009c3dfff7d108e2c3ddaa6f3bb (android-6.0.1_r24)
+219
View File
@@ -0,0 +1,219 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2001-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
Copyright (C) 2013 Linaro Limited
This file is part of libunwind.
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. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <stddef.h>
#include <ucontext.h>
#define UNW_TARGET aarch64
#define UNW_TARGET_AARCH64 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 4096
typedef uint64_t unw_word_t;
typedef int64_t unw_sword_t;
typedef long double unw_tdep_fpreg_t;
typedef struct
{
/* no aarch64-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
typedef enum
{
/* 64-bit general registers. */
UNW_AARCH64_X0,
UNW_AARCH64_X1,
UNW_AARCH64_X2,
UNW_AARCH64_X3,
UNW_AARCH64_X4,
UNW_AARCH64_X5,
UNW_AARCH64_X6,
UNW_AARCH64_X7,
UNW_AARCH64_X8,
/* Temporary registers. */
UNW_AARCH64_X9,
UNW_AARCH64_X10,
UNW_AARCH64_X11,
UNW_AARCH64_X12,
UNW_AARCH64_X13,
UNW_AARCH64_X14,
UNW_AARCH64_X15,
/* Intra-procedure-call temporary registers. */
UNW_AARCH64_X16,
UNW_AARCH64_X17,
/* Callee-saved registers. */
UNW_AARCH64_X18,
UNW_AARCH64_X19,
UNW_AARCH64_X20,
UNW_AARCH64_X21,
UNW_AARCH64_X22,
UNW_AARCH64_X23,
UNW_AARCH64_X24,
UNW_AARCH64_X25,
UNW_AARCH64_X26,
UNW_AARCH64_X27,
UNW_AARCH64_X28,
/* 64-bit frame pointer. */
UNW_AARCH64_X29,
/* 64-bit link register. */
UNW_AARCH64_X30,
/* 64-bit stack pointer. */
UNW_AARCH64_SP = 31,
UNW_AARCH64_PC,
UNW_AARCH64_PSTATE,
/* 128-bit FP/Advanced SIMD registers. */
UNW_AARCH64_V0 = 64,
UNW_AARCH64_V1,
UNW_AARCH64_V2,
UNW_AARCH64_V3,
UNW_AARCH64_V4,
UNW_AARCH64_V5,
UNW_AARCH64_V6,
UNW_AARCH64_V7,
UNW_AARCH64_V8,
UNW_AARCH64_V9,
UNW_AARCH64_V10,
UNW_AARCH64_V11,
UNW_AARCH64_V12,
UNW_AARCH64_V13,
UNW_AARCH64_V14,
UNW_AARCH64_V15,
UNW_AARCH64_V16,
UNW_AARCH64_V17,
UNW_AARCH64_V18,
UNW_AARCH64_V19,
UNW_AARCH64_V20,
UNW_AARCH64_V21,
UNW_AARCH64_V22,
UNW_AARCH64_V23,
UNW_AARCH64_V24,
UNW_AARCH64_V25,
UNW_AARCH64_V26,
UNW_AARCH64_V27,
UNW_AARCH64_V28,
UNW_AARCH64_V29,
UNW_AARCH64_V30,
UNW_AARCH64_V31,
UNW_AARCH64_FPSR,
UNW_AARCH64_FPCR,
/* For AArch64, the CFA is the value of SP (x31) at the call site of the
previous frame. */
UNW_AARCH64_CFA = UNW_AARCH64_SP,
UNW_TDEP_LAST_REG = UNW_AARCH64_FPCR,
UNW_TDEP_IP = UNW_AARCH64_X30,
UNW_TDEP_SP = UNW_AARCH64_SP,
UNW_TDEP_EH = UNW_AARCH64_X0,
}
aarch64_regnum_t;
/* Use R0 through R3 to pass exception handling information. */
#define UNW_TDEP_NUM_EH_REGS 4
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On AArch64, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
#include "libunwind-common.h"
#include "libunwind-dynamic.h"
/* ANDROID support update. */
/* There is no getcontext in Android. */
#define unw_tdep_getcontext(uc) (({ \
unw_tdep_context_t *unw_ctx = (uc); \
register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs; \
__asm__ __volatile__ ( \
"stp x0, x1, [%[base], #0]\n" \
"stp x2, x3, [%[base], #16]\n" \
"stp x4, x5, [%[base], #32]\n" \
"stp x6, x7, [%[base], #48]\n" \
"stp x8, x9, [%[base], #64]\n" \
"stp x10, x11, [%[base], #80]\n" \
"stp x12, x13, [%[base], #96]\n" \
"stp x14, x13, [%[base], #112]\n" \
"stp x16, x17, [%[base], #128]\n" \
"stp x18, x19, [%[base], #144]\n" \
"stp x20, x21, [%[base], #160]\n" \
"stp x22, x23, [%[base], #176]\n" \
"stp x24, x25, [%[base], #192]\n" \
"stp x26, x27, [%[base], #208]\n" \
"stp x28, x29, [%[base], #224]\n" \
"str x30, [%[base], #240]\n" \
"mov x1, sp\n" \
"stp x1, x30, [%[base], #248]\n" \
: [base] "+r" (unw_base) : : "x1", "memory"); \
}), 0)
/* End of ANDROID update. */
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
+308
View File
@@ -0,0 +1,308 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2008 CodeSourcery
This file is part of libunwind.
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. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <stddef.h>
#define UNW_TARGET arm
#define UNW_TARGET_ARM 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
/* FIXME for ARM. Too big? What do other things use for similar tasks? */
#define UNW_TDEP_CURSOR_LEN 4096
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
typedef long double unw_tdep_fpreg_t;
typedef enum
{
UNW_ARM_R0,
UNW_ARM_R1,
UNW_ARM_R2,
UNW_ARM_R3,
UNW_ARM_R4,
UNW_ARM_R5,
UNW_ARM_R6,
UNW_ARM_R7,
UNW_ARM_R8,
UNW_ARM_R9,
UNW_ARM_R10,
UNW_ARM_R11,
UNW_ARM_R12,
UNW_ARM_R13,
UNW_ARM_R14,
UNW_ARM_R15,
/* VFPv2 s0-s31 (obsolescent numberings). */
UNW_ARM_S0 = 64,
UNW_ARM_S1,
UNW_ARM_S2,
UNW_ARM_S3,
UNW_ARM_S4,
UNW_ARM_S5,
UNW_ARM_S6,
UNW_ARM_S7,
UNW_ARM_S8,
UNW_ARM_S9,
UNW_ARM_S10,
UNW_ARM_S11,
UNW_ARM_S12,
UNW_ARM_S13,
UNW_ARM_S14,
UNW_ARM_S15,
UNW_ARM_S16,
UNW_ARM_S17,
UNW_ARM_S18,
UNW_ARM_S19,
UNW_ARM_S20,
UNW_ARM_S21,
UNW_ARM_S22,
UNW_ARM_S23,
UNW_ARM_S24,
UNW_ARM_S25,
UNW_ARM_S26,
UNW_ARM_S27,
UNW_ARM_S28,
UNW_ARM_S29,
UNW_ARM_S30,
UNW_ARM_S31,
/* FPA register numberings. */
UNW_ARM_F0 = 96,
UNW_ARM_F1,
UNW_ARM_F2,
UNW_ARM_F3,
UNW_ARM_F4,
UNW_ARM_F5,
UNW_ARM_F6,
UNW_ARM_F7,
/* iWMMXt GR register numberings. */
UNW_ARM_wCGR0 = 104,
UNW_ARM_wCGR1,
UNW_ARM_wCGR2,
UNW_ARM_wCGR3,
UNW_ARM_wCGR4,
UNW_ARM_wCGR5,
UNW_ARM_wCGR6,
UNW_ARM_wCGR7,
/* iWMMXt register numberings. */
UNW_ARM_wR0 = 112,
UNW_ARM_wR1,
UNW_ARM_wR2,
UNW_ARM_wR3,
UNW_ARM_wR4,
UNW_ARM_wR5,
UNW_ARM_wR6,
UNW_ARM_wR7,
UNW_ARM_wR8,
UNW_ARM_wR9,
UNW_ARM_wR10,
UNW_ARM_wR11,
UNW_ARM_wR12,
UNW_ARM_wR13,
UNW_ARM_wR14,
UNW_ARM_wR15,
/* Two-byte encodings from here on. */
/* SPSR. */
UNW_ARM_SPSR = 128,
UNW_ARM_SPSR_FIQ,
UNW_ARM_SPSR_IRQ,
UNW_ARM_SPSR_ABT,
UNW_ARM_SPSR_UND,
UNW_ARM_SPSR_SVC,
/* User mode registers. */
UNW_ARM_R8_USR = 144,
UNW_ARM_R9_USR,
UNW_ARM_R10_USR,
UNW_ARM_R11_USR,
UNW_ARM_R12_USR,
UNW_ARM_R13_USR,
UNW_ARM_R14_USR,
/* FIQ registers. */
UNW_ARM_R8_FIQ = 151,
UNW_ARM_R9_FIQ,
UNW_ARM_R10_FIQ,
UNW_ARM_R11_FIQ,
UNW_ARM_R12_FIQ,
UNW_ARM_R13_FIQ,
UNW_ARM_R14_FIQ,
/* IRQ registers. */
UNW_ARM_R13_IRQ = 158,
UNW_ARM_R14_IRQ,
/* ABT registers. */
UNW_ARM_R13_ABT = 160,
UNW_ARM_R14_ABT,
/* UND registers. */
UNW_ARM_R13_UND = 162,
UNW_ARM_R14_UND,
/* SVC registers. */
UNW_ARM_R13_SVC = 164,
UNW_ARM_R14_SVC,
/* iWMMXt control registers. */
UNW_ARM_wC0 = 192,
UNW_ARM_wC1,
UNW_ARM_wC2,
UNW_ARM_wC3,
UNW_ARM_wC4,
UNW_ARM_wC5,
UNW_ARM_wC6,
UNW_ARM_wC7,
/* VFPv3/Neon 64-bit registers. */
UNW_ARM_D0 = 256,
UNW_ARM_D1,
UNW_ARM_D2,
UNW_ARM_D3,
UNW_ARM_D4,
UNW_ARM_D5,
UNW_ARM_D6,
UNW_ARM_D7,
UNW_ARM_D8,
UNW_ARM_D9,
UNW_ARM_D10,
UNW_ARM_D11,
UNW_ARM_D12,
UNW_ARM_D13,
UNW_ARM_D14,
UNW_ARM_D15,
UNW_ARM_D16,
UNW_ARM_D17,
UNW_ARM_D18,
UNW_ARM_D19,
UNW_ARM_D20,
UNW_ARM_D21,
UNW_ARM_D22,
UNW_ARM_D23,
UNW_ARM_D24,
UNW_ARM_D25,
UNW_ARM_D26,
UNW_ARM_D27,
UNW_ARM_D28,
UNW_ARM_D29,
UNW_ARM_D30,
UNW_ARM_D31,
/* For ARM, the CFA is the value of SP (r13) at the call site in the
previous frame. */
UNW_ARM_CFA,
UNW_TDEP_LAST_REG = UNW_ARM_D31,
UNW_TDEP_IP = UNW_ARM_R14, /* A little white lie. */
UNW_TDEP_SP = UNW_ARM_R13,
UNW_TDEP_EH = UNW_ARM_R0 /* FIXME. */
}
arm_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 2 /* FIXME for ARM. */
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On ARM, we define our own unw_tdep_context instead of using ucontext_t.
This allows us to support systems that don't support getcontext and
therefore do not define ucontext_t. */
typedef struct unw_tdep_context
{
unsigned long regs[16];
}
unw_tdep_context_t;
/* There is no getcontext() on ARM. Use a stub version which only saves GP
registers. FIXME: Not ideal, may not be sufficient for all libunwind
use cases. Stores pc+8, which is only approximately correct, really. */
#ifndef __thumb__
#define unw_tdep_getcontext(uc) (({ \
unw_tdep_context_t *unw_ctx = (uc); \
register unsigned long *unw_base asm ("r0") = unw_ctx->regs; \
__asm__ __volatile__ ( \
"stmia %[base], {r0-r15}" \
: : [base] "r" (unw_base) : "memory"); \
}), 0)
#else /* __thumb__ */
#define unw_tdep_getcontext(uc) (({ \
unw_tdep_context_t *unw_ctx = (uc); \
register unsigned long *unw_base asm ("r0") = unw_ctx->regs; \
__asm__ __volatile__ ( \
".align 2\nbx pc\nnop\n.code 32\n" \
"stmia %[base], {r0-r15}\n" \
"orr %[base], pc, #1\nbx %[base]" \
: [base] "+r" (unw_base) : : "memory", "cc"); \
}), 0)
#endif
#include "libunwind-dynamic.h"
typedef struct
{
/* no arm-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
+308
View File
@@ -0,0 +1,308 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2001-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
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. */
/* ANDROID support update. */
#include <sys/types.h>
/* End of ANDROID update. */
#define UNW_VERSION_MAJOR 1
#define UNW_VERSION_MINOR 1
#define UNW_VERSION_EXTRA
#define UNW_VERSION_CODE(maj,min) (((maj) << 16) | (min))
#define UNW_VERSION UNW_VERSION_CODE(UNW_VERSION_MAJOR, UNW_VERSION_MINOR)
#define UNW_PASTE2(x,y) x##y
#define UNW_PASTE(x,y) UNW_PASTE2(x,y)
#define UNW_OBJ(fn) UNW_PASTE(UNW_PREFIX, fn)
#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
#ifdef UNW_LOCAL_ONLY
# ifdef UNW_ADDITIONAL_PREFIX
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UUL,UNW_TARGET),_)
# else
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UL,UNW_TARGET),_)
# endif
#else /* !UNW_LOCAL_ONLY */
# ifdef UNW_ADDITIONAL_PREFIX
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UU,UNW_TARGET),_)
# else
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_)
# endif
#endif /* !UNW_LOCAL_ONLY */
/* Error codes. The unwind routines return the *negated* values of
these error codes on error and a non-negative value on success. */
typedef enum
{
UNW_ESUCCESS = 0, /* no error */
UNW_EUNSPEC, /* unspecified (general) error */
UNW_ENOMEM, /* out of memory */
UNW_EBADREG, /* bad register number */
UNW_EREADONLYREG, /* attempt to write read-only register */
UNW_ESTOPUNWIND, /* stop unwinding */
UNW_EINVALIDIP, /* invalid IP */
UNW_EBADFRAME, /* bad frame */
UNW_EINVAL, /* unsupported operation or bad value */
UNW_EBADVERSION, /* unwind info has unsupported version */
UNW_ENOINFO /* no unwind info found */
}
unw_error_t;
/* The following enum defines the indices for a couple of
(pseudo-)registers which have the same meaning across all
platforms. (RO) means read-only. (RW) means read-write. General
registers (aka "integer registers") are expected to start with
index 0. The number of such registers is architecture-dependent.
The remaining indices can be used as an architecture sees fit. The
last valid register index is given by UNW_REG_LAST. */
typedef enum
{
UNW_REG_IP = UNW_TDEP_IP, /* (rw) instruction pointer (pc) */
UNW_REG_SP = UNW_TDEP_SP, /* (ro) stack pointer */
UNW_REG_EH = UNW_TDEP_EH, /* (rw) exception-handling reg base */
UNW_REG_LAST = UNW_TDEP_LAST_REG
}
unw_frame_regnum_t;
/* Number of exception-handler argument registers: */
#define UNW_NUM_EH_REGS UNW_TDEP_NUM_EH_REGS
typedef enum
{
UNW_CACHE_NONE, /* no caching */
UNW_CACHE_GLOBAL, /* shared global cache */
UNW_CACHE_PER_THREAD /* per-thread caching */
}
unw_caching_policy_t;
typedef int unw_regnum_t;
/* The unwind cursor starts at the youngest (most deeply nested) frame
and is used to track the frame state as the unwinder steps from
frame to frame. It is safe to make (shallow) copies of variables
of this type. */
typedef struct unw_cursor
{
unw_word_t opaque[UNW_TDEP_CURSOR_LEN];
}
unw_cursor_t;
/* This type encapsulates the entire (preserved) machine-state. */
typedef unw_tdep_context_t unw_context_t;
/* unw_getcontext() fills the unw_context_t pointed to by UC with the
machine state as it exists at the call-site. For implementation
reasons, this needs to be a target-dependent macro. It's easiest
to think of unw_getcontext() as being identical to getcontext(). */
#define unw_getcontext(uc) unw_tdep_getcontext(uc)
/* Return 1 if register number R is a floating-point register, zero
otherwise.
This routine is signal-safe. */
#define unw_is_fpreg(r) unw_tdep_is_fpreg(r)
typedef unw_tdep_fpreg_t unw_fpreg_t;
typedef struct unw_addr_space *unw_addr_space_t;
/* Each target may define it's own set of flags, but bits 0-15 are
reserved for general libunwind-use. */
#define UNW_PI_FLAG_FIRST_TDEP_BIT 16
/* The information comes from a .debug_frame section. */
#define UNW_PI_FLAG_DEBUG_FRAME 32
typedef struct unw_proc_info
{
unw_word_t start_ip; /* first IP covered by this procedure */
unw_word_t end_ip; /* first IP NOT covered by this procedure */
unw_word_t lsda; /* address of lang.-spec. data area (if any) */
unw_word_t handler; /* optional personality routine */
unw_word_t gp; /* global-pointer value for this procedure */
unw_word_t flags; /* misc. flags */
int format; /* unwind-info format (arch-specific) */
int unwind_info_size; /* size of the information (if applicable) */
void *unwind_info; /* unwind-info (arch-specific) */
unw_tdep_proc_info_t extra; /* target-dependent auxiliary proc-info */
}
unw_proc_info_t;
/* These are backend callback routines that provide access to the
state of a "remote" process. This can be used, for example, to
unwind another process through the ptrace() interface. */
typedef struct unw_accessors
{
/* Look up the unwind info associated with instruction-pointer IP.
On success, the routine fills in the PROC_INFO structure. */
int (*find_proc_info) (unw_addr_space_t, unw_word_t, unw_proc_info_t *,
int, void *);
/* Release any resources (e.g., memory) that were allocated for
the unwind info returned in by a previous call to
find_proc_info() with NEED_UNWIND_INFO set to 1. */
void (*put_unwind_info) (unw_addr_space_t, unw_proc_info_t *, void *);
/* Return the list-head of the dynamically registered unwind
info. */
int (*get_dyn_info_list_addr) (unw_addr_space_t, unw_word_t *, void *);
/* Access aligned word at address ADDR. The value is returned
according to the endianness of the host (e.g., if the host is
little-endian and the target is big-endian, access_mem() needs
to byte-swap the value before returning it). */
int (*access_mem) (unw_addr_space_t, unw_word_t, unw_word_t *, int,
void *);
/* Access register number REG at address ADDR. */
int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, int,
void *);
/* Access register number REG at address ADDR. */
int (*access_fpreg) (unw_addr_space_t, unw_regnum_t,
unw_fpreg_t *, int, void *);
int (*resume) (unw_addr_space_t, unw_cursor_t *, void *);
/* Optional call back to obtain the name of a (static) procedure.
Dynamically generated procedures are handled automatically by
libunwind. This callback is optional and may be set to
NULL. */
int (*get_proc_name) (unw_addr_space_t, unw_word_t, char *, size_t,
unw_word_t *, void *);
}
unw_accessors_t;
typedef enum unw_save_loc_type
{
UNW_SLT_NONE, /* register is not saved ("not an l-value") */
UNW_SLT_MEMORY, /* register has been saved in memory */
UNW_SLT_REG /* register has been saved in (another) register */
}
unw_save_loc_type_t;
typedef struct unw_save_loc
{
unw_save_loc_type_t type;
union
{
unw_word_t addr; /* valid if type==UNW_SLT_MEMORY */
unw_regnum_t regnum; /* valid if type==UNW_SLT_REG */
}
u;
unw_tdep_save_loc_t extra; /* target-dependent additional information */
}
unw_save_loc_t;
/* ANDROID support update. */
typedef struct unw_map_cursor
{
void *map_list;
void *cur_map;
}
unw_map_cursor_t;
typedef struct unw_map
{
unw_word_t start;
unw_word_t end;
unw_word_t offset;
unw_word_t load_base;
char *path;
int flags;
}
unw_map_t;
/* End of ANDROID update. */
/* These routines work both for local and remote unwinding. */
#define unw_local_access_addr_space_init UNW_OBJ(local_access_addr_space_init)
#define unw_local_addr_space UNW_OBJ(local_addr_space)
#define unw_create_addr_space UNW_OBJ(create_addr_space)
#define unw_destroy_addr_space UNW_OBJ(destroy_addr_space)
#define unw_get_accessors UNW_ARCH_OBJ(get_accessors)
#define unw_init_local UNW_OBJ(init_local)
#define unw_init_remote UNW_OBJ(init_remote)
#define unw_step UNW_OBJ(step)
#define unw_resume UNW_OBJ(resume)
#define unw_get_proc_info UNW_OBJ(get_proc_info)
#define unw_get_proc_info_by_ip UNW_OBJ(get_proc_info_by_ip)
#define unw_get_reg UNW_OBJ(get_reg)
#define unw_set_reg UNW_OBJ(set_reg)
#define unw_get_fpreg UNW_OBJ(get_fpreg)
#define unw_set_fpreg UNW_OBJ(set_fpreg)
#define unw_get_save_loc UNW_OBJ(get_save_loc)
#define unw_is_signal_frame UNW_OBJ(is_signal_frame)
#define unw_handle_signal_frame UNW_OBJ(handle_signal_frame)
#define unw_get_proc_name UNW_OBJ(get_proc_name)
#define unw_get_proc_name_by_ip UNW_OBJ(get_proc_name_by_ip)
#define unw_set_caching_policy UNW_OBJ(set_caching_policy)
#define unw_regname UNW_ARCH_OBJ(regname)
#define unw_flush_cache UNW_ARCH_OBJ(flush_cache)
#define unw_strerror UNW_ARCH_OBJ(strerror)
extern void unw_local_access_addr_space_init (unw_addr_space_t);
extern unw_addr_space_t unw_create_addr_space (unw_accessors_t *, int);
extern void unw_destroy_addr_space (unw_addr_space_t);
extern unw_accessors_t *unw_get_accessors (unw_addr_space_t);
extern void unw_flush_cache (unw_addr_space_t, unw_word_t, unw_word_t);
extern int unw_set_caching_policy (unw_addr_space_t, unw_caching_policy_t);
extern const char *unw_regname (unw_regnum_t);
extern int unw_init_local (unw_cursor_t *, unw_context_t *);
extern int unw_init_remote (unw_cursor_t *, unw_addr_space_t, void *);
extern int unw_step (unw_cursor_t *);
extern int unw_resume (unw_cursor_t *);
extern int unw_get_proc_info (unw_cursor_t *, unw_proc_info_t *);
extern int unw_get_proc_info_by_ip (unw_addr_space_t, unw_word_t,
unw_proc_info_t *, void *);
extern int unw_get_reg (unw_cursor_t *, int, unw_word_t *);
extern int unw_set_reg (unw_cursor_t *, int, unw_word_t);
extern int unw_get_fpreg (unw_cursor_t *, int, unw_fpreg_t *);
extern int unw_set_fpreg (unw_cursor_t *, int, unw_fpreg_t);
extern int unw_get_save_loc (unw_cursor_t *, int, unw_save_loc_t *);
extern int unw_is_signal_frame (unw_cursor_t *);
extern int unw_handle_signal_frame (unw_cursor_t *);
extern int unw_get_proc_name (unw_cursor_t *, char *, size_t, unw_word_t *);
extern int unw_get_proc_name_by_ip (unw_addr_space_t, unw_word_t, char *,
size_t, unw_word_t *, void *);
extern const char *unw_strerror (int);
extern int unw_backtrace (void **, int);
/* ANDROID support update. */
extern int unw_map_local_cursor_valid (unw_map_cursor_t *);
extern void unw_map_local_cursor_get (unw_map_cursor_t *);
extern int unw_map_local_cursor_get_next (unw_map_cursor_t *, unw_map_t *);
extern int unw_map_local_create (void);
extern void unw_map_local_destroy (void);
extern void unw_map_set (unw_addr_space_t, unw_map_cursor_t *);
extern void unw_map_cursor_reset (unw_map_cursor_t *);
extern void unw_map_cursor_clear (unw_map_cursor_t *);
extern int unw_map_cursor_create (unw_map_cursor_t *, pid_t);
extern void unw_map_cursor_destroy (unw_map_cursor_t *);
extern int unw_map_cursor_get_next (unw_map_cursor_t *, unw_map_t *);
/* End of ANDROID update. */
extern unw_addr_space_t unw_local_addr_space;
+73
View File
@@ -0,0 +1,73 @@
/* libunwind - a platform-independent unwind library
This file is part of libunwind.
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. */
#ifndef libunwind_coredump_h
#define libunwind_coredump_h
#include <libunwind.h>
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
/* Helper routines which make it easy to use libunwind on a coredump.
They're available only if UNW_REMOTE_ONLY is _not_ defined and they
aren't really part of the libunwind API. They are implemented in a
archive library called libunwind-coredump.a. */
struct UCD_info;
extern struct UCD_info *_UCD_create(const char *filename);
extern void _UCD_destroy(struct UCD_info *);
extern int _UCD_get_num_threads(struct UCD_info *);
extern void _UCD_select_thread(struct UCD_info *, int);
extern pid_t _UCD_get_pid(struct UCD_info *);
extern int _UCD_get_cursig(struct UCD_info *);
extern int _UCD_add_backing_file_at_segment(struct UCD_info *, int phdr_no, const char *filename);
extern int _UCD_add_backing_file_at_vaddr(struct UCD_info *,
unsigned long vaddr,
const char *filename);
extern int _UCD_find_proc_info (unw_addr_space_t, unw_word_t,
unw_proc_info_t *, int, void *);
extern void _UCD_put_unwind_info (unw_addr_space_t, unw_proc_info_t *, void *);
extern int _UCD_get_dyn_info_list_addr (unw_addr_space_t, unw_word_t *,
void *);
extern int _UCD_access_mem (unw_addr_space_t, unw_word_t, unw_word_t *, int,
void *);
extern int _UCD_access_reg (unw_addr_space_t, unw_regnum_t, unw_word_t *,
int, void *);
extern int _UCD_access_fpreg (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *,
int, void *);
extern int _UCD_get_proc_name (unw_addr_space_t, unw_word_t, char *, size_t,
unw_word_t *, void *);
extern int _UCD_resume (unw_addr_space_t, unw_cursor_t *, void *);
extern unw_accessors_t _UCD_accessors;
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* libunwind_coredump_h */
+210
View File
@@ -0,0 +1,210 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2002-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
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. */
/* This file defines the runtime-support routines for dynamically
generated code. Even though it is implemented as part of libunwind,
it is logically separate from the interface to perform the actual
unwinding. In particular, this interface is always used in the
context of the unwind target, whereas the rest of the unwind API is
used in context of the process that is doing the unwind (which may be
a debugger running on another machine, for example).
Note that the data-structures declared here server a dual purpose:
when a program registers a dynamically generated procedure, it uses
these structures directly. On the other hand, with remote-unwinding,
the data-structures are read from the remote process's memory and
translated into internalized versions. To facilitate remote-access,
the following rules should be followed in declaring these structures:
(1) Declare a member as a pointer only if the the information the
member points to needs to be internalized as well (e.g., a
string representing a procedure name should be declared as
"const char *", but the instruction pointer should be declared
as unw_word_t).
(2) Provide sufficient padding to ensure that no implicit padding
will be needed on any of the supported target architectures. For
the time being, padding data structures with the assumption that
sizeof (unw_word_t) == 8 should be sufficient. (Note: it's not
impossible to internalize structures with internal padding, but
it does make the process a bit harder).
(3) Don't declare members that contain bitfields or floating-point
values.
(4) Don't declare members with enumeration types. Declare them as
int32_t instead. */
typedef enum
{
UNW_DYN_STOP = 0, /* end-of-unwind-info marker */
UNW_DYN_SAVE_REG, /* save register to another register */
UNW_DYN_SPILL_FP_REL, /* frame-pointer-relative register spill */
UNW_DYN_SPILL_SP_REL, /* stack-pointer-relative register spill */
UNW_DYN_ADD, /* add constant value to a register */
UNW_DYN_POP_FRAMES, /* drop one or more stack frames */
UNW_DYN_LABEL_STATE, /* name the current state */
UNW_DYN_COPY_STATE, /* set the region's entry-state */
UNW_DYN_ALIAS /* get unwind info from an alias */
}
unw_dyn_operation_t;
typedef enum
{
UNW_INFO_FORMAT_DYNAMIC, /* unw_dyn_proc_info_t */
UNW_INFO_FORMAT_TABLE, /* unw_dyn_table_t */
UNW_INFO_FORMAT_REMOTE_TABLE, /* unw_dyn_remote_table_t */
UNW_INFO_FORMAT_ARM_EXIDX /* ARM specific unwind info */
}
unw_dyn_info_format_t;
typedef struct unw_dyn_op
{
int8_t tag; /* what operation? */
int8_t qp; /* qualifying predicate register */
int16_t reg; /* what register */
int32_t when; /* when does it take effect? */
unw_word_t val; /* auxiliary value */
}
unw_dyn_op_t;
typedef struct unw_dyn_region_info
{
struct unw_dyn_region_info *next; /* linked list of regions */
int32_t insn_count; /* region length (# of instructions) */
uint32_t op_count; /* length of op-array */
unw_dyn_op_t op[1]; /* variable-length op-array */
}
unw_dyn_region_info_t;
typedef struct unw_dyn_proc_info
{
unw_word_t name_ptr; /* address of human-readable procedure name */
unw_word_t handler; /* address of personality routine */
uint32_t flags;
int32_t pad0;
unw_dyn_region_info_t *regions;
}
unw_dyn_proc_info_t;
typedef struct unw_dyn_table_info
{
unw_word_t name_ptr; /* addr. of table name (e.g., library name) */
unw_word_t segbase; /* segment base */
unw_word_t table_len; /* must be a multiple of sizeof(unw_word_t)! */
unw_word_t *table_data;
}
unw_dyn_table_info_t;
typedef struct unw_dyn_remote_table_info
{
unw_word_t name_ptr; /* addr. of table name (e.g., library name) */
unw_word_t segbase; /* segment base */
unw_word_t table_len; /* must be a multiple of sizeof(unw_word_t)! */
unw_word_t table_data;
}
unw_dyn_remote_table_info_t;
typedef struct unw_dyn_info
{
/* doubly-linked list of dyn-info structures: */
struct unw_dyn_info *next;
struct unw_dyn_info *prev;
unw_word_t start_ip; /* first IP covered by this entry */
unw_word_t end_ip; /* first IP NOT covered by this entry */
unw_word_t gp; /* global-pointer in effect for this entry */
int32_t format; /* real type: unw_dyn_info_format_t */
int32_t pad;
union
{
unw_dyn_proc_info_t pi;
unw_dyn_table_info_t ti;
unw_dyn_remote_table_info_t rti;
}
u;
}
unw_dyn_info_t;
typedef struct unw_dyn_info_list
{
uint32_t version;
uint32_t generation;
unw_dyn_info_t *first;
}
unw_dyn_info_list_t;
/* Return the size (in bytes) of an unw_dyn_region_info_t structure that can
hold OP_COUNT ops. */
#define _U_dyn_region_info_size(op_count) \
((char *) (((unw_dyn_region_info_t *) NULL)->op + (op_count)) \
- (char *) NULL)
/* Register the unwind info for a single procedure.
This routine is NOT signal-safe. */
extern void _U_dyn_register (unw_dyn_info_t *);
/* Cancel the unwind info for a single procedure.
This routine is NOT signal-safe. */
extern void _U_dyn_cancel (unw_dyn_info_t *);
/* Convenience routines. */
#define _U_dyn_op(_tag, _qp, _when, _reg, _val) \
((unw_dyn_op_t) { (_tag), (_qp), (_reg), (_when), (_val) })
#define _U_dyn_op_save_reg(op, qp, when, reg, dst) \
(*(op) = _U_dyn_op (UNW_DYN_SAVE_REG, (qp), (when), (reg), (dst)))
#define _U_dyn_op_spill_fp_rel(op, qp, when, reg, offset) \
(*(op) = _U_dyn_op (UNW_DYN_SPILL_FP_REL, (qp), (when), (reg), \
(offset)))
#define _U_dyn_op_spill_sp_rel(op, qp, when, reg, offset) \
(*(op) = _U_dyn_op (UNW_DYN_SPILL_SP_REL, (qp), (when), (reg), \
(offset)))
#define _U_dyn_op_add(op, qp, when, reg, value) \
(*(op) = _U_dyn_op (UNW_DYN_ADD, (qp), (when), (reg), (value)))
#define _U_dyn_op_pop_frames(op, qp, when, num_frames) \
(*(op) = _U_dyn_op (UNW_DYN_POP_FRAMES, (qp), (when), 0, (num_frames)))
#define _U_dyn_op_label_state(op, label) \
(*(op) = _U_dyn_op (UNW_DYN_LABEL_STATE, _U_QP_TRUE, -1, 0, (label)))
#define _U_dyn_op_copy_state(op, label) \
(*(op) = _U_dyn_op (UNW_DYN_COPY_STATE, _U_QP_TRUE, -1, 0, (label)))
#define _U_dyn_op_alias(op, qp, when, addr) \
(*(op) = _U_dyn_op (UNW_DYN_ALIAS, (qp), (when), 0, (addr)))
#define _U_dyn_op_stop(op) \
(*(op) = _U_dyn_op (UNW_DYN_STOP, _U_QP_TRUE, -1, 0, 0))
/* The target-dependent qualifying predicate which is always TRUE. On
IA-64, that's p0 (0), on non-predicated architectures, the value is
ignored. */
#define _U_QP_TRUE _U_TDEP_QP_TRUE
+131
View File
@@ -0,0 +1,131 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2003-2004 Hewlett-Packard Co
This file is part of libunwind.
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. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <ucontext.h>
#define UNW_TARGET hppa
#define UNW_TARGET_HPPA 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 511
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
typedef union
{
struct { unw_word_t bits[2]; } raw;
double val;
}
unw_tdep_fpreg_t;
typedef enum
{
/* Note: general registers are expected to start with index 0.
This convention facilitates architecture-independent
implementation of the C++ exception handling ABI. See
_Unwind_SetGR() and _Unwind_GetGR() for details. */
UNW_HPPA_GR = 0,
UNW_HPPA_RP = 2, /* return pointer */
UNW_HPPA_FP = 3, /* frame pointer */
UNW_HPPA_SP = UNW_HPPA_GR + 30,
UNW_HPPA_FR = UNW_HPPA_GR + 32,
UNW_HPPA_IP = UNW_HPPA_FR + 32, /* instruction pointer */
/* other "preserved" registers (fpsr etc.)... */
/* PA-RISC has 4 exception-argument registers but they're not
contiguous. To deal with this, we define 4 pseudo
exception-handling registers which we then alias to the actual
physical register. */
UNW_HPPA_EH0 = UNW_HPPA_IP + 1, /* alias for UNW_HPPA_GR + 20 */
UNW_HPPA_EH1 = UNW_HPPA_EH0 + 1, /* alias for UNW_HPPA_GR + 21 */
UNW_HPPA_EH2 = UNW_HPPA_EH1 + 1, /* alias for UNW_HPPA_GR + 22 */
UNW_HPPA_EH3 = UNW_HPPA_EH2 + 1, /* alias for UNW_HPPA_GR + 31 */
/* frame info (read-only) */
UNW_HPPA_CFA,
UNW_TDEP_LAST_REG = UNW_HPPA_IP,
UNW_TDEP_IP = UNW_HPPA_IP,
UNW_TDEP_SP = UNW_HPPA_SP,
UNW_TDEP_EH = UNW_HPPA_EH0
}
hppa_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 4
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On PA-RISC, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
#define unw_tdep_is_fpreg(r) ((unsigned) ((r) - UNW_HPPA_FR) < 32)
#include "libunwind-dynamic.h"
typedef struct
{
/* no PA-RISC-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_getcontext UNW_ARCH_OBJ (getcontext)
extern int unw_tdep_getcontext (unw_tdep_context_t *);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
+197
View File
@@ -0,0 +1,197 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2001-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
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. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#include <inttypes.h>
#include <ucontext.h>
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#ifdef ia64
/* This works around a bug in Intel's ECC v7.0 which defines "ia64"
as "1". */
# undef ia64
#endif
#ifdef __hpux
/* On HP-UX, there is no hope of supporting UNW_LOCAL_ONLY, because
it's impossible to obtain the address of the members in the
sigcontext structure. */
# undef UNW_LOCAL_ONLY
# define UNW_GENERIC_ONLY
#endif
#define UNW_TARGET ia64
#define UNW_TARGET_IA64 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 511
/* If this bit is it indicates that the procedure saved all of ar.bsp,
ar.bspstore, and ar.rnat. If, additionally, ar.bsp != saved ar.bsp,
then this procedure has performed a register-backing-store switch. */
#define UNW_PI_FLAG_IA64_RBS_SWITCH_BIT (UNW_PI_FLAG_FIRST_TDEP_BIT + 0)
#define UNW_PI_FLAG_IA64_RBS_SWITCH (1 << UNW_PI_FLAG_IA64_RBS_SWITCH_BIT)
typedef uint64_t unw_word_t;
typedef int64_t unw_sword_t;
/* On IA-64, we want to access the contents of floating-point
registers as a pair of "words", but to ensure 16-byte alignment, we
make it a union that contains a "long double". This will do the
Right Thing on all known IA-64 platforms, including HP-UX. */
typedef union
{
struct { unw_word_t bits[2]; } raw;
long double dummy; /* dummy to force 16-byte alignment */
}
unw_tdep_fpreg_t;
typedef struct
{
/* no ia64-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
typedef enum
{
/* Note: general registers are excepted to start with index 0.
This convention facilitates architecture-independent
implementation of the C++ exception handling ABI. See
_Unwind_SetGR() and _Unwind_GetGR() for details. */
UNW_IA64_GR = 0, /* general registers (r0..r127) */
UNW_IA64_GP = UNW_IA64_GR + 1,
UNW_IA64_TP = UNW_IA64_GR + 13,
UNW_IA64_NAT = UNW_IA64_GR + 128, /* NaT registers (nat0..nat127) */
UNW_IA64_FR = UNW_IA64_NAT + 128, /* fp registers (f0..f127) */
UNW_IA64_AR = UNW_IA64_FR + 128, /* application registers (ar0..r127) */
UNW_IA64_AR_RSC = UNW_IA64_AR + 16,
UNW_IA64_AR_BSP = UNW_IA64_AR + 17,
UNW_IA64_AR_BSPSTORE = UNW_IA64_AR + 18,
UNW_IA64_AR_RNAT = UNW_IA64_AR + 19,
UNW_IA64_AR_CSD = UNW_IA64_AR + 25,
UNW_IA64_AR_26 = UNW_IA64_AR + 26,
UNW_IA64_AR_SSD = UNW_IA64_AR_26,
UNW_IA64_AR_CCV = UNW_IA64_AR + 32,
UNW_IA64_AR_UNAT = UNW_IA64_AR + 36,
UNW_IA64_AR_FPSR = UNW_IA64_AR + 40,
UNW_IA64_AR_PFS = UNW_IA64_AR + 64,
UNW_IA64_AR_LC = UNW_IA64_AR + 65,
UNW_IA64_AR_EC = UNW_IA64_AR + 66,
UNW_IA64_BR = UNW_IA64_AR + 128, /* branch registers (b0..p7) */
UNW_IA64_RP = UNW_IA64_BR + 0, /* return pointer (rp) */
UNW_IA64_PR = UNW_IA64_BR + 8, /* predicate registers (p0..p63) */
UNW_IA64_CFM,
/* frame info: */
UNW_IA64_BSP,
UNW_IA64_IP,
UNW_IA64_SP,
UNW_TDEP_LAST_REG = UNW_IA64_SP,
UNW_TDEP_IP = UNW_IA64_IP,
UNW_TDEP_SP = UNW_IA64_SP,
UNW_TDEP_EH = UNW_IA64_GR + 15
}
ia64_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 4 /* r15-r18 are exception args */
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. On IA-64,
we use this to provide the bit number in which a NaT bit gets
saved. */
uint8_t nat_bitnr;
/* Padding reserved for future use. */
uint8_t reserved[7];
}
unw_tdep_save_loc_t;
/* On IA-64, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
#define unw_tdep_is_fpreg(r) ((unsigned) ((r) - UNW_IA64_FR) < 128)
#include "libunwind-dynamic.h"
#include "libunwind-common.h"
#ifdef __hpux
/* In theory, we could use _Uia64_getcontext() on HP-UX as well, but
the benefit of doing so would be marginal given that it can't
support UNW_LOCAL_ONLY. */
# define unw_tdep_getcontext getcontext
#else
# define unw_tdep_getcontext UNW_ARCH_OBJ (getcontext)
extern int unw_tdep_getcontext (unw_tdep_context_t *);
#endif
/* This is a helper routine to search an ia64 unwind table. If the
address-space argument AS points to something other than the local
address-space, the memory for the unwind-info will be allocated
with malloc(), and should be free()d during the put_unwind_info()
callback. This routine is signal-safe for the local-address-space
case ONLY. */
#define unw_search_ia64_unwind_table UNW_OBJ(search_unwind_table)
extern int unw_search_ia64_unwind_table (unw_addr_space_t, unw_word_t,
unw_dyn_info_t *, unw_proc_info_t *,
int, void *);
/* This is a helper routine which the get_dyn_info_list_addr()
callback can use to locate the special dynamic-info list entry in
an IA-64 unwind table. If the entry exists in the table, the
list-address is returned. In all other cases, 0 is returned. */
extern unw_word_t _Uia64_find_dyn_list (unw_addr_space_t, unw_dyn_info_t *,
void *);
/* This is a helper routine to obtain the kernel-unwind info. It is
signal-safe. */
extern int _Uia64_get_kernel_table (unw_dyn_info_t *);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
+163
View File
@@ -0,0 +1,163 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2008 CodeSourcery
This file is part of libunwind.
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. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <ucontext.h>
#ifdef mips
# undef mips
#endif
#define UNW_TARGET mips
#define UNW_TARGET_MIPS 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
/* FIXME for MIPS. Too big? What do other things use for similar tasks? */
#define UNW_TDEP_CURSOR_LEN 4096
/* The size of a "word" varies on MIPS. This type is used for memory
addresses and register values. To allow a single library to support
multiple ABIs, and to support N32 at all, we must use a 64-bit type
even when addresses are only 32 bits. */
typedef uint64_t unw_word_t;
typedef int32_t unw_sword_t;
/* FIXME: MIPS ABIs. */
typedef long double unw_tdep_fpreg_t;
typedef enum
{
UNW_MIPS_R0,
UNW_MIPS_R1,
UNW_MIPS_R2,
UNW_MIPS_R3,
UNW_MIPS_R4,
UNW_MIPS_R5,
UNW_MIPS_R6,
UNW_MIPS_R7,
UNW_MIPS_R8,
UNW_MIPS_R9,
UNW_MIPS_R10,
UNW_MIPS_R11,
UNW_MIPS_R12,
UNW_MIPS_R13,
UNW_MIPS_R14,
UNW_MIPS_R15,
UNW_MIPS_R16,
UNW_MIPS_R17,
UNW_MIPS_R18,
UNW_MIPS_R19,
UNW_MIPS_R20,
UNW_MIPS_R21,
UNW_MIPS_R22,
UNW_MIPS_R23,
UNW_MIPS_R24,
UNW_MIPS_R25,
UNW_MIPS_R26,
UNW_MIPS_R27,
UNW_MIPS_R28,
UNW_MIPS_R29,
UNW_MIPS_R30,
UNW_MIPS_R31,
UNW_MIPS_PC = 34,
/* FIXME: Other registers! */
/* For MIPS, the CFA is the value of SP (r29) at the call site in the
previous frame. */
UNW_MIPS_CFA,
UNW_TDEP_LAST_REG = UNW_MIPS_R31,
UNW_TDEP_IP = UNW_MIPS_R31,
UNW_TDEP_SP = UNW_MIPS_R29,
UNW_TDEP_EH = UNW_MIPS_R0 /* FIXME. */
}
mips_regnum_t;
typedef enum
{
UNW_MIPS_ABI_O32,
UNW_MIPS_ABI_N32,
UNW_MIPS_ABI_N64
}
mips_abi_t;
#define UNW_TDEP_NUM_EH_REGS 2 /* FIXME for MIPS. */
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On x86, we can directly use ucontext_t as the unwind context. FIXME for
MIPS. */
typedef ucontext_t unw_tdep_context_t;
#include "libunwind-dynamic.h"
typedef struct
{
/* no mips-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
/* There is no getcontext() on MIPS. Use a stub version which only saves GP
registers. FIXME: Not ideal, may not be sufficient for all libunwind
use cases. */
#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
extern int unw_tdep_getcontext (ucontext_t *uc);
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
+213
View File
@@ -0,0 +1,213 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2006-2007 IBM
Contributed by
Corey Ashford <[email protected]>
Jose Flavio Aguilar Paulino <[email protected]> <[email protected]>
Copied from libunwind-x86_64.h, modified slightly for building
frysk successfully on ppc64, by Wu Zhou <[email protected]>
Will be replaced when libunwind is ready on ppc64 platform.
This file is part of libunwind.
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. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <ucontext.h>
#define UNW_TARGET ppc32
#define UNW_TARGET_PPC32 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/*
* This needs to be big enough to accommodate "struct cursor", while
* leaving some slack for future expansion. Changing this value will
* require recompiling all users of this library. Stack allocation is
* relatively cheap and unwind-state copying is relatively rare, so we want
* to err on making it rather too big than too small.
*
* To simplify this whole process, we are at least initially taking the
* tack that UNW_PPC32_* map straight across to the .eh_frame column register
* numbers. These register numbers come from gcc's source in
* gcc/config/rs6000/rs6000.h
*
* UNW_TDEP_CURSOR_LEN is in terms of unw_word_t size. Since we have 115
* elements in the loc array, each sized 2 * unw_word_t, plus the rest of
* the cursor struct, this puts us at about 2 * 115 + 40 = 270. Let's
* round that up to 280.
*/
#define UNW_TDEP_CURSOR_LEN 280
#if __WORDSIZE==32
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
#else
typedef uint64_t unw_word_t;
typedef int64_t unw_sword_t;
#endif
typedef long double unw_tdep_fpreg_t;
typedef enum
{
UNW_PPC32_R0,
UNW_PPC32_R1, /* called STACK_POINTER in gcc */
UNW_PPC32_R2,
UNW_PPC32_R3,
UNW_PPC32_R4,
UNW_PPC32_R5,
UNW_PPC32_R6,
UNW_PPC32_R7,
UNW_PPC32_R8,
UNW_PPC32_R9,
UNW_PPC32_R10,
UNW_PPC32_R11, /* called STATIC_CHAIN in gcc */
UNW_PPC32_R12,
UNW_PPC32_R13,
UNW_PPC32_R14,
UNW_PPC32_R15,
UNW_PPC32_R16,
UNW_PPC32_R17,
UNW_PPC32_R18,
UNW_PPC32_R19,
UNW_PPC32_R20,
UNW_PPC32_R21,
UNW_PPC32_R22,
UNW_PPC32_R23,
UNW_PPC32_R24,
UNW_PPC32_R25,
UNW_PPC32_R26,
UNW_PPC32_R27,
UNW_PPC32_R28,
UNW_PPC32_R29,
UNW_PPC32_R30,
UNW_PPC32_R31, /* called HARD_FRAME_POINTER in gcc */
/* Count Register */
UNW_PPC32_CTR = 32,
/* Fixed-Point Status and Control Register */
UNW_PPC32_XER = 33,
/* Condition Register */
UNW_PPC32_CCR = 34,
/* Machine State Register */
//UNW_PPC32_MSR = 35,
/* MQ or SPR0, not part of generic Power, part of MPC601 */
//UNW_PPC32_MQ = 36,
/* Link Register */
UNW_PPC32_LR = 36,
/* Floating Pointer Status and Control Register */
UNW_PPC32_FPSCR = 37,
UNW_PPC32_F0 = 48,
UNW_PPC32_F1,
UNW_PPC32_F2,
UNW_PPC32_F3,
UNW_PPC32_F4,
UNW_PPC32_F5,
UNW_PPC32_F6,
UNW_PPC32_F7,
UNW_PPC32_F8,
UNW_PPC32_F9,
UNW_PPC32_F10,
UNW_PPC32_F11,
UNW_PPC32_F12,
UNW_PPC32_F13,
UNW_PPC32_F14,
UNW_PPC32_F15,
UNW_PPC32_F16,
UNW_PPC32_F17,
UNW_PPC32_F18,
UNW_PPC32_F19,
UNW_PPC32_F20,
UNW_PPC32_F21,
UNW_PPC32_F22,
UNW_PPC32_F23,
UNW_PPC32_F24,
UNW_PPC32_F25,
UNW_PPC32_F26,
UNW_PPC32_F27,
UNW_PPC32_F28,
UNW_PPC32_F29,
UNW_PPC32_F30,
UNW_PPC32_F31,
UNW_TDEP_LAST_REG = UNW_PPC32_F31,
UNW_TDEP_IP = UNW_PPC32_LR,
UNW_TDEP_SP = UNW_PPC32_R1,
UNW_TDEP_EH = UNW_PPC32_R12
}
ppc32_regnum_t;
/*
* According to David Edelsohn, GNU gcc uses R3, R4, R5, and maybe R6 for
* passing parameters to exception handlers.
*/
#define UNW_TDEP_NUM_EH_REGS 4
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On ppc, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
/* XXX this is not ideal: an application should not be prevented from
using the "getcontext" name just because it's using libunwind. We
can't just use __getcontext() either, because that isn't exported
by glibc... */
#define unw_tdep_getcontext(uc) (getcontext (uc), 0)
#include "libunwind-dynamic.h"
typedef struct
{
/* no ppc32-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
+270
View File
@@ -0,0 +1,270 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2006-2007 IBM
Contributed by
Corey Ashford <[email protected]>
Jose Flavio Aguilar Paulino <[email protected]> <[email protected]>
Copied from libunwind-x86_64.h, modified slightly for building
frysk successfully on ppc64, by Wu Zhou <[email protected]>
Will be replaced when libunwind is ready on ppc64 platform.
This file is part of libunwind.
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. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <ucontext.h>
#define UNW_TARGET ppc64
#define UNW_TARGET_PPC64 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/*
* This needs to be big enough to accommodate "struct cursor", while
* leaving some slack for future expansion. Changing this value will
* require recompiling all users of this library. Stack allocation is
* relatively cheap and unwind-state copying is relatively rare, so we want
* to err on making it rather too big than too small.
*
* To simplify this whole process, we are at least initially taking the
* tack that UNW_PPC64_* map straight across to the .eh_frame column register
* numbers. These register numbers come from gcc's source in
* gcc/config/rs6000/rs6000.h
*
* UNW_TDEP_CURSOR_LEN is in terms of unw_word_t size. Since we have 115
* elements in the loc array, each sized 2 * unw_word_t, plus the rest of
* the cursor struct, this puts us at about 2 * 115 + 40 = 270. Let's
* round that up to 280.
*/
#define UNW_TDEP_CURSOR_LEN 280
#if __WORDSIZE==32
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
#else
typedef uint64_t unw_word_t;
typedef int64_t unw_sword_t;
#endif
typedef long double unw_tdep_fpreg_t;
/*
* Vector register (in PowerPC64 used for AltiVec registers)
*/
typedef struct {
uint64_t halves[2];
} unw_tdep_vreg_t;
typedef enum
{
UNW_PPC64_R0,
UNW_PPC64_R1, /* called STACK_POINTER in gcc */
UNW_PPC64_R2,
UNW_PPC64_R3,
UNW_PPC64_R4,
UNW_PPC64_R5,
UNW_PPC64_R6,
UNW_PPC64_R7,
UNW_PPC64_R8,
UNW_PPC64_R9,
UNW_PPC64_R10,
UNW_PPC64_R11, /* called STATIC_CHAIN in gcc */
UNW_PPC64_R12,
UNW_PPC64_R13,
UNW_PPC64_R14,
UNW_PPC64_R15,
UNW_PPC64_R16,
UNW_PPC64_R17,
UNW_PPC64_R18,
UNW_PPC64_R19,
UNW_PPC64_R20,
UNW_PPC64_R21,
UNW_PPC64_R22,
UNW_PPC64_R23,
UNW_PPC64_R24,
UNW_PPC64_R25,
UNW_PPC64_R26,
UNW_PPC64_R27,
UNW_PPC64_R28,
UNW_PPC64_R29,
UNW_PPC64_R30,
UNW_PPC64_R31, /* called HARD_FRAME_POINTER in gcc */
UNW_PPC64_F0 = 32,
UNW_PPC64_F1,
UNW_PPC64_F2,
UNW_PPC64_F3,
UNW_PPC64_F4,
UNW_PPC64_F5,
UNW_PPC64_F6,
UNW_PPC64_F7,
UNW_PPC64_F8,
UNW_PPC64_F9,
UNW_PPC64_F10,
UNW_PPC64_F11,
UNW_PPC64_F12,
UNW_PPC64_F13,
UNW_PPC64_F14,
UNW_PPC64_F15,
UNW_PPC64_F16,
UNW_PPC64_F17,
UNW_PPC64_F18,
UNW_PPC64_F19,
UNW_PPC64_F20,
UNW_PPC64_F21,
UNW_PPC64_F22,
UNW_PPC64_F23,
UNW_PPC64_F24,
UNW_PPC64_F25,
UNW_PPC64_F26,
UNW_PPC64_F27,
UNW_PPC64_F28,
UNW_PPC64_F29,
UNW_PPC64_F30,
UNW_PPC64_F31,
/* Note that there doesn't appear to be an .eh_frame register column
for the FPSCR register. I don't know why this is. Since .eh_frame
info is what this implementation uses for unwinding, we have no way
to unwind this register, and so we will not expose an FPSCR register
number in the libunwind API.
*/
UNW_PPC64_LR = 65,
UNW_PPC64_CTR = 66,
UNW_PPC64_ARG_POINTER = 67,
UNW_PPC64_CR0 = 68,
UNW_PPC64_CR1,
UNW_PPC64_CR2,
UNW_PPC64_CR3,
UNW_PPC64_CR4,
/* CR5 .. CR7 are currently unused */
UNW_PPC64_CR5,
UNW_PPC64_CR6,
UNW_PPC64_CR7,
UNW_PPC64_XER = 76,
UNW_PPC64_V0 = 77,
UNW_PPC64_V1,
UNW_PPC64_V2,
UNW_PPC64_V3,
UNW_PPC64_V4,
UNW_PPC64_V5,
UNW_PPC64_V6,
UNW_PPC64_V7,
UNW_PPC64_V8,
UNW_PPC64_V9,
UNW_PPC64_V10,
UNW_PPC64_V11,
UNW_PPC64_V12,
UNW_PPC64_V13,
UNW_PPC64_V14,
UNW_PPC64_V15,
UNW_PPC64_V16,
UNW_PPC64_V17,
UNW_PPC64_V18,
UNW_PPC64_V19,
UNW_PPC64_V20,
UNW_PPC64_V21,
UNW_PPC64_V22,
UNW_PPC64_V23,
UNW_PPC64_V24,
UNW_PPC64_V25,
UNW_PPC64_V26,
UNW_PPC64_V27,
UNW_PPC64_V28,
UNW_PPC64_V29,
UNW_PPC64_V30,
UNW_PPC64_V31,
UNW_PPC64_VRSAVE = 109,
UNW_PPC64_VSCR = 110,
UNW_PPC64_SPE_ACC = 111,
UNW_PPC64_SPEFSCR = 112,
/* frame info (read-only) */
UNW_PPC64_FRAME_POINTER,
UNW_PPC64_NIP,
UNW_TDEP_LAST_REG = UNW_PPC64_NIP,
UNW_TDEP_IP = UNW_PPC64_NIP,
UNW_TDEP_SP = UNW_PPC64_R1,
UNW_TDEP_EH = UNW_PPC64_R12
}
ppc64_regnum_t;
/*
* According to David Edelsohn, GNU gcc uses R3, R4, R5, and maybe R6 for
* passing parameters to exception handlers.
*/
#define UNW_TDEP_NUM_EH_REGS 4
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On ppc64, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
/* XXX this is not ideal: an application should not be prevented from
using the "getcontext" name just because it's using libunwind. We
can't just use __getcontext() either, because that isn't exported
by glibc... */
#define unw_tdep_getcontext(uc) (getcontext (uc), 0)
#include "libunwind-dynamic.h"
typedef struct
{
/* no ppc64-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
+63
View File
@@ -0,0 +1,63 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
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. */
#ifndef libunwind_ptrace_h
#define libunwind_ptrace_h
#include <libunwind.h>
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
/* Helper routines which make it easy to use libunwind via ptrace().
They're available only if UNW_REMOTE_ONLY is _not_ defined and they
aren't really part of the libunwind API. They are implemented in a
archive library called libunwind-ptrace.a. */
extern void *_UPT_create (pid_t);
extern void _UPT_destroy (void *);
extern int _UPT_find_proc_info (unw_addr_space_t, unw_word_t,
unw_proc_info_t *, int, void *);
extern void _UPT_put_unwind_info (unw_addr_space_t, unw_proc_info_t *, void *);
extern int _UPT_get_dyn_info_list_addr (unw_addr_space_t, unw_word_t *,
void *);
extern int _UPT_access_mem (unw_addr_space_t, unw_word_t, unw_word_t *, int,
void *);
extern int _UPT_access_reg (unw_addr_space_t, unw_regnum_t, unw_word_t *,
int, void *);
extern int _UPT_access_fpreg (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *,
int, void *);
extern int _UPT_get_proc_name (unw_addr_space_t, unw_word_t, char *, size_t,
unw_word_t *, void *);
extern int _UPT_resume (unw_addr_space_t, unw_cursor_t *, void *);
extern unw_accessors_t _UPT_accessors;
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* libunwind_ptrace_h */
+120
View File
@@ -0,0 +1,120 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2008 CodeSourcery
Copyright (C) 2012 Tommi Rantala <[email protected]>
This file is part of libunwind.
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. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <inttypes.h>
#include <stddef.h>
#include <ucontext.h>
#define UNW_TARGET sh
#define UNW_TARGET_SH 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 4096
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
typedef long double unw_tdep_fpreg_t;
typedef enum
{
UNW_SH_R0,
UNW_SH_R1,
UNW_SH_R2,
UNW_SH_R3,
UNW_SH_R4,
UNW_SH_R5,
UNW_SH_R6,
UNW_SH_R7,
UNW_SH_R8,
UNW_SH_R9,
UNW_SH_R10,
UNW_SH_R11,
UNW_SH_R12,
UNW_SH_R13,
UNW_SH_R14,
UNW_SH_R15,
UNW_SH_PC,
UNW_SH_PR,
UNW_TDEP_LAST_REG = UNW_SH_PR,
UNW_TDEP_IP = UNW_SH_PR,
UNW_TDEP_SP = UNW_SH_R15,
UNW_TDEP_EH = UNW_SH_R0
}
sh_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 2
typedef ucontext_t unw_tdep_context_t;
#define unw_tdep_getcontext(uc) (getcontext (uc), 0)
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
#include "libunwind-dynamic.h"
typedef struct
{
/* no sh-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
+193
View File
@@ -0,0 +1,193 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2002-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
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. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <sys/types.h>
#include <inttypes.h>
#include <ucontext.h>
#define UNW_TARGET x86
#define UNW_TARGET_X86 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 127
typedef uint32_t unw_word_t;
typedef int32_t unw_sword_t;
typedef union {
struct { uint8_t b[4]; } val32;
struct { uint8_t b[10]; } val80;
struct { uint8_t b[16]; } val128;
} unw_tdep_fpreg_t;
typedef enum
{
/* Note: general registers are expected to start with index 0.
This convention facilitates architecture-independent
implementation of the C++ exception handling ABI. See
_Unwind_SetGR() and _Unwind_GetGR() for details.
The described register usage convention is based on "System V
Application Binary Interface, Intel386 Architecture Processor
Supplement, Fourth Edition" at
http://www.linuxbase.org/spec/refspecs/elf/abi386-4.pdf
It would have been nice to use the same register numbering as
DWARF, but that doesn't work because the libunwind requires
that the exception argument registers be consecutive, which the
wouldn't be with the DWARF numbering. */
UNW_X86_EAX, /* scratch (exception argument 1) */
UNW_X86_EDX, /* scratch (exception argument 2) */
UNW_X86_ECX, /* scratch */
UNW_X86_EBX, /* preserved */
UNW_X86_ESI, /* preserved */
UNW_X86_EDI, /* preserved */
UNW_X86_EBP, /* (optional) frame-register */
UNW_X86_ESP, /* (optional) frame-register */
UNW_X86_EIP, /* frame-register */
UNW_X86_EFLAGS, /* scratch (except for "direction", which is fixed */
UNW_X86_TRAPNO, /* scratch */
/* MMX/stacked-fp registers */
UNW_X86_ST0, /* fp return value */
UNW_X86_ST1, /* scratch */
UNW_X86_ST2, /* scratch */
UNW_X86_ST3, /* scratch */
UNW_X86_ST4, /* scratch */
UNW_X86_ST5, /* scratch */
UNW_X86_ST6, /* scratch */
UNW_X86_ST7, /* scratch */
UNW_X86_FCW, /* scratch */
UNW_X86_FSW, /* scratch */
UNW_X86_FTW, /* scratch */
UNW_X86_FOP, /* scratch */
UNW_X86_FCS, /* scratch */
UNW_X86_FIP, /* scratch */
UNW_X86_FEA, /* scratch */
UNW_X86_FDS, /* scratch */
/* SSE registers */
UNW_X86_XMM0_lo, /* scratch */
UNW_X86_XMM0_hi, /* scratch */
UNW_X86_XMM1_lo, /* scratch */
UNW_X86_XMM1_hi, /* scratch */
UNW_X86_XMM2_lo, /* scratch */
UNW_X86_XMM2_hi, /* scratch */
UNW_X86_XMM3_lo, /* scratch */
UNW_X86_XMM3_hi, /* scratch */
UNW_X86_XMM4_lo, /* scratch */
UNW_X86_XMM4_hi, /* scratch */
UNW_X86_XMM5_lo, /* scratch */
UNW_X86_XMM5_hi, /* scratch */
UNW_X86_XMM6_lo, /* scratch */
UNW_X86_XMM6_hi, /* scratch */
UNW_X86_XMM7_lo, /* scratch */
UNW_X86_XMM7_hi, /* scratch */
UNW_X86_MXCSR, /* scratch */
/* segment registers */
UNW_X86_GS, /* special */
UNW_X86_FS, /* special */
UNW_X86_ES, /* special */
UNW_X86_DS, /* special */
UNW_X86_SS, /* special */
UNW_X86_CS, /* special */
UNW_X86_TSS, /* special */
UNW_X86_LDT, /* special */
/* frame info (read-only) */
UNW_X86_CFA,
UNW_X86_XMM0, /* scratch */
UNW_X86_XMM1, /* scratch */
UNW_X86_XMM2, /* scratch */
UNW_X86_XMM3, /* scratch */
UNW_X86_XMM4, /* scratch */
UNW_X86_XMM5, /* scratch */
UNW_X86_XMM6, /* scratch */
UNW_X86_XMM7, /* scratch */
UNW_TDEP_LAST_REG = UNW_X86_XMM7,
UNW_TDEP_IP = UNW_X86_EIP,
UNW_TDEP_SP = UNW_X86_ESP,
UNW_TDEP_EH = UNW_X86_EAX
}
x86_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 2 /* eax and edx are exception args */
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On x86, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
#include "libunwind-dynamic.h"
typedef struct
{
/* no x86-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-common.h"
#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
extern int unw_tdep_getcontext (unw_tdep_context_t *);
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
+145
View File
@@ -0,0 +1,145 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2002-2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
Modified for x86_64 by Max Asbock <[email protected]>
This file is part of libunwind.
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. */
#ifndef LIBUNWIND_H
#define LIBUNWIND_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <sys/types.h>
#include <inttypes.h>
#include <ucontext.h>
#define UNW_TARGET x86_64
#define UNW_TARGET_X86_64 1
#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
/* This needs to be big enough to accommodate "struct cursor", while
leaving some slack for future expansion. Changing this value will
require recompiling all users of this library. Stack allocation is
relatively cheap and unwind-state copying is relatively rare, so we
want to err on making it rather too big than too small. */
#define UNW_TDEP_CURSOR_LEN 127
typedef uint64_t unw_word_t;
typedef int64_t unw_sword_t;
typedef long double unw_tdep_fpreg_t;
typedef enum
{
UNW_X86_64_RAX,
UNW_X86_64_RDX,
UNW_X86_64_RCX,
UNW_X86_64_RBX,
UNW_X86_64_RSI,
UNW_X86_64_RDI,
UNW_X86_64_RBP,
UNW_X86_64_RSP,
UNW_X86_64_R8,
UNW_X86_64_R9,
UNW_X86_64_R10,
UNW_X86_64_R11,
UNW_X86_64_R12,
UNW_X86_64_R13,
UNW_X86_64_R14,
UNW_X86_64_R15,
UNW_X86_64_RIP,
#ifdef CONFIG_MSABI_SUPPORT
UNW_X86_64_XMM0,
UNW_X86_64_XMM1,
UNW_X86_64_XMM2,
UNW_X86_64_XMM3,
UNW_X86_64_XMM4,
UNW_X86_64_XMM5,
UNW_X86_64_XMM6,
UNW_X86_64_XMM7,
UNW_X86_64_XMM8,
UNW_X86_64_XMM9,
UNW_X86_64_XMM10,
UNW_X86_64_XMM11,
UNW_X86_64_XMM12,
UNW_X86_64_XMM13,
UNW_X86_64_XMM14,
UNW_X86_64_XMM15,
UNW_TDEP_LAST_REG = UNW_X86_64_XMM15,
#else
UNW_TDEP_LAST_REG = UNW_X86_64_RIP,
#endif
/* XXX Add other regs here */
/* frame info (read-only) */
UNW_X86_64_CFA,
UNW_TDEP_IP = UNW_X86_64_RIP,
UNW_TDEP_SP = UNW_X86_64_RSP,
UNW_TDEP_BP = UNW_X86_64_RBP,
UNW_TDEP_EH = UNW_X86_64_RAX
}
x86_64_regnum_t;
#define UNW_TDEP_NUM_EH_REGS 2 /* XXX Not sure what this means */
typedef struct unw_tdep_save_loc
{
/* Additional target-dependent info on a save location. */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_save_loc_t;
/* On x86_64, we can directly use ucontext_t as the unwind context. */
typedef ucontext_t unw_tdep_context_t;
typedef struct
{
/* no x86-64-specific auxiliary proc-info */
/* ANDROID support update. */
char __reserved;
/* End of ANDROID update. */
}
unw_tdep_proc_info_t;
#include "libunwind-dynamic.h"
#include "libunwind-common.h"
#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext)
#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
extern int unw_tdep_getcontext (unw_tdep_context_t *);
extern int unw_tdep_is_fpreg (int);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* LIBUNWIND_H */
+34
View File
@@ -0,0 +1,34 @@
/* Provide a real file - not a symlink - as it would cause multiarch conflicts
when multiple different arch releases are installed simultaneously. */
#ifndef UNW_REMOTE_ONLY
#if defined __aarch64__
#include "libunwind-aarch64.h"
#elif defined __arm__
# include "libunwind-arm.h"
#elif defined __hppa__
# include "libunwind-hppa.h"
#elif defined __ia64__
# include "libunwind-ia64.h"
#elif defined __mips__
# include "libunwind-mips.h"
#elif defined __powerpc__ && !defined __powerpc64__
# include "libunwind-ppc32.h"
#elif defined __powerpc64__
# include "libunwind-ppc64.h"
#elif defined __sh__
# include "libunwind-sh.h"
#elif defined __i386__
# include "libunwind-x86.h"
#elif defined __x86_64__
# include "libunwind-x86_64.h"
#else
# error "Unsupported arch"
#endif
#else /* UNW_REMOTE_ONLY */
# include "libunwind-arm.h"
#endif /* UNW_REMOTE_ONLY */
+154
View File
@@ -0,0 +1,154 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2003 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
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. */
#ifndef _UNWIND_H
#define _UNWIND_H
/* For uint64_t */
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Minimal interface as per C++ ABI draft standard:
http://www.codesourcery.com/cxx-abi/abi-eh.html */
typedef enum
{
_URC_NO_REASON = 0,
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
_URC_FATAL_PHASE2_ERROR = 2,
_URC_FATAL_PHASE1_ERROR = 3,
_URC_NORMAL_STOP = 4,
_URC_END_OF_STACK = 5,
_URC_HANDLER_FOUND = 6,
_URC_INSTALL_CONTEXT = 7,
_URC_CONTINUE_UNWIND = 8
}
_Unwind_Reason_Code;
typedef int _Unwind_Action;
#define _UA_SEARCH_PHASE 1
#define _UA_CLEANUP_PHASE 2
#define _UA_HANDLER_FRAME 4
#define _UA_FORCE_UNWIND 8
struct _Unwind_Context; /* opaque data-structure */
struct _Unwind_Exception; /* forward-declaration */
typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
struct _Unwind_Exception *);
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action,
uint64_t,
struct _Unwind_Exception *,
struct _Unwind_Context *,
void *);
/* The C++ ABI requires exception_class, private_1, and private_2 to
be of type uint64 and the entire structure to be
double-word-aligned. Please note that exception_class stays 64-bit
even on 32-bit machines for gcc compatibility. */
struct _Unwind_Exception
{
uint64_t exception_class;
_Unwind_Exception_Cleanup_Fn exception_cleanup;
unsigned long private_1;
unsigned long private_2;
} __attribute__((__aligned__));
extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
_Unwind_Stop_Fn, void *);
extern void _Unwind_Resume (struct _Unwind_Exception *);
extern void _Unwind_DeleteException (struct _Unwind_Exception *);
extern unsigned long _Unwind_GetGR (struct _Unwind_Context *, int);
extern void _Unwind_SetGR (struct _Unwind_Context *, int, unsigned long);
extern unsigned long _Unwind_GetIP (struct _Unwind_Context *);
extern unsigned long _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned long);
extern unsigned long _Unwind_GetLanguageSpecificData (struct _Unwind_Context*);
extern unsigned long _Unwind_GetRegionStart (struct _Unwind_Context *);
#ifdef _GNU_SOURCE
/* Callback for _Unwind_Backtrace(). The backtrace stops immediately
if the callback returns any value other than _URC_NO_REASON. */
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *,
void *);
/* See http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00082.html for why
_UA_END_OF_STACK exists. */
# define _UA_END_OF_STACK 16
/* If the unwind was initiated due to a forced unwind, resume that
operation, else re-raise the exception. This is used by
__cxa_rethrow(). */
extern _Unwind_Reason_Code
_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
/* See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html for why
_Unwind_GetBSP() exists. */
extern unsigned long _Unwind_GetBSP (struct _Unwind_Context *);
/* Return the "canonical frame address" for the given context.
This is used by NPTL... */
extern unsigned long _Unwind_GetCFA (struct _Unwind_Context *);
/* Return the base-address for data references. */
extern unsigned long _Unwind_GetDataRelBase (struct _Unwind_Context *);
/* Return the base-address for text references. */
extern unsigned long _Unwind_GetTextRelBase (struct _Unwind_Context *);
/* Call _Unwind_Trace_Fn once for each stack-frame, without doing any
cleanup. The first frame for which the callback is invoked is the
one for the caller of _Unwind_Backtrace(). _Unwind_Backtrace()
returns _URC_END_OF_STACK when the backtrace stopped due to
reaching the end of the call-chain or _URC_FATAL_PHASE1_ERROR if it
stops for any other reason. */
extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
/* Find the start-address of the procedure containing the specified IP
or NULL if it cannot be found (e.g., because the function has no
unwind info). Note: there is not necessarily a one-to-one
correspondence between source-level functions and procedures: some
functions don't have unwind-info and others are split into multiple
procedures. */
extern void *_Unwind_FindEnclosingFunction (void *);
/* See also Linux Standard Base Spec:
http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/libgcc-s.html */
#endif /* _GNU_SOURCE */
#ifdef __cplusplus
};
#endif
#endif /* _UNWIND_H */
Vendored Submodule
+1
Submodule external/buildtools added at a7dbffc17d.
+1 -1
+1 -1
Vendored Submodule
+1
+2 -4
View File
@@ -233,10 +233,8 @@ AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
AC_MSG_CHECKING(for __sync_bool_compare_and_swap)
AC_TRY_COMPILE([],[
volatile unsigned int foo = 0;
int main(int argc, char** argv) {
unsigned int r1 = __sync_bool_compare_and_swap(&foo, 0, 1);
return 0;
}
unsigned int r1 = __sync_bool_compare_and_swap(&foo, 0, 1);
return 0;
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAS___SYNC_BOOL_COMPARE_AND_SWAP)
+1 -1
View File
@@ -184,7 +184,7 @@ static GC_thread GC_new_thread(void) {
#ifdef __GNUC__
__inline__
#endif
LONG GC_get_max_thread_index()
static LONG GC_get_max_thread_index()
{
LONG my_max = GC_max_thread_index;
+2
View File
@@ -0,0 +1,2 @@
/Makefile
/Makefile.in
+30
View File
@@ -0,0 +1,30 @@
#
# Conditional submodule for llvm
#
# make reset-llvm will checkout a version of llvm which is suitable for this version of mono
# into $top_srcdir/llvm/llvm.
#
LLVM_PATH=llvm
SUBMODULES_CONFIG_FILE = $(top_srcdir)/llvm/SUBMODULES.json
include $(top_srcdir)/scripts/submodules/versions.mk
$(eval $(call ValidateVersionTemplate,llvm,LLVM))
# Bump the given submodule to the revision given by the REV make variable
# If COMMIT is 1, commit the change
bump-llvm: __bump-version-llvm
# Bump the given submodule to the branch given by the BRANCH/REMOTE_BRANCH make variables
# If COMMIT is 1, commit the change
bump-branch-llvm: __bump-branch-llvm
# Bump the given submodule to its current GIT version
# If COMMIT is 1, commit the change
bump-current-llvm: __bump-current-version-llvm
clean-local:
$(RM) -r $(LLVM_PATH)
EXTRA_DIST=SUBMODULES.json
+10
View File
@@ -0,0 +1,10 @@
[
{
"name": "llvm",
"url": "git://github.com/mono/llvm.git",
"rev": "9f79399f87282524fee099b328bd8cbf07929daf",
"remote-branch": "origin/master",
"branch": "master",
"directory": "llvm"
}
]
+1 -1
View File
@@ -26,7 +26,7 @@ AC_DEFUN([AM_NLS],
dnl Default is enabled NLS
AC_ARG_ENABLE([nls],
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
USE_NLS=$enableval, USE_NLS=profile_default)
AC_MSG_RESULT([$USE_NLS])
AC_SUBST([USE_NLS])
])
+56 -15
View File
@@ -21,9 +21,34 @@ default only the assemblies specified in the command line will be
included in the bundle. To automatically include all of the
dependencies referenced, use the "--deps" command line option.
.PP
Use \fImkbundle\FP when you want the startup runtime to load the 1.0
profile, and use \fImkbundle2\fP when you want the startup runtime to load
the 2.0 profile.
There are two modes of operation, the default one uses the
C compiler to create a bundle and requires a complete C and Mono SDK
to produced executables. The simple mode (enabled when using the
"--simple") command line option does not require this, and also allows
for cross compilation.
.PP
For example, to create a bundle for hello world, use the following
command:
.nf
$ mkbundle -o hello --simple hello.exe
.fi
.PP
The simple version allows for cross-compiling, this requires a Mono
runtime to be installed in the ~/.mono/targets/TARGET/mono to be
available. You can use the "--local-targets" to list all available
targets, and the "--cross" argument to specify the target, like this:
.nf
$ mkbundle --local-targets
Available targets:
default - Current System Mono
4.4.0-macosx-x86
4.4.0-debian-8-arm64
$ mkbundle --cross 4.4.0-debian-8-powerpc hello.exe -o hello-debian
.fi
.PP
The above will bundle your native library into hello-debian for
a Debian 8 system running on a PowerPC machine.
.SH OLD EMBEDDING
.PP
For example, to create a bundle for hello world, use the following
command:
@@ -57,6 +82,12 @@ are available to the embedded runtime.
.I "-c"
Produce the stub file, do not compile the resulting stub.
.TP
.I "--cross target"
Creates a bundle for the specified target platform. The target
must be a directory in ~/.mono/targets/ that contains a "mono"
binary. You can fetch various targets using the --fetch-target
command line option.
.TP
.I "-o filename"
Places the output on `out'. If the flag -c is specified, this is the
C host program. If not, this contains the resulting executable.
@@ -74,20 +105,31 @@ Typically this is $prefix/etc/mono/1.0/machine.config or
$prefix/etc/mono/2.0/machine.config depending on the profile that you
are using (1.0 or 2.0)
.TP
.I "--nodeps"
This is the default: \fImkbundle\fP will only include the assemblies that
were specified on the command line to reduce the size of the resulting
image created.
.TP
.I "--deps"
This option will bundle all of the referenced assemblies for the
assemblies listed on the command line option. This is useful to
distribute a self-contained image.
.TP
.I "--fetch-target target"
Downloads a precompiled runtime for the specified target from the Mono
distribution site.
.TP
.I "--nodeps"
This is the default: \fImkbundle\fP will only include the assemblies that
were specified on the command line to reduce the size of the resulting
image created.
.TP
.I "--keeptemp"
By default \fImkbundle\fP will delete the temporary files that it uses to
produce the bundle. This option keeps the file around.
.TP
.I "--lists-targets"
Lists all of the available local cross compilation targets available
as precompiled binaries on the Mono distribution server.
.TP
.I "--local-targets"
Lists all of the available local cross compilation targets.
.TP
.I "--machine-config FILE"
Uses the given FILE as the machine.config file for the generated
application.
@@ -102,13 +144,10 @@ When passed, DIR will be set for the MONO_CFG_DIR environment variable
By default \fImkbundle\fP dynamically links to mono and glib. This option
causes it to statically link instead.
.TP
.B Important:
Since the Mono runtime is licensed under the LGPL, even if you use
static you should transfer the component pieces of the mkbundle to
your users so they are able to upgrade the Mono runtime on their own.
.TP
If you want to use this for commercial licenses, you must obtain a
proprietary license for Mono from [email protected]
.I "--target-server SERVER"
By default the mkbundle tool will download from a Mono server the
target runtimes, you can specify a different server to provide
cross-compiled runtimes.
.TP
.I "-z"
Compresses the assemblies before embedding. This results in smaller
@@ -133,6 +172,8 @@ Mono runtime, separated by spaces. See the mono(1) manual page or run mono --hel
.SH FILES
This program will load referenced assemblies from the Mono assembly
cache.
.PP
Targets are loaded from ~/.mono/targets/TARGETNAME/mono
.SH BUGS
The option "--static" is not supported under Windows.
Moreover, a full cygwin environment containing at least "gcc" and "as"
+11 -14
View File
@@ -9,26 +9,23 @@
mono-symbolicate \- Mono Symbolicate Tool
.SH SYNOPSIS
.PP
.B mono-symbolicate exefile stacktracesfile [directories...]
.B mono-symbolicate <msym dir> <input file>
.PP
.B mono-symbolicate store-symbols <msym dir> [<dir>]+
.SH DESCRIPTION
mono-symbolicate is a tool that converts a stack trace with <filename unknown>:0
into one with file names and line numbers.
.PP
The output of calling this tool will be the provided
.I stacktracesfile
where <filename unknown>:0 parts are replaced by
a file name and a line number.
When mono-symbolicate is called with a symbol directory and a file containing a stacktrace:
.P
.B mono-symbolicate <msym dir> <input file>
.PP
For the tool to work it needs to load referenced assemblies, it will first look
in the same folder as
.I exefile
then from one of the provided
.I directories.
The tool writes into stdout the file contents while adding file location to stack frames when
it is possible to symbolicate with the symbols available on the symbol directory.
.PP
The tool assumes that the folder with a referenced assembly called for example
name.dll will also include name.dll.mdb,
if the referenced assembly is AOT compiled then the tool is also expecting to find
name.dll.msym.
Managed symbols .exe/.dll can be added to the symbol directory by doing:
.P
.B mono-symbolicate store-symbols <msym dir> [<dir>]+
.SH AUTHOR
Written by Marcos Henrich
.SH COPYRIGHT
+36 -36
View File
@@ -7,7 +7,7 @@
.\" Author:
.\" Miguel de Icaza ([email protected])
.\"
.TH Mono "Mono 3.0"
.TH Mono "Mono 4.7.0"
.SH NAME
mono \- Mono's ECMA-CLI native code generator (Just-in-Time and Ahead-of-Time)
.SH SYNOPSIS
@@ -142,6 +142,11 @@ instead of going through the operating system symbol lookup operation.
.I llvm-path=<PREFIX>
Same for the llvm tools 'opt' and 'llc'.
.TP
.I msym-dir=<PATH>
Instructs the AOT compiler to generate offline sequence points .msym files.
The generated .msym files will be stored into a subfolder of <PATH> named as the
compilation AOTID.
.TP
.I mtriple=<TRIPLE>
Use the GNU style target triple <TRIPLE> to determine some code generation options, i.e.
--mtriple=armv7-linux-gnueabi will generate code that targets ARMv7. This is currently
@@ -1089,18 +1094,13 @@ find spots that need to be tuned for this mode of operation. Alternatively,
this mode can be enabled at compile time by using the --with-cooperative-gc
flag when calling configure.
.TP
\fBMONO_ENABLE_SHM\fR
Unix only: Enable support for cross-process handles. Cross-process
handles are used to expose process handles, thread handles, named
mutexes, named events and named semaphores across Unix processes.
.TP
\fBMONO_ENV_OPTIONS\fR
This environment variable allows you to pass command line arguments to
a Mono process through the environment. This is useful for example
to force all of your Mono processes to use LLVM or SGEN without having
to modify any launch scripts.
.TP
\fBMONO_ENV_OPTIONS\fR
\fBMONO_SDB_ENV_OPTIONS\fR
Used to pass extra options to the debugger agent in the runtime, as they were passed
using --debugger-agent=.
.TP
@@ -1302,12 +1302,12 @@ statistics when shutting down.
.TP
\fBcollect-before-allocs\fR
.TP
\fBcheck-at-minor-collections\fR
This performs a consistency check on minor collections and also clears
the nursery at collection time, instead of the default, when buffers
are allocated (clear-at-gc). The consistency check ensures that
there are no major to minor references that are not on the remembered
sets.
\fBcheck-remset-consistency\fR
This performs a remset consistency check at various opportunities, and
also clears the nursery at collection time, instead of the default,
when buffers are allocated (clear-at-gc). The consistency check
ensures that there are no major to minor references that are not on
the remembered sets.
.TP
\fBmod-union-consistency-check\fR
Checks that the mod-union cardtable is consistent before each
@@ -1508,24 +1508,6 @@ For a complete description of recommended practices for application
deployment, see
http://www.mono-project.com/docs/getting-started/application-deployment/
.TP
\fBMONO_RTC\fR
Experimental RTC support in the statistical profiler: if the user has
the permission, more accurate statistics are gathered. The MONO_RTC
value must be restricted to what the Linux rtc allows: power of two
from 64 to 8192 Hz. To enable higher frequencies like 4096 Hz, run as root:
.nf
echo 4096 > /proc/sys/dev/rtc/max-user-freq
.fi
.Sp
For example:
.nf
MONO_RTC=4096 mono --profiler=default:stat program.exe
.fi
.TP
\fBMONO_SHARED_DIR\fR
If set its the directory where the ".wapi" handle state is stored.
This is the directory where the Windows I/O Emulation layer stores its
@@ -1633,6 +1615,10 @@ option.
When this option is set, the runtime will invalidate the domain memory
pool instead of destroying it.
.TP
\fBdisable_omit_fp\fR
Disables a compiler optimization where the frame pointer is omitted
from the stack. This optimization can interact badly with debuggers.
.TP
\fBdont-free-domains\fR
This is an Optimization for multi-AppDomain applications (most
commonly ASP.NET applications). Due to internal limitations Mono,
@@ -1666,11 +1652,11 @@ Automatically generates sequence points where the
IL stack is empty. These are places where the debugger can set a
breakpoint.
.TP
\fBgen-compact-seq-points\fR
This option generates sequence points data that maps native offsets to
IL offsets. Sequence point data is used to display IL offset in
stacktraces. Stacktraces with IL offsets can be symbolicated using
mono-symbolicate tool.
\fBno-compact-seq-points\fR
Unless the option is used, the runtime generates sequence points data that
maps native offsets to IL offsets. Sequence point data is used to
display IL offset in stacktraces. Stacktraces with IL offsets can be
symbolicated using mono-symbolicate tool.
.TP
\fBhandle-sigint\fR
Captures the interrupt signal (Control-C) and displays a stack trace
@@ -1746,6 +1732,16 @@ messages for a certain component. You can use multiple masks by comma
separating them. For example to see config file messages and assembly loader
messages set you mask to "asm,cfg".
.TP
\fBMONO_LOG_DEST\fR
Controls where trace log messages are written. If not set then the messages go to stdout.
If set, the string either specifies a path to a file that will have messages appended to
it, or the string "syslog" in which case the messages will be written to the system log.
Under Windows, this is simulated by writing to a file called "mono.log".
\fBMONO_LOG_HEADER\fR
Controls whether trace log messages not directed to syslog have the id, timestamp, and
pid as the prefix to the log message. To enable a header this environment variable need
just be non-null.
.TP
\fBMONO_TRACE\fR
Used for runtime tracing of method calls. The format of the comma separated
trace options is:
@@ -1800,6 +1796,10 @@ Enables the maximum JIT verbosity for the specified method. This is
very helpfull to diagnose a miscompilation problems of a specific
method.
.TP
\fBMONO_JIT_DUMP_METHOD\fR
Enables sending of the JITs intermediate representation for a specified
method to the IdealGraphVisualizer tool.
.TP
\fBMONO_VERBOSE_HWCAP\fR
If set, makes the JIT output information about detected CPU features
(such as SSE, CMOV, FCMOV, etc) to stdout.
+21 -3
View File
@@ -137,9 +137,9 @@ to the control port
.IP \[bu] 2
\f[I]sample[=TYPE[/FREQ]]\f[]: collect statistical samples of the
program behaviour.
The default is to collect a 1000 times per second the instruction
pointer.
This is equivalent to the value \[lq]cycles/1000\[rq] for
The default is to collect a 100 times per second (100 Hz) the
instruction pointer.
This is equivalent to the value \[lq]cycles/100\[rq] for
\f[I]TYPE\f[].
On some systems, like with recent Linux kernels, it is possible to
cause the sampling to happen for other events provided by the
@@ -171,6 +171,24 @@ TIMER can have the following values:
collect \f[I]NUM\f[] frames at the most.
The default is 8.
.IP \[bu] 2
\f[I]maxsamples=NUM\f[]: stop allocating reusable sample events
once \f[I]NUM\f[] events have been allocated (a value of zero for
all intents and purposes means unlimited). By default, the value
of this setting is the number of CPU cores multiplied by 1000. This
is usually a good enough value for typical desktop and mobile apps.
If you're losing too many samples due to this default (which is
possible in apps with an unusually high amount of threads), you
may want to tinker with this value to find a good balance between
sample hit rate and performance impact on the app. The way it works
is that sample events are enqueued for reuse after they're flushed
to the output file; if a thread gets a sampling signal but there are
no sample events in the reuse queue and the profiler has reached the
maximum number of sample allocations, the sample gets dropped. So a
higher number for this setting will increase the chance that a
thread is able to collect a sample, but also necessarily means that
there will be more work done by the profiler. You can run Mono with
the \f[I]--stats\f[] option to see statistics about sample events.
.IP \[bu] 2
\f[I]calldepth=NUM\f[]: ignore method enter/leave events when the
call chain depth is bigger than NUM.
.IP \[bu] 2
+9
View File
@@ -20,3 +20,12 @@ class/RabbitMQ.Client/docs/specs/autogenerated-api-qpid-0-8.cs
class/System.Web.Mvc/System.Web.Mvc/Resources/MvcResources.resources
class/System.Web.Mvc2/System.Web.Mvc/Resources/MvcResources.resources
XmlWriter
obj-net_4_x
obj-bare
obj-plainweb
obj-Facades
obj-plaincore
obj-plaindesign
obj-plainservice
obj-secxml
obj-mcs-net_4_x
-481
View File
@@ -1,481 +0,0 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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!
-36
View File
@@ -1,36 +0,0 @@
The Mono code under the mcs/ directory is licensed under various
different licenses:
GNU GPL: details avaliable in the file LICENSE.GPL
GNU LGPL: details available in the file LICENSE.LGPL
MIT X11: text available in the file MIT.X11
MPL: text available in the file LICENSE.MPL
For your convenience copies of the GNU GPL and GNU LGPL are
located in the file COPYING and COPYING.LIB.
* Class Libraries:
All of the core classes licensed under the terms of
the MIT X11 license.
Third party libraries that we distribute for
convenience reasons are distributed under their own
terms (all of them allow development of proprietary
applications with them).
Third party libraries include: ByteFX.Data,
ICSharpCode.SharpZipLib, Npgsql, MicrosoftAjaxLibrary.
The Microsoft.JScript assembly is covered by the
MIT X11 and the Mozilla MPL license as it contains
ported pieces of code from Rhino, the Mozilla JavaScript
implementations
* Mono C# compiler: Dual licensed MIT X11 and GNU GPL.
* Mono Basic compiler: GNU GPL.
* Various tools in the `tools' directory: GNU GPL.
-31
View File
@@ -1,31 +0,0 @@
// Copyright 2006 James Newton-King
// http://www.newtonsoft.com
//
// This work is licensed under the Creative Commons Attribution 2.5 License
// http://creativecommons.org/licenses/by/2.5/
//
// You are free:
// * to copy, distribute, display, and perform the work
// * to make derivative works
// * to make commercial use of the work
//
// Under the following conditions:
// * For any reuse or distribution, you must make clear to others the license terms of this work.
// * Any of these conditions can be waived if you get permission from the copyright holder.
From: james.newtonking@gmail.com [mailto:james.newtonking@gmail.com] On Behalf Of James Newton-King
Sent: Tuesday, June 05, 2007 6:36 AM
To: Konstantin Triger
Subject: Re: Support request by Konstantin Triger for Json.NET
Hey Kosta
I think it would be awesome to use Json.NET in Mono for System.Web.Extensions.
The CC license has the following clause: Any of the above conditions can be waived if you get permission from the copyright holder.
I can waive that statement for you and Mono. Would that be acceptable?
Regards,
James
-15
View File
@@ -1,15 +0,0 @@
Mono compilers and tools.
Copyright (C) 2001, 2002, 2003, Ximian and contributors.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation;
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-15
View File
@@ -1,15 +0,0 @@
Mono class libraries
Copyright (C) Mono project (authors listed in individual ChangeLog entries)
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.
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.
-470
View File
@@ -1,470 +0,0 @@
MOZILLA PUBLIC LICENSE
Version 1.1
---------------
1. Definitions.
1.0.1. "Commercial Use" means distribution or otherwise making the
Covered Code available to a third party.
1.1. "Contributor" means each entity that creates or contributes to
the creation of Modifications.
1.2. "Contributor Version" means the combination of the Original
Code, prior Modifications used by a Contributor, and the Modifications
made by that particular Contributor.
1.3. "Covered Code" means the Original Code or Modifications or the
combination of the Original Code and Modifications, in each case
including portions thereof.
1.4. "Electronic Distribution Mechanism" means a mechanism generally
accepted in the software development community for the electronic
transfer of data.
1.5. "Executable" means Covered Code in any form other than Source
Code.
1.6. "Initial Developer" means the individual or entity identified
as the Initial Developer in the Source Code notice required by Exhibit
A.
1.7. "Larger Work" means a work which combines Covered Code or
portions thereof with code not governed by the terms of this License.
1.8. "License" means this document.
1.8.1. "Licensable" means having the right to grant, to the maximum
extent possible, whether at the time of the initial grant or
subsequently acquired, any and all of the rights conveyed herein.
1.9. "Modifications" means any addition to or deletion from the
substance or structure of either the Original Code or any previous
Modifications. When Covered Code is released as a series of files, a
Modification is:
A. Any addition to or deletion from the contents of a file
containing Original Code or previous Modifications.
B. Any new file that contains any part of the Original Code or
previous Modifications.
1.10. "Original Code" means Source Code of computer software code
which is described in the Source Code notice required by Exhibit A as
Original Code, and which, at the time of its release under this
License is not already Covered Code governed by this License.
1.10.1. "Patent Claims" means any patent claim(s), now owned or
hereafter acquired, including without limitation, method, process,
and apparatus claims, in any patent Licensable by grantor.
1.11. "Source Code" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus
any associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.
1.12. "You" (or "Your") means an individual or a legal entity
exercising rights under, and complying with all of the terms of, this
License or a future version of this License issued under Section 6.1.
For legal entities, "You" includes any entity which controls, is
controlled by, or is under common control with You. For purposes of
this definition, "control" means (a) the power, direct or indirect,
to cause the direction or management of such entity, whether by
contract or otherwise, or (b) ownership of more than fifty percent
(50%) of the outstanding shares or beneficial ownership of such
entity.
2. Source Code License.
2.1. The Initial Developer Grant.
The Initial Developer hereby grants You a world-wide, royalty-free,
non-exclusive license, subject to third party intellectual property
claims:
(a) under intellectual property rights (other than patent or
trademark) Licensable by Initial Developer to use, reproduce,
modify, display, perform, sublicense and distribute the Original
Code (or portions thereof) with or without Modifications, and/or
as part of a Larger Work; and
(b) under Patents Claims infringed by the making, using or
selling of Original Code, to make, have made, use, practice,
sell, and offer for sale, and/or otherwise dispose of the
Original Code (or portions thereof).
(c) the licenses granted in this Section 2.1(a) and (b) are
effective on the date Initial Developer first distributes
Original Code under the terms of this License.
(d) Notwithstanding Section 2.1(b) above, no patent license is
granted: 1) for code that You delete from the Original Code; 2)
separate from the Original Code; or 3) for infringements caused
by: i) the modification of the Original Code or ii) the
combination of the Original Code with other software or devices.
2.2. Contributor Grant.
Subject to third party intellectual property claims, each Contributor
hereby grants You a world-wide, royalty-free, non-exclusive license
(a) under intellectual property rights (other than patent or
trademark) Licensable by Contributor, to use, reproduce, modify,
display, perform, sublicense and distribute the Modifications
created by such Contributor (or portions thereof) either on an
unmodified basis, with other Modifications, as Covered Code
and/or as part of a Larger Work; and
(b) under Patent Claims infringed by the making, using, or
selling of Modifications made by that Contributor either alone
and/or in combination with its Contributor Version (or portions
of such combination), to make, use, sell, offer for sale, have
made, and/or otherwise dispose of: 1) Modifications made by that
Contributor (or portions thereof); and 2) the combination of
Modifications made by that Contributor with its Contributor
Version (or portions of such combination).
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
effective on the date Contributor first makes Commercial Use of
the Covered Code.
(d) Notwithstanding Section 2.2(b) above, no patent license is
granted: 1) for any code that Contributor has deleted from the
Contributor Version; 2) separate from the Contributor Version;
3) for infringements caused by: i) third party modifications of
Contributor Version or ii) the combination of Modifications made
by that Contributor with other software (except as part of the
Contributor Version) or other devices; or 4) under Patent Claims
infringed by Covered Code in the absence of Modifications made by
that Contributor.
3. Distribution Obligations.
3.1. Application of License.
The Modifications which You create or to which You contribute are
governed by the terms of this License, including without limitation
Section 2.2. The Source Code version of Covered Code may be
distributed only under the terms of this License or a future version
of this License released under Section 6.1, and You must include a
copy of this License with every copy of the Source Code You
distribute. You may not offer or impose any terms on any Source Code
version that alters or restricts the applicable version of this
License or the recipients' rights hereunder. However, You may include
an additional document offering the additional rights described in
Section 3.5.
3.2. Availability of Source Code.
Any Modification which You create or to which You contribute must be
made available in Source Code form under the terms of this License
either on the same media as an Executable version or via an accepted
Electronic Distribution Mechanism to anyone to whom you made an
Executable version available; and if made available via Electronic
Distribution Mechanism, must remain available for at least twelve (12)
months after the date it initially became available, or at least six
(6) months after a subsequent version of that particular Modification
has been made available to such recipients. You are responsible for
ensuring that the Source Code version remains available even if the
Electronic Distribution Mechanism is maintained by a third party.
3.3. Description of Modifications.
You must cause all Covered Code to which You contribute to contain a
file documenting the changes You made to create that Covered Code and
the date of any change. You must include a prominent statement that
the Modification is derived, directly or indirectly, from Original
Code provided by the Initial Developer and including the name of the
Initial Developer in (a) the Source Code, and (b) in any notice in an
Executable version or related documentation in which You describe the
origin or ownership of the Covered Code.
3.4. Intellectual Property Matters
(a) Third Party Claims.
If Contributor has knowledge that a license under a third party's
intellectual property rights is required to exercise the rights
granted by such Contributor under Sections 2.1 or 2.2,
Contributor must include a text file with the Source Code
distribution titled "LEGAL" which describes the claim and the
party making the claim in sufficient detail that a recipient will
know whom to contact. If Contributor obtains such knowledge after
the Modification is made available as described in Section 3.2,
Contributor shall promptly modify the LEGAL file in all copies
Contributor makes available thereafter and shall take other steps
(such as notifying appropriate mailing lists or newsgroups)
reasonably calculated to inform those who received the Covered
Code that new knowledge has been obtained.
(b) Contributor APIs.
If Contributor's Modifications include an application programming
interface and Contributor has knowledge of patent licenses which
are reasonably necessary to implement that API, Contributor must
also include this information in the LEGAL file.
(c) Representations.
Contributor represents that, except as disclosed pursuant to
Section 3.4(a) above, Contributor believes that Contributor's
Modifications are Contributor's original creation(s) and/or
Contributor has sufficient rights to grant the rights conveyed by
this License.
3.5. Required Notices.
You must duplicate the notice in Exhibit A in each file of the Source
Code. If it is not possible to put such notice in a particular Source
Code file due to its structure, then You must include such notice in a
location (such as a relevant directory) where a user would be likely
to look for such a notice. If You created one or more Modification(s)
You may add your name as a Contributor to the notice described in
Exhibit A. You must also duplicate this License in any documentation
for the Source Code where You describe recipients' rights or ownership
rights relating to Covered Code. You may choose to offer, and to
charge a fee for, warranty, support, indemnity or liability
obligations to one or more recipients of Covered Code. However, You
may do so only on Your own behalf, and not on behalf of the Initial
Developer or any Contributor. You must make it absolutely clear than
any such warranty, support, indemnity or liability obligation is
offered by You alone, and You hereby agree to indemnify the Initial
Developer and every Contributor for any liability incurred by the
Initial Developer or such Contributor as a result of warranty,
support, indemnity or liability terms You offer.
3.6. Distribution of Executable Versions.
You may distribute Covered Code in Executable form only if the
requirements of Section 3.1-3.5 have been met for that Covered Code,
and if You include a notice stating that the Source Code version of
the Covered Code is available under the terms of this License,
including a description of how and where You have fulfilled the
obligations of Section 3.2. The notice must be conspicuously included
in any notice in an Executable version, related documentation or
collateral in which You describe recipients' rights relating to the
Covered Code. You may distribute the Executable version of Covered
Code or ownership rights under a license of Your choice, which may
contain terms different from this License, provided that You are in
compliance with the terms of this License and that the license for the
Executable version does not attempt to limit or alter the recipient's
rights in the Source Code version from the rights set forth in this
License. If You distribute the Executable version under a different
license You must make it absolutely clear that any terms which differ
from this License are offered by You alone, not by the Initial
Developer or any Contributor. You hereby agree to indemnify the
Initial Developer and every Contributor for any liability incurred by
the Initial Developer or such Contributor as a result of any such
terms You offer.
3.7. Larger Works.
You may create a Larger Work by combining Covered Code with other code
not governed by the terms of this License and distribute the Larger
Work as a single product. In such a case, You must make sure the
requirements of this License are fulfilled for the Covered Code.
4. Inability to Comply Due to Statute or Regulation.
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Code due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description
must be included in the LEGAL file described in Section 3.4 and must
be included with all distributions of the Source Code. Except to the
extent prohibited by statute or regulation, such description must be
sufficiently detailed for a recipient of ordinary skill to be able to
understand it.
5. Application of this License.
This License applies to code to which the Initial Developer has
attached the notice in Exhibit A and to related Covered Code.
6. Versions of the License.
6.1. New Versions.
Netscape Communications Corporation ("Netscape") may publish revised
and/or new versions of the License from time to time. Each version
will be given a distinguishing version number.
6.2. Effect of New Versions.
Once Covered Code has been published under a particular version of the
License, You may always continue to use it under the terms of that
version. You may also choose to use such Covered Code under the terms
of any subsequent version of the License published by Netscape. No one
other than Netscape has the right to modify the terms applicable to
Covered Code created under this License.
6.3. Derivative Works.
If You create or use a modified version of this License (which you may
only do in order to apply it to code which is not already Covered Code
governed by this License), You must (a) rename Your license so that
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
"MPL", "NPL" or any confusingly similar phrase do not appear in your
license (except to note that your license differs from this License)
and (b) otherwise make it clear that Your version of the license
contains terms which differ from the Mozilla Public License and
Netscape Public License. (Filling in the name of the Initial
Developer, Original Code or Contributor in the notice described in
Exhibit A shall not of themselves be deemed to be modifications of
this License.)
7. DISCLAIMER OF WARRANTY.
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
8. TERMINATION.
8.1. This License and the rights granted hereunder will terminate
automatically if You fail to comply with terms herein and fail to cure
such breach within 30 days of becoming aware of the breach. All
sublicenses to the Covered Code which are properly granted shall
survive any termination of this License. Provisions which, by their
nature, must remain in effect beyond the termination of this License
shall survive.
8.2. If You initiate litigation by asserting a patent infringement
claim (excluding declatory judgment actions) against Initial Developer
or a Contributor (the Initial Developer or Contributor against whom
You file such action is referred to as "Participant") alleging that:
(a) such Participant's Contributor Version directly or indirectly
infringes any patent, then any and all rights granted by such
Participant to You under Sections 2.1 and/or 2.2 of this License
shall, upon 60 days notice from Participant terminate prospectively,
unless if within 60 days after receipt of notice You either: (i)
agree in writing to pay Participant a mutually agreeable reasonable
royalty for Your past and future use of Modifications made by such
Participant, or (ii) withdraw Your litigation claim with respect to
the Contributor Version against such Participant. If within 60 days
of notice, a reasonable royalty and payment arrangement are not
mutually agreed upon in writing by the parties or the litigation claim
is not withdrawn, the rights granted by Participant to You under
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
the 60 day notice period specified above.
(b) any software, hardware, or device, other than such Participant's
Contributor Version, directly or indirectly infringes any patent, then
any rights granted to You by such Participant under Sections 2.1(b)
and 2.2(b) are revoked effective as of the date You first made, used,
sold, distributed, or had made, Modifications made by that
Participant.
8.3. If You assert a patent infringement claim against Participant
alleging that such Participant's Contributor Version directly or
indirectly infringes any patent where such claim is resolved (such as
by license or settlement) prior to the initiation of patent
infringement litigation, then the reasonable value of the licenses
granted by such Participant under Sections 2.1 or 2.2 shall be taken
into account in determining the amount or value of any payment or
license.
8.4. In the event of termination under Sections 8.1 or 8.2 above,
all end user license agreements (excluding distributors and resellers)
which have been validly granted by You or any distributor hereunder
prior to termination shall survive termination.
9. LIMITATION OF LIABILITY.
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
10. U.S. GOVERNMENT END USERS.
The Covered Code is a "commercial item," as that term is defined in
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
software" and "commercial computer software documentation," as such
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
all U.S. Government End Users acquire Covered Code with only those
rights set forth herein.
11. MISCELLANEOUS.
This License represents the complete agreement concerning subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. This License shall be governed by
California law provisions (except to the extent applicable law, if
any, provides otherwise), excluding its conflict-of-law provisions.
With respect to disputes in which at least one party is a citizen of,
or an entity chartered or registered to do business in the United
States of America, any litigation relating to this License shall be
subject to the jurisdiction of the Federal Courts of the Northern
District of California, with venue lying in Santa Clara County,
California, with the losing party responsible for costs, including
without limitation, court costs and reasonable attorneys' fees and
expenses. The application of the United Nations Convention on
Contracts for the International Sale of Goods is expressly excluded.
Any law or regulation which provides that the language of a contract
shall be construed against the drafter shall not apply to this
License.
12. RESPONSIBILITY FOR CLAIMS.
As between Initial Developer and the Contributors, each party is
responsible for claims and damages arising, directly or indirectly,
out of its utilization of rights under this License and You agree to
work with Initial Developer and Contributors to distribute such
responsibility on an equitable basis. Nothing herein is intended or
shall be deemed to constitute any admission of liability.
13. MULTIPLE-LICENSED CODE.
Initial Developer may designate portions of the Covered Code as
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
Developer permits you to utilize portions of the Covered Code under
Your choice of the NPL or the alternative licenses, if any, specified
by the Initial Developer in the file described in Exhibit A.
EXHIBIT A -Mozilla Public License.
``The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is ______________________________________.
The Initial Developer of the Original Code is ________________________.
Portions created by ______________________ are Copyright (C) ______
_______________________. All Rights Reserved.
Contributor(s): ______________________________________.
Alternatively, the contents of this file may be used under the terms
of the _____ license (the "[___] License"), in which case the
provisions of [______] License are applicable instead of those
above. If you wish to allow use of your version of this file only
under the terms of the [____] License and not to allow others to use
your version of this file under the MPL, indicate your decision by
deleting the provisions above and replace them with the notice and
other provisions required by the [___] License. If you do not delete
the provisions above, a recipient may use your version of this file
under either the MPL or the [___] License."
[NOTE: The text of this Exhibit A may differ slightly from the text of
the notices in the Source Code files of the Original Code. You should
use the text of this Exhibit A rather than the text found in the
Original Code Source Code for Your Modifications.]
-27
View File
@@ -1,27 +0,0 @@
Microsoft Permissive License (Ms-PL)
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the same meaning here as under U.S. copyright law.
A “contribution” is the original software, or any additions or changes to the software.
A “contributor” is any person that distributes its contribution under this license.
“Licensed patents” are a contributor’s patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors’ name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(E) The software is licensed “as-is.” You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
(F) If you distribute the software or derivative works with programs you develop, you agree to indemnify, defend, and hold harmless all contributors from any claims, including attorneys’ fees, related to the distribution or use of your programs. For clarity, you have no such obligations to a contributor for any claims based solely on the unmodified contributions of that contributor.
(G) If you make any additions or changes to the original software, you may only distribute them under a new namespace. In addition, you will clearly identify your changes or additions as your own.
-21
View File
@@ -1,21 +0,0 @@
Copyright (c) 2001, 2002, 2003 Ximian, Inc and the individuals listed
on the ChangeLog entries.
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.
+1 -7
View File
@@ -15,7 +15,7 @@ monotouch_watch_runtime_SUBDIRS := build class
monotouch_tv_runtime_SUBDIRS := build class
xammac_SUBDIRS := build class
mobile_SUBDIRS := build class
mobile_static_SUBDIRS := build class
mobile_static_SUBDIRS := build class ilasm
binary_reference_assemblies_SUBDIRS := build class
net_4_x_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
xammac_net_4_5_SUBDIRS := build class
@@ -86,15 +86,9 @@ package := mcs-$(VERSION)
DISTFILES = \
AUTHORS \
COPYING \
COPYING.LIB \
INSTALL.txt \
LICENSE \
LICENSE.GPL \
LICENSE.LGPL \
LICENSE.MPL \
Makefile \
mkinstalldirs \
MIT.X11 \
MonoIcon.png \
README \
ScalableMonoIcon.svg \
-43
View File
@@ -85,46 +85,3 @@ If you want to only run the tests in a single fixture (say
Thanks a lot to Sergey Chaban for his help during the development of
the C# compiler.
* LICENSE
=========
The mcs C# compiler and monoresgen are licensed to you under the GPL, version 2.
The complete text of the GPL is in the 'COPYING' file.
Copyright (C) 2001-2002 Ximian, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
The class libraries are licensed according to the following license:
Copyright (C) 2001-2002 Ximian, Inc.
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.
+2 -1
View File
@@ -28,7 +28,8 @@ COMMON_SRCS = \
Locale.cs \
MonoTODOAttribute.cs \
basic-profile-check.cs \
SR.cs
SR.cs \
AssemblyRef.cs
DISTFILES = \
README.makefiles \
+8 -2
View File
@@ -15,8 +15,6 @@ build system needs to let us do, specifically:
** Makefile structure
A general makefile looks like this:
@@ -438,7 +436,15 @@ To give it flags, set $(LOCAL_CFLAGS). As with compiling C#, the
variable $(CFLAGS) will automatically be included on the command line.
* Compiling resources with resgen
If you have a resource that should be compiled with resgen and
included in your assembly, you can use the RESOURCES_DEFS variable.
This variable can contain lists of pairs that are separated by comma
to represent the resource ID as embedded in the assembly followed by
the file name, like this:
RESOURCE_DEFS = Messages,TextResources.resx Errors,ErrorList.txt
* Documentation-related needs? Use $(MDOC)
+25
View File
@@ -0,0 +1,25 @@
static class AssemblyRef
{
// FIXME
internal const string SystemConfiguration = "System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string System = "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
public const string EcmaPublicKey = "b77a5c561934e089";
#if NET_2_1
public const string FrameworkPublicKeyFull = "0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9";
public const string FrameworkPublicKeyFull2 = "00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB";
#else
public const string FrameworkPublicKeyFull = "00000000000000000400000000000000";
public const string FrameworkPublicKeyFull2 = "00000000000000000400000000000000";
#endif
public const string MicrosoftPublicKey = "b03f5f7f11d50a3a";
public const string MicrosoftJScript = Consts.AssemblyMicrosoft_JScript;
public const string MicrosoftVSDesigner = Consts.AssemblyMicrosoft_VSDesigner;
public const string SystemData = Consts.AssemblySystem_Data;
public const string SystemDesign = Consts.AssemblySystem_Design;
public const string SystemDrawing = Consts.AssemblySystem_Drawing;
public const string SystemWeb = Consts.AssemblySystem_Web;
public const string SystemWebExtensions = "System.Web.Extensions, Version=" + Consts.FxVersion + ", Culture=neutral, PublicKeyToken=31bf3856ad364e35";
public const string SystemWindowsForms = Consts.AssemblySystem_Windows_Forms;
}
-26
View File
@@ -1,31 +1,5 @@
using System.Globalization;
static class AssemblyRef
{
// FIXME
internal const string SystemConfiguration = "System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string System = "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
public const string EcmaPublicKey = "b77a5c561934e089";
#if NET_2_1
public const string FrameworkPublicKeyFull = "0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9";
public const string FrameworkPublicKeyFull2 = "00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB";
#else
public const string FrameworkPublicKeyFull = "00000000000000000400000000000000";
public const string FrameworkPublicKeyFull2 = "00000000000000000400000000000000";
#endif
public const string MicrosoftPublicKey = "b03f5f7f11d50a3a";
public const string MicrosoftJScript = Consts.AssemblyMicrosoft_JScript;
public const string MicrosoftVSDesigner = Consts.AssemblyMicrosoft_VSDesigner;
public const string SystemData = Consts.AssemblySystem_Data;
public const string SystemDesign = Consts.AssemblySystem_Design;
public const string SystemDrawing = Consts.AssemblySystem_Drawing;
public const string SystemWeb = Consts.AssemblySystem_Web;
public const string SystemWebExtensions = "System.Web.Extensions, Version=" + Consts.FxVersion + ", Culture=neutral, PublicKeyToken=31bf3856ad364e35";
public const string SystemWindowsForms = Consts.AssemblySystem_Windows_Forms;
}
static partial class SR
{
internal static string GetString(string name, params object[] args)
+1 -1
View File
@@ -10,7 +10,7 @@
CODEPAGE = 65001
RUNTIME_FLAGS =
TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/nunit-console.exe
TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-console.exe
MCS_FLAGS =
MBAS_FLAGS = $(PLATFORM_DEBUG_FLAGS)
LIBRARY_FLAGS = /noconfig
+20 -1
View File
@@ -31,6 +31,9 @@ ifdef base_prog_config
PROGRAM_config := $(build_libdir)$(PROGRAM).config
endif
sn = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/sn.exe
SN = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(sn) -q
the_lib = $(the_libdir)$(base_prog)
build_lib = $(build_libdir)$(base_prog)
@@ -110,7 +113,10 @@ endif
$(the_lib): $(the_libdir)/.stamp
$(build_lib): $(BUILT_SOURCES) $(EXTRA_SOURCES) $(response) $(build_libdir:=/.stamp)
$(PROGRAM_COMPILE) -target:exe -out:$@ $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
$(PROGRAM_COMPILE) $(MCS_REFERENCES) -target:exe -out:$@ $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
ifdef PROGRAM_SNK
$(Q) $(SN) -R $@ $(PROGRAM_SNK)
endif
ifdef PROGRAM_USE_INTERMEDIATE_FILE
$(the_lib): $(build_lib)
@@ -143,8 +149,20 @@ endif
-include $(makefrag)
MCS_REFERENCES = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(LIB_REFS))
MCS_REFERENCES += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.exe,$(EXE_REFS))
all-local: $(makefrag) $(extra_targets)
ifdef BUILT_SOURCES
library_CLEAN_FILES += $(BUILT_SOURCES)
ifeq (cat, $(PLATFORM_CHANGE_SEPARATOR_CMD))
BUILT_SOURCES_cmdline = $(BUILT_SOURCES)
else
BUILT_SOURCES_cmdline = `echo $(BUILT_SOURCES) | $(PLATFORM_CHANGE_SEPARATOR_CMD)`
endif
endif
csproj-local:
config_file=`basename $(PROGRAM) .exe`-$(PROFILE).input; \
echo $(thisdir):$$config_file >> $(topdir)/../msvc/scripts/order; \
@@ -155,6 +173,7 @@ csproj-local:
echo $(build_lib); \
echo $(FRAMEWORK_VERSION); \
echo $(PROFILE); \
echo $(RESOURCE_DEFS); \
echo $(response)) > $(topdir)/../msvc/scripts/inputs/$$config_file
+1 -1
View File
@@ -43,7 +43,7 @@ sort -u $outfile.inc > $outfile.inc_s
rm -f $outfile.inc
if test -n "$excfile"; then
if test -n "$excfile" -a -f "$excfile"; then
process_includes $excfile $outfile.exc
fi
+44 -22
View File
@@ -18,7 +18,13 @@
# Have to rename to handle differences between assembly/directory names
DEP_LIBS=$(patsubst System.Xml,System.XML,$(LIB_REFS))
LIB_MCS_FLAGS += $(patsubst %,-r:%,$(LIB_REFS))
_FILTER_OUT = $(foreach x,$(2),$(if $(findstring $(1),$(x)),,$(x)))
LIB_REFS_FULL = $(call _FILTER_OUT,=, $(LIB_REFS))
LIB_REFS_ALIAS = $(filter-out $(LIB_REFS_FULL),$(LIB_REFS))
LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(LIB_REFS_FULL))
LIB_MCS_FLAGS += $(patsubst %,-r:%.dll, $(subst =,=$(topdir)/class/lib/$(PROFILE)/,$(LIB_REFS_ALIAS)))
sourcefile = $(LIBRARY).sources
@@ -29,24 +35,11 @@ PROFILE_excludes = $(wildcard $(PROFILE)_$(LIBRARY).exclude.sources)
sourcefile = $(depsdir)/$(PROFILE)_$(LIBRARY).sources
library_CLEAN_FILES += $(sourcefile)
ifdef EXTENSION_MODULE
EXTENSION_include = $(wildcard $(topdir)/../../mono-extensions/mcs/$(thisdir)/$(PROFILE)_$(LIBRARY).sources)
else
EXTENSION_include = $(wildcard $(PROFILE)_opt_$(LIBRARY).sources)
endif
ifdef EXTENSION_MODULE
EXTENSION_exclude = $(wildcard $(topdir)/../../mono-extensions/mcs/$(thisdir)/$(PROFILE)_$(LIBRARY).exclude.sources)
else
EXTENSION_exclude = $(wildcard $(PROFILE)_opt_$(LIBRARY).exclude.sources)
endif
# Note, gensources.sh can create a $(sourcefile).makefrag if it sees any '#include's
# We don't include it in the dependencies since it isn't always created
$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(topdir)/build/gensources.sh $(EXTENSION_include)
$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(topdir)/build/gensources.sh
@echo Creating the per profile list $@ ...
$(SHELL) $(topdir)/build/gensources.sh $@ '$(PROFILE_sources)' '$(PROFILE_excludes)' '$(EXTENSION_include)' '$(EXTENSION_exclude)'
$(SHELL) $(topdir)/build/gensources.sh $@ '$(PROFILE_sources)' '$(PROFILE_excludes)'
endif
PLATFORM_excludes := $(wildcard $(LIBRARY).$(PLATFORM)-excludes)
@@ -80,7 +73,9 @@ endif
ifdef RESOURCE_STRINGS
ifdef BOOTSTRAP_PROFILE
MCS_FLAGS_RESOURCE_STRINGS += $(RESOURCE_STRINGS:%=--getresourcestrings:%)
ifneq (basic, $(BUILD_TOOLS_PROFILE))
RESOURCE_STRINGS_FILES += $(RESOURCE_STRINGS:%=--resourcestrings:%)
endif
endif
endif
@@ -139,9 +134,9 @@ endif
csproj-local: csproj-library csproj-test
intermediate_clean=$(subst /,-,$(intermediate))
csproj-library:
csproj-library:
config_file=`basename $(LIBRARY) .dll`-$(intermediate_clean)$(PROFILE).input; \
[[ $(thisdir) == *"Facades"* ]] && config_file=Facades_$$config_file; \
case "$(thisdir)" in *"Facades"*) config_file=Facades_$$config_file;; esac; \
echo $(thisdir):$$config_file >> $(topdir)/../msvc/scripts/order; \
(echo $(is_boot); \
echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS); \
@@ -150,6 +145,7 @@ csproj-library:
echo $(build_lib); \
echo $(FRAMEWORK_VERSION); \
echo $(PROFILE); \
echo $(RESOURCE_DEFS); \
echo $(response)) > $(topdir)/../msvc/scripts/inputs/$$config_file
csproj-test:
@@ -221,7 +217,28 @@ clean-local:
test-local run-test-local run-test-ondotnet-local:
@:
DISTFILES = $(wildcard *$(LIBRARY)*.sources) $(EXTRA_DISTFILES)
#
# RESOURCES_DEFS is a list of ID,FILE pairs separated by spaces
# for each of those, generate a rule that produces ID.resource from
# FILE using the resgen tool, adds the generated file to CLENA_FILES and
# passes the resource to the compiler
#
ccomma = ,
define RESOURCE_template
$(1).resources: $(2)
$(RESGEN) "$$<" "$$@"
GEN_RESOURCE_DEPS += $(1).resources
GEN_RESOURCE_FLAGS += -resource:$(1).resources
CLEAN_FILES += $(1).resources
DIST_LISTED_RESOURCES += $(2)
endef
ifdef RESOURCE_DEFS
$(foreach pair,$(RESOURCE_DEFS), $(eval $(call RESOURCE_template,$(word 1, $(subst $(ccomma), ,$(pair))), $(word 2, $(subst $(ccomma), ,$(pair))))))
endif
DISTFILES = $(wildcard *$(LIBRARY)*.sources) $(EXTRA_DISTFILES) $(DIST_LISTED_RESOURCES)
ASSEMBLY = $(LIBRARY)
ASSEMBLY_EXT = .dll
@@ -241,6 +258,7 @@ csproj-test:
echo $(test_lib); \
echo $(FRAMEWORK_VERSION); \
echo $(PROFILE); \
echo ""; \
echo $(test_response)) > $(topdir)/../msvc/scripts/inputs/$$config_file
endif
@@ -251,6 +269,7 @@ dist-local: dist-default
for f in `$(topdir)/tools/removecomments.sh $(wildcard *$(LIBRARY).sources)` $(TEST_FILES) ; do \
case $$f in \
../*) : ;; \
*.g.cs) : ;; \
*) dest=`dirname "$$f"` ; \
case $$subs in *" $$dest "*) : ;; *) subs=" $$dest$$subs" ; $(MKINSTALLDIRS) $(distdir)/$$dest ;; esac ; \
cp -p "$$f" $(distdir)/$$dest || exit 1 ;; \
@@ -279,8 +298,11 @@ endif
$(the_lib): $(the_libdir)/.stamp
$(build_lib): $(response) $(sn) $(BUILT_SOURCES) $(build_libdir:=/.stamp)
$(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) $(MCS_FLAGS_RESOURCE_STRINGS) -target:library -out:$@ $(BUILT_SOURCES_cmdline) @$(response)
$(build_lib): $(response) $(sn) $(BUILT_SOURCES) $(build_libdir:=/.stamp) $(GEN_RESOURCE_DEPS)
$(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) $(GEN_RESOURCE_FLAGS) -target:library -out:$@ $(BUILT_SOURCES_cmdline) @$(response)
ifdef RESOURCE_STRINGS_FILES
$(Q) $(STRING_REPLACER) $(RESOURCE_STRINGS_FILES) $@
endif
$(Q) $(SN) -R $@ $(LIBRARY_SNK)
ifdef LIBRARY_USE_INTERMEDIATE_FILE
-2
View File
@@ -23,8 +23,6 @@ PLATFORM_PATH_SEPARATOR = :
# This is for changing / to \ on windows
PLATFORM_CHANGE_SEPARATOR_CMD = cat
PLATFORM_AOT_SUFFIX = .dylib
hidden_prefix = .
hidden_suffix =
Loaded 100 of 15729 files, more files were not shown because too many files have changed in this diff. Show more