Ankit Jain [Thu, 29 Jun 2017 12:41:29 +0000 (08:41 -0400)]
[packaging/msbuild] Bump to get new changes on xplat-master (#5145)
Alexander Köplinger [Thu, 29 Jun 2017 11:21:49 +0000 (13:21 +0200)]
[bcl] Drop a bunch of unused _2_1.cs files (#5112)
* [bcl] Drop a bunch of unused _2_1.cs files
They weren't used anywhere, not even mobile, so we can remove them.
Zoltan Varga [Thu, 29 Jun 2017 06:20:50 +0000 (02:20 -0400)]
Revert "[runtime] Use pthread_cond_timedwait_relative_np () function on osx if available. (#5143)"
This reverts commit
616ea50718aba3af237637f77d9c58acdca9a61f.
Revert this as it fails to build on wrench.
Zoltan Varga [Thu, 29 Jun 2017 05:02:53 +0000 (01:02 -0400)]
[runtime] Use pthread_cond_timedwait_relative_np () function on osx if available. (#5143)
Ludovic Henry [Wed, 28 Jun 2017 22:42:35 +0000 (18:42 -0400)]
[w32handle] Replace mono_w32handle_{ref,unref} by mono_w32handle_{duplicate, close} (#5106)
* [w32handle] Fix handle dumped ref
* [w32handle] Replace exposing mono_w32handle_{ref,unref} by mono_w32handle_{duplicate,close}, it is closer to what the win32 API exposes.
* [w32handle] Remove unrefing of handles on shutdown
If one of the handle is a file handle for example, then w32file has already be cleaned up, so we cannot guarantee that the handle we are going to close is not going to call into w32file code.
Jonathan Chambers [Tue, 27 Jun 2017 04:45:26 +0000 (00:45 -0400)]
Implement GC roots ourselves in Boehm rather than relying on their concept of roots which is mainly for static data segments in binaries and not implemented on all platforms (cannot remove roots on Windows) (#564)
Alexander Köplinger [Wed, 28 Jun 2017 17:42:46 +0000 (19:42 +0200)]
[packaging] Remove git_branch from msbuild and mono-extensions (#5141)
We're checking out a specific commit for both now so the git branch
is no longer required.
Also fixes warnings that a 2017-06 branch doesn't exist in mono-extensions.
Jo Shields [Wed, 28 Jun 2017 17:41:25 +0000 (18:41 +0100)]
Manually invoke Xvfb, don't depend on the xvfb plugin (#5132)
Marek Safar [Tue, 27 Jun 2017 18:47:19 +0000 (20:47 +0200)]
[build] Add a new profile
Aleksey Kliger [Tue, 27 Jun 2017 14:33:23 +0000 (10:33 -0400)]
[nullgc] When building nullgc, don't try to link Boehm libs
Previous nullgc commit (
52d9a55a861527ed4027f8e10a97e3cc880baf4a) didn't actually work in a clean tree.
Zoltan Varga [Tue, 27 Jun 2017 23:44:58 +0000 (19:44 -0400)]
[w32handle] Add some debugging code to help track down handle wait problems. (#5136)
Zoltan Varga [Tue, 27 Jun 2017 22:05:34 +0000 (18:05 -0400)]
[w32handle] Zero out the handle specific data in the handle dtor to help debugging. (#5135)
monojenkins [Tue, 27 Jun 2017 16:32:41 +0000 (18:32 +0200)]
[msvc] Update csproj files (#5131)
Alexander Köplinger [Tue, 27 Jun 2017 14:58:46 +0000 (16:58 +0200)]
[man] Fix AOT temp path option description
It's `temp-path` in the code, not `temp_path`
Aleksey Kliger (λgeek) [Tue, 27 Jun 2017 14:44:30 +0000 (10:44 -0400)]
Merge pull request #5120 from lambdageek/bug-57744
[reflection] Convert correct MonoError to an exn in Assembly.GetTypes ()
cherusker [Tue, 27 Jun 2017 14:21:34 +0000 (16:21 +0200)]
Fix various compiler warnings (#5064)
* Fix compiler warnings (w32)
- add explicit (long long (unsigned)) type casts
- change %ld to %lld once, to match the general style of these logging messages
* Fix compiler warnings (threadpool)
- add explicit (void *) type casts
* Fix compiler warnings (boehm)
- add an explicit (long) type cast; the values are defined as gint64, an upgrade to at least "%ld" seems like a good idea
- about dropping const: const does not seem to be necessary as g_getenv() returns pointers to freshly allocated buffers whenever called. const might have been used to protect the return value of g_getenv() on unix systems with earlier versions of Mono (as a comment in gmisc-unix.c suggests). keeping const here causes a compiler warning, as the const qualifier gets dropped when *env is being used with g_free(). that led to the decision to drop the qualifier altogether.
* Fix compiler warnings (sgen)
- specify the arguments (void) to avoid -Wstrict-prototypes warnings
* Fix compiler warnings (misc - metadata)
- specify the arguments (void) to avoid -Wstrict-prototypes warnings
* Fix compiler warnings (misc)
- specify the arguments (void) to avoid -Wstrict-prototypes warnings
- add an explicit (void *) type cast; changing the return type to char* might be more usable and could be discussed
- ret is not being used and can be removed; fixes a -Wunused-but-set-variable warning
* Fix compiler warnings (mini)
- specify the arguments (void) to avoid -Wstrict-prototypes warnings
* [fixup!] Correct indentation
* [fixup!] Correct (void *)
- use GUINT_TO_POINTER and MONO_NATIVE_THREAD_ID_TO_UINT instead of (void *) to cast mono_native_thread_id_get () to %p
* [fixup!] Correct indentation of boehm-gc.c and add FIXME
* include <inttypes.h> and test the G_GINT64_FORMAT macro
* [fixup!] Use G_G*_FORMAT and PRIx32 macros instead of type casts wherever possible
Ankit Jain [Tue, 27 Jun 2017 04:57:07 +0000 (00:57 -0400)]
[packaging/msbuild] Bump to get new changes on xplat-master (#5127)
Zoltan Varga [Tue, 27 Jun 2017 03:19:07 +0000 (23:19 -0400)]
[jit] Avoid emitting op_load_got_addr opcodes on x86 when using llvmonly, its not needed. (#5125)
Aleksey Kliger [Mon, 26 Jun 2017 19:52:08 +0000 (15:52 -0400)]
[reflection] Convert correct MonoError to an exn in Assembly.GetTypes () (Fixes #57744)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=57744
Aleksey Kliger [Mon, 26 Jun 2017 19:58:12 +0000 (15:58 -0400)]
[bcl] Delete our ReflectionTypeLoadException
We use the referencesource version
Alexander Köplinger [Mon, 26 Jun 2017 17:16:47 +0000 (19:16 +0200)]
[cil-strip] Move comment out of .sources file
I forgot that we only run gensources.sh on libraries but not
tools so the comments don't get stripped out...
Zoltan Varga [Mon, 26 Jun 2017 17:04:36 +0000 (13:04 -0400)]
[runtime] Add more logging in case mono_os_cond_timedwait () fails.
Alexander Köplinger [Mon, 26 Jun 2017 15:13:11 +0000 (17:13 +0200)]
Bump API snapshot
Marius Ungureanu [Sat, 24 Jun 2017 18:48:17 +0000 (21:48 +0300)]
[System.Core] Implement MemoryMappedFile.OpenExisting
Reuse the existing icall infrastructure to give the same handle back.
This PR implements all OpenExisting methods (with the access rights parameter discarded) and the SafeHandle property.
In the runtime, we don't check the capacity parameter if we try to open a mmap file, and we fallthrough the handle refcount case.
Alexander Köplinger [Mon, 26 Jun 2017 10:32:33 +0000 (12:32 +0200)]
Revert "[cil-strip] Remove old private copy of Mono.Cecil"
(reverted from commit
4ea31227587b9df3a244d9c32a5a87a7afa70436)
Alexander Köplinger [Mon, 26 Jun 2017 10:32:22 +0000 (12:32 +0200)]
Revert "[cil-strip] Upgrade to latest Mono.Cecil API"
(reverted from commit
0c9eb70a4646364f4b425f69b366be766043bef9)
Using newer Cecil means metadata tokens will be different which
breaks AOT compilation: https://github.com/mono/mono/pull/5102#issuecomment-
310801767
monojenkins [Sun, 25 Jun 2017 16:20:22 +0000 (16:20 +0000)]
[msvc] Update csproj files
Zoltan Varga [Sat, 24 Jun 2017 19:12:38 +0000 (15:12 -0400)]
[llvm] Align aot variables to 8 bytes, parts of the aot code depend on it.
Aleksey Kliger [Fri, 23 Jun 2017 21:43:02 +0000 (17:43 -0400)]
[null_gc] Get null GC building again.
- Had to borrow a gchandles implementation from mono/metadata/boehm-gc.c
- Added coop handles support for NULL GC
- Fixed typos in configure.ac
- To use: `./configure --with-libgc=none --without-sgen --enable-boehm`
You get a mono-boehm which actually is not collecting anything.
Ankit Jain [Sat, 24 Jun 2017 03:35:53 +0000 (23:35 -0400)]
[packaging/msbuild] Bump to get new changes on xplat-master (#5113) (#5114)
Ludovic Henry [Fri, 23 Jun 2017 23:32:35 +0000 (19:32 -0400)]
[System] Fix compilation on watchos (#5108)
Alexander Köplinger [Fri, 23 Jun 2017 14:05:11 +0000 (16:05 +0200)]
[cil-strip] Remove old private copy of Mono.Cecil
No longer needed now that we're using the new Cecil.
Alexander Köplinger [Fri, 23 Jun 2017 14:03:36 +0000 (16:03 +0200)]
[cil-strip] Upgrade to latest Mono.Cecil API
This greatly simplifies the code and as a bonus also shaves off
about 300ms when stripping mscorlib.dll.
Rodrigo Kumpera [Fri, 23 Jun 2017 22:30:14 +0000 (15:30 -0700)]
Merge pull request #5103 from alexrp/profiler-signal-ack-fix
[profiler] Do the signal ack after checking that the thread is detached.
Zoltan Varga [Fri, 23 Jun 2017 20:16:41 +0000 (16:16 -0400)]
[aot] Fix aot image loading messages in static mode.
Vlad Brezae [Fri, 23 Jun 2017 18:10:18 +0000 (21:10 +0300)]
Merge pull request #5084 from BrzVlad/feature-worker-context
[sgen] Implement sgen worker context
Vlad Brezae [Wed, 21 Jun 2017 10:43:39 +0000 (13:43 +0300)]
[sgen] Use concurrent mark concurrently with parallel minors
Vlad Brezae [Thu, 15 Jun 2017 22:15:51 +0000 (01:15 +0300)]
[sgen] Implement work context for thread pool threads
We need to run jobs on the thread pool threads for parallel minor, parallel major, concurrent mark and concurrent sweep, some of which can run simultaneously. Instead of making separate threads reserved for each type of work, we create a work context abstraction (this contains a set of pending jobs to run and the sgen-worker callbacks). When a thread pool thread looks for work, it searches for work (jobs and idle work) through all contexts and finishes work from each one of them, from the highest to the lowest priority.
This is implemented by having different thread pool contexts (which contain the job list, work callbacks that indicate whether it should work and its ineherent priority), overall unrelated to the GC. The sgen worker infrastructure also creates separate worker contexts (which contain the object ops to be used and information about each worker, like the state and the private gray queue). We use at most two worker contexts (for minor and for major) and each worker context makes use of a sgen thread pool context.
Vlad Brezae [Wed, 21 Jun 2017 11:09:12 +0000 (14:09 +0300)]
[sgen] Remove redundant code
We always init worker distribute gray queue when initialising worker infrastructure.
Vlad Brezae [Wed, 21 Jun 2017 10:55:57 +0000 (13:55 +0300)]
[sgen] Include split count in the parallel job
We were getting the split_count at job run time which makes little sense. Include it in the job, alongside the job index.
Vlad Brezae [Tue, 20 Jun 2017 12:22:39 +0000 (15:22 +0300)]
[sgen] Run the scan pinned object job concurrently with minors
Concurrent mark doesn't normally scan objects in the nursery since they can be moved. At the end of the concurrent mark, we were locking over the entire gc pause in order to make sure that the we can scan the latest pinned object list (aka none of those objects can be moved). Lock only over the pinning phase of the collection, since it is enough.
Vlad Brezae [Fri, 23 Jun 2017 17:06:51 +0000 (20:06 +0300)]
Merge pull request #5098 from BrzVlad/fix-sgen-pagesize
[sgen] Fix sgen pagesize
Marius Ungureanu [Fri, 23 Jun 2017 16:08:23 +0000 (19:08 +0300)]
Merge pull request #5104 from mono/bump-bockbuild
Bump bockbuild
Marius Ungureanu [Fri, 23 Jun 2017 16:05:48 +0000 (19:05 +0300)]
Bump bockbuild
Alex Rønne Petersen [Fri, 23 Jun 2017 14:52:24 +0000 (16:52 +0200)]
[profiler] Do the signal ack after checking that the thread is detached.
Otherwise we could crash in mono_thread_info_current ().
Chris Lapa [Fri, 23 Jun 2017 13:30:23 +0000 (23:30 +1000)]
[aot] fixes temp-path argument only working when using LLVM compiler. (#5099)
Signed-off-by: Chris Lapa <chris@lapa.com.au>
Ankit Jain [Fri, 23 Jun 2017 06:16:31 +0000 (02:16 -0400)]
[packaging/msbuild] Bump to get new changes on xplat-master
Ankit Jain [Fri, 23 Jun 2017 01:35:09 +0000 (21:35 -0400)]
[packaging/msbuild] Update commit hash to point to xplat-master HEAD (#5100)
Vlad Brezae [Thu, 22 Jun 2017 20:15:53 +0000 (23:15 +0300)]
[sgen] Performance improvement for ms_block_size computations
This reduces regressions for switching from MS_BLOCK_SIZE compile time constant
to ms_block_size variable by 85% on the tests where this was showing up. In the
future we should implement a block allocator, which would, amongst other benefits,
enable us to remove the block-size/page-size dependency.
Vlad Brezae [Wed, 21 Jun 2017 20:08:07 +0000 (23:08 +0300)]
[sgen] Fix MS block size calculation.
The block size must be a multiple of the system page size. Page size simply
cannot be determined reliably at compile time, so we must obtain the page size
through a system call on startup and use it as the block size. We still enforce
a minimum block size of 16kb on systems where the page size is smaller than
that.
The old code hardcoded page sizes for certain architectures with large pages.
THe problem is that those architectures don't necessarily have to have large
pages and on systems where this wasn't the case, we'd end up with a block size
much larger than needed.
Rebase of @alexrp's work.
Rodrigo Kumpera [Thu, 22 Jun 2017 21:55:52 +0000 (14:55 -0700)]
Merge pull request #5095 from kumpera/fix_fullaot
[aot] Fix the name of the mono_gc_wbarrier_range_copy icall. FullAOT with direct calls requires it.
Zoltan Varga [Thu, 22 Jun 2017 21:15:27 +0000 (17:15 -0400)]
[arm] Handle large offsets in OP_SEQ_POINT. Fixes #57476. (#5094)
Alex Rønne Petersen [Thu, 22 Jun 2017 19:03:01 +0000 (21:03 +0200)]
Merge pull request #5090 from alexrp/profiler-class-unload-removal
[profiler] Remove class unload events.
Alex Rønne Petersen [Thu, 22 Jun 2017 08:40:58 +0000 (10:40 +0200)]
[profiler] Remove class unload events.
These are never actually emitted by the profiler API because they make no sense
in the context of Mono's metadata layer.
Alex Rønne Petersen [Thu, 22 Jun 2017 18:56:48 +0000 (20:56 +0200)]
Merge pull request #5089 from alexrp/profiler-deadlock-fix
[profiler] Fix a deadlock due to recursive use of the buffer lock.
Rodrigo Kumpera [Thu, 22 Jun 2017 18:48:13 +0000 (11:48 -0700)]
[aot] Fix the name of the mono_gc_wbarrier_range_copy icall. FullAOT with direct calls requires it.
Alex Rønne Petersen [Thu, 22 Jun 2017 18:39:37 +0000 (20:39 +0200)]
Merge pull request #5092 from alexrp/mini-coverage-increment
[mini] Use an atomic add for the code coverage counter when possible.
Eddie Hedges [Thu, 22 Jun 2017 16:48:40 +0000 (11:48 -0500)]
Docs: added missing ) to RelaxngPattern snippet (#5093)
Alex Rønne Petersen [Thu, 22 Jun 2017 15:32:10 +0000 (17:32 +0200)]
[mini] Use an atomic add for the code coverage counter when possible.
Zoltan Varga [Thu, 22 Jun 2017 14:27:07 +0000 (10:27 -0400)]
[runtime] Add a few missing error_init () calls to the mono_custom_attrs_from_... functions. Fixes #57488. (#5076)
Zoltan Varga [Thu, 22 Jun 2017 14:26:46 +0000 (10:26 -0400)]
[sre] Fix the signature of the create_dynamic_method () icall, make it static since the C implementation only takes two parameters, this only caused problems if the icall set the error, since it overwrite the DynamicMethod object instead. Fixes #57301. (#5081)
Alex Rønne Petersen [Thu, 22 Jun 2017 13:55:26 +0000 (15:55 +0200)]
Merge pull request #5091 from alexrp/mini-enter-leave-cleanup
[mini] Remove codegen special cases around MONO_PROFILE_ENTER_LEAVE.
Alex Rønne Petersen [Thu, 22 Jun 2017 10:01:31 +0000 (12:01 +0200)]
[mini] Remove codegen special cases around MONO_PROFILE_ENTER_LEAVE.
Enter/leave instrumentation is now done with icalls at the IR level, so these
special cases are no longer needed.
Alex Rønne Petersen [Thu, 22 Jun 2017 08:30:29 +0000 (10:30 +0200)]
[profiler] Fix a deadlock due to recursive use of the buffer lock.
The lock no longer supports recursion as of
10ba222234b0ff23bfbe29c6f2dfd7673ec2ca7f.
Not that it ever really did, since the old implementation was buggy.
Ludovic Henry [Thu, 22 Jun 2017 00:46:18 +0000 (20:46 -0400)]
[threads] Enable blocking transition with MONO_ENABLE_BLOCKING_TRANSITION env variable (#5087)
Alex Rønne Petersen [Tue, 11 Oct 2016 09:29:39 +0000 (11:29 +0200)]
[utils/mmap] Prefer sysconf () over getpagesize () in mono_pagesize ().
The former is async-signal-safe, while the latter makes no guarantees and also
isn't actually portable.
Aleksey Kliger (λgeek) [Wed, 21 Jun 2017 19:32:29 +0000 (15:32 -0400)]
Merge pull request #5079 from lambdageek/dev-setvalue
[coop handles] Implement various SetValue methods
Rodrigo Kumpera [Wed, 21 Jun 2017 17:34:01 +0000 (10:34 -0700)]
Merge pull request #5082 from kumpera/fix-ro-fs-file-delete
[io-layer] When deleting a file, check for EROFS and verify if the file exists. Fixes #57629.
Rodrigo Kumpera [Wed, 21 Jun 2017 16:56:58 +0000 (09:56 -0700)]
[runtime] Update comment with link to Linux Kernel fix.
Bernhard Urban [Wed, 21 Jun 2017 09:14:15 +0000 (11:14 +0200)]
[interp] disable context-static.exe on CI as it suffers from stack usage issue
Bernhard Urban [Wed, 21 Jun 2017 09:12:58 +0000 (11:12 +0200)]
[interp] fix BARRIER_IF_VOLATILE usage
Alex Rønne Petersen [Tue, 20 Jun 2017 22:43:26 +0000 (00:43 +0200)]
[interp] Handle the `no.` prefix instruction as a no-op.
Alex Rønne Petersen [Tue, 20 Jun 2017 22:33:54 +0000 (00:33 +0200)]
[interp] Add support for the `volatile.` prefix instruction.
Alex Rønne Petersen [Tue, 20 Jun 2017 22:09:41 +0000 (00:09 +0200)]
[interp] Add MINT_MONO_MEMORY_BARRIER.
Alex Rønne Petersen [Tue, 20 Jun 2017 22:06:39 +0000 (00:06 +0200)]
[interp] Fix oplength of MINT_MONO_TLS.
Alex Rønne Petersen [Tue, 20 Jun 2017 22:05:26 +0000 (00:05 +0200)]
[interp] Update comment to clarify meaning of oplength.
Marek Safar [Wed, 21 Jun 2017 10:52:20 +0000 (12:52 +0200)]
[mcs] Add missing vector cloning of definite assignment on-true. Fixes #57505
Alex Rønne Petersen [Wed, 21 Jun 2017 00:06:28 +0000 (02:06 +0200)]
Merge pull request #5072 from alexrp/profiler-stability
[profiler] A bunch of profiler bug/stability fixes.
Marek Safar [Tue, 20 Jun 2017 22:14:05 +0000 (00:14 +0200)]
[mcs] Fixes regression introduced by
a0fc3f4dcf571edc997f53066c09671650e96670 to consider user set values. Fixes #57242
Rodrigo Kumpera [Tue, 20 Jun 2017 20:39:48 +0000 (13:39 -0700)]
[io-layer] When deleting a file, check for EROFS and verify if the file exists. Fixes #57629.
Linux has this particular behavior of returning ENOFS when unlinking from an read only FS.
Even if the file doesn't exists! Darwin does the sane thing and return ENOENT in this case.
To workaround this, if unlink returns EROFS, we stat the file and deal with that.
Marek Safar [Tue, 20 Jun 2017 18:00:27 +0000 (20:00 +0200)]
Bump roslyn to 2.3 beta 2
Aleksey Kliger [Tue, 20 Jun 2017 00:11:15 +0000 (20:11 -0400)]
[runtime] Use coop handles for System.Array.SetValue
Aleksey Kliger [Mon, 19 Jun 2017 22:13:51 +0000 (18:13 -0400)]
[runtime] Use coop handles for System.Array.SetValueImpl
Aleksey Kliger [Mon, 19 Jun 2017 20:14:21 +0000 (16:14 -0400)]
[runtime] Make array_set_value_impl single-exit
Aleksey Kliger [Mon, 19 Jun 2017 19:39:47 +0000 (15:39 -0400)]
[runtime] Don't call icall ves_icall_System_Array_SetValueImpl directly
add a helper function array_set_value_impl and call that from elsewhere in
native code.
Aleksey Kliger [Mon, 19 Jun 2017 19:20:01 +0000 (15:20 -0400)]
[runtime] Add mono_error_set_invalid_cast ()
Aleksey Kliger [Wed, 7 Jun 2017 16:11:32 +0000 (12:11 -0400)]
[runtime] Use coop handles for System.Reflection.MonoField.SetValueInternal
Marek Safar [Tue, 20 Jun 2017 11:48:05 +0000 (13:48 +0200)]
Bump corefx
Aleksey Kliger [Tue, 20 Jun 2017 17:36:21 +0000 (13:36 -0400)]
[runtime] Add mono_nullable_init_from_handle
monojenkins [Tue, 20 Jun 2017 16:30:37 +0000 (17:30 +0100)]
[msvc] Update csproj files (#5075)
Aleksey Kliger [Wed, 14 Jun 2017 21:14:29 +0000 (17:14 -0400)]
[coop handles] Add MONO_HANDLE_SET_FIELD_REF macro
Set a field in an object when you have a MonoClassField*
Aleksey Kliger [Tue, 6 Jun 2017 22:03:30 +0000 (18:03 -0400)]
[coop handles] Add mono_object_handle_pin_unbox
Bernhard Urban [Mon, 19 Jun 2017 14:04:09 +0000 (16:04 +0200)]
[bcl tests] do not attempt to delete non-existing files
This fixes an issue we see on the BCL test suite when run in the context
of Xamarin Android:
```
I/mono-stdout( 2534): Certificate1 [FAIL] : TearDown : System.UnauthorizedAccessException : Access to the path "temp.b64" is denied.
```
It seems like those files aren't generated anymore. Not sure why this
starts to be a problem now.
Alex Rønne Petersen [Tue, 20 Jun 2017 04:38:21 +0000 (06:38 +0200)]
[profiler] Remove an unnecessary check that could hide potential bugs.
Alex Rønne Petersen [Tue, 20 Jun 2017 04:22:28 +0000 (06:22 +0200)]
[acceptance-tests] Update the profiler-stress test runner for the profiler's new argument style.
This allows us to test a lot more combinations than previously.
Alex Rønne Petersen [Tue, 20 Jun 2017 03:45:41 +0000 (05:45 +0200)]
[profiler] Fix 'no' argument parsing.
Alex Rønne Petersen [Tue, 20 Jun 2017 03:02:59 +0000 (05:02 +0200)]
[profiler] Implement a new buffer reader/writer lock algorithm.
See the comment + assertions to get an idea of how it works.
Alex Rønne Petersen [Tue, 20 Jun 2017 01:13:20 +0000 (03:13 +0200)]
[profiler] Require an ack of the previous sampling signal before sending another.
This avoids situations where we could end up filling the signal queue
completely, leading to the undocumented EAGAIN return value from pthread_kill,
which breaks ~everything in the STW/GC code because it thinks an error return
value from pthread_kill means the thread has exited.
The actual reason why this happened is that when a thread is suspended, we mask
all signals except the restart signal for that thread. This means that a
program with a large number of threads or where GC collections could take
longer than usual would end up with tens of thousands of sampling signals
queued up, eventually reaching the limit of the user-level signal queue (see
`ulimit -i` and `RLIMIT_SIGPENDING`).
We only do this on systems where we use real time signals. Non-RT signals do
not have this problem as the kernel will throttle them.
Alex Rønne Petersen [Tue, 20 Jun 2017 00:49:26 +0000 (02:49 +0200)]
[utils/threads] Export small ID functions as part of the API.
These will be used in the log profiler.
Also, make mono_thread_info_register_small_id () only allocate a new small ID
if one isn't already allocated for the current thread. This is necessary so
that we can allocate a small ID for a thread and not have it be overwritten
if/when that thread is later attached probably (which also results in this
function being called).
Alex Rønne Petersen [Tue, 20 Jun 2017 00:34:17 +0000 (02:34 +0200)]
[utils/threads] Print an error and abort if pthread_kill returns an error that isn't ESRCH.