Age | Commit message (Collapse) | Author |
|
* [mono] Fix unused variable warning in mono_config_parse().
* [ligc] Fix strict prototype warning for Win32 build.
* Add some casts.
|
|
i.e. C++ helpers for Boehm GC.
|
|
This isn't correct for Win64 but that should be ok.
It is correct for all other platforms.
/s/mono/mono/sgen/sgen-memory-governor.c:309:5: warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'unsigned int' [-Wformat]
entry->promoted_size / 1024,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/s/mono/mono/sgen/sgen-memory-governor.c:310:5: warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'unsigned int' [-Wformat]
entry->major_size / 1024,
^~~~~~~~~~~~~~~~~~~~~~~~
/s/mono/mono/sgen/sgen-memory-governor.c:311:5: warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'unsigned int' [-Wformat]
entry->major_size_in_use / 1024,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/s/mono/mono/sgen/sgen-memory-governor.c:312:5: warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'unsigned int' [-Wformat]
entry->los_size / 1024,
^~~~~~~~~~~~~~~~~~~~~~
/s/mono/mono/sgen/sgen-memory-governor.c:313:5: warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'unsigned int' [-Wformat]
entry->los_size_in_use / 1024);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/s/mono/mono/sgen/sgen-memory-governor.c:321:5: warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'unsigned int' [-Wformat]
entry->los_size / 1024,
^~~~~~~~~~~~~~~~~~~~~~
/s/mono/mono/sgen/sgen-memory-governor.c:322:5: warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'unsigned int' [-Wformat]
entry->los_size_in_use / 1024);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/s/mono/mono/sgen/sgen-memory-governor.c:332:5: warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'unsigned int' [-Wformat]
entry->los_size / 1024,
^~~~~~~~~~~~~~~~~~~~~~
/s/mono/mono/sgen/sgen-memory-governor.c:333:5: warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'unsigned int' [-Wformat]
entry->los_size_in_use / 1024);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/s/mono/mono/sgen/sgen-memory-governor.c:337:5: warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'unsigned int' [-Wformat]
entry->major_size / 1024,
^~~~~~~~~~~~~~~~~~~~~~~~
/s/mono/mono/sgen/sgen-memory-governor.c:338:5: warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'unsigned int' [-Wformat]
entry->major_size_in_use / 1024);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/s/mono/mono/metadata/w32file-unix.c:4688:1: warning: no previous prototype for function 'ves_icall_System_IO_DriveInfo_GetDriveType' [-Wmissing-prototypes]
ves_icall_System_IO_DriveInfo_GetDriveType (const gunichar2 *root_path_name, gint32 root_path_name_length, MonoError *error)
^
/s/mono/mono/metadata/remoting.c:2143:1: warning: no previous prototype for function 'mono_context_set_icall' [-Wmissing-prototypes]
mono_context_set_icall (MonoAppContext *new_context_raw)
^
/s/mono/mono/mini/mini-posix.c:229:2: warning: unused variable 'ctx' [-Wunused-variable]
MONO_SIG_HANDLER_GET_CONTEXT;
And beware icall-decl.h + Boehm producing:
w32file-unix.c:4905:16: error: implicit declaration of function 'GC_dlopen' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
libc_handle = dlopen ("/usr/lib/libc.dylib", 0);
^
or, if you fix that, unreferenced symbol _GC_dlopen.
|
|
The test-bundle target copies all assets needed for test execution
to a specified directory. We upload this directory to Helix and use it
to run our mainline tests.
|
|
So we can precompile all tests across the repo using a simple "make test" in the root.
|
|
C++ (#9953)
* [cxx] Add extern "C" to libgc so that it can be C, and used from C++.
This tracks mainline https://github.com/ivmai/bdwgc, barely.
See https://github.com/ivmai/bdwgc/commit/f4fbef0f7f0e3446856d2177535080158e16e403#diff-74e77959a62b8a560274f69789f50a94
* [cxx] [boehm] favor void* over char* interface for easier use from C++.
This tracks, barely.
See https://github.com/ivmai/bdwgc/blob/ae3d724f3645af119e1b2c2cefbb71c97d467546/mark.c#L1337
Mainline and Unity Boehm are valid C++, which is not the case here.
|
|
(#8534)
* Make autogen.sh output accurate -- print actual commands run.
* Have automake copy instead of symlink.
- This sounds analogous to libtool --copy that we do.
- It enables sharing a source tree more broadly.
For real example, Cygwin symlinks are not portable to Windows Subsystem For Linux, and probably vice versa.
For real example, Homebrew symlinks are not portable to Linux in Docker.
Downside I notice is that ls -l is less informative as to what is from git vs. a symlink to outside.
git clean -xxddff works just as well either way.
Hypothetical downside is that updating automake/autoconf doesn't upgrade the copies.
This has never mattered to me, but it might matter. It might be viewed as an advantage.
|
|
add some OpenBSD patches
Hi,
A few trivial additions of OpenBSD to ifdefs, plus the change of the abort signal to SIGUSR1 which fixes the SIGABRT problem (other compilation problems remain). SIGTTIN is broadcast to the process group which leads to the SIGABRT (at least on OpenBSD).
|
|
* [acceptance-tests] Revert part of 1216780e830e521b8a4f61a8ca3c505ab63b9e2f.
This didn't work as well as I'd hoped.
* [libgc] Export GC_start_blocking () and GC_end_blocking ().
* [libgc] Allow GC_start_blocking ()/GC_end_blocking () to be called unbalanced.
This makes things a bit easier in Mono.
* [libgc] Implement GC_start_blocking ()/GC_end_blocking () for Windows.
* [utils/event] Export the MonoOSEvent APIs for use in the profiler.
* [runtime] Implement thread info flags and get rid of tools threads.
The concept of a tools thread was originally a good solution to the problem of
some internal threads needing to be exempt from stop-the-world. Since they were
introduced, however, we've added more code in the profiler's internal threads
which require certain properties that don't hold true for tools threads. In
particular, we call into some APIs in the metadata layer that, while not
needing the managed heap, do need a domain to be set under certain conditions
(see #6188).
To avoid further complicating the semantics of tools thread by trying to set a
domain for them in a way that doesn't break things horribly, we'll instead do
away with the concept entirely. We already had mono_gc_set_skip_thread () to
flag a thread as being exempt from stop-the-world, which we used in thread pool
threads. This means we already have the infrastructure that is necessary for a
thread to be fully attached to the runtime as a managed thread while still
being exempt from stop-the-world.
So, we do the following:
1. Introduce a set of flags that can be set on a MonoThreadInfo at arbitrary
points (although not in async context). These can indicate that the thread
doesn't want to participate in stop-the-world, doesn't want to receive
sampling signals, etc.
2. Change the thread iteration macros to allow skipping threads with specific
flags set and use this where appropriate (e.g. SGen stop-the-world code).
3. Get rid of mono_gc_set_skip_thread () and make runtime code use the new
mono_thread_info_set_flags () instead.
4. Switch all internal profiler threads to using mono_thread_attach () and
mono_thread_detach (). Use mono_thread_info_set_flags () to disable
stop-the-world and sampling signals for these threads immediately after they
start.
With these changes, internal profiler threads are now fully attached threads
and can call any APIs in the runtime as long as they don't touch the managed
heap.
* [libgc] Add a note about how GC_start_blocking ()/GC_end_blocking () differ from upstream.
|
|
* include netinet/in.h for in_addr_t
* there is no need for an openbsd specific implementation anymore
so you use the generic pthread one
* signal.h is required for sigaltstack
* add missing mono/utils/mono-threads.h include
* there is no malloc.h on OpenBSD either
* sys/socket.h is required for struct sockaddr
* add support for btls on openbsd and default to with_tls=pthread as there is only emultls support which is not enough for mono
* there is no need for pthread_attr_init/destroy anymore
* add -Wl,-zwxneeded to LDFLAGS on OpenBSD
W^X is strictly enforced by default on OpenBSD;
a program can only violate it if it is located on a filesystem mounted
with the wxallowed mount(8) option and has been linked with the
above flag
|
|
* Compile on amd64 Haiku
Use sigcontext (somewhat like win32, or x86) on Haiku amd64.
On amd64, Haiku doesn't have issues with marshalling 64-bit values,
but it currently does have issues with SGen either causing a stall
or a core dump. As such, while it can compile the stdlib (further
than x86 got), it's still a work in progress.
* Use set_real_time_clock for sys-time.c on Haiku
* Get mono-boehm compiling on Haiku again
It still doesn't work. Initialization will call GC_mark_from, which
will cause a segmentation fault as it decrements pointers. (Mono
will enter an infinite loop in mono_get_hazardous_pointer as a result.)
For now, mono-sgen will continue to be used by default.
|
|
|
|
* Remove the mark/reclaim events as they've been broken for a long time and
aren't particularly useful.
* Reorder the enum member declarations to the order they actually arrive in.
|
|
|
|
|
|
The purpose of this commit is to unify tls access across all platforms. We had tls information spread out throughout the entire code which was guarded with many defines/capabilities which made very hard to follow what was going on. Also this made switching between pthread and __thread very unstable since there were a lot of dependencies between different pieces of the tls infrastructure. Also it was not very clear what happens if one of the tls pieces failed.
Now we are moving all the tls variables to a single module that provides getters/setters and initialization API. Runtime code now knows that we can always access a tls variable (from managed code, we just do a nowrapper icall into the same global geters/setters). Even though we used to these type of calls all around before, it is worth mentioning that runtime should account for a thread to be in this type of unregistered code without m2n wrapper and no register jinfo.
On average this makes common tls intensive methods (m2n wrappers and managed allocator) 20% slower, with potential for more regression if we use tls getters/setters recklessly. As a consequence we will re-enable the most important pieces of fast tls code in the future.
|
|
This prevents possible STW deadlocks.
|
|
On musl __GLIBC__ is not defined, so the conditional logic will
not produce correct result. Add a specific case to handle when
__GLIBC__ is not defined.
|
|
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.
|
|
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=40144
Tested on PowerPC by Mathieu Malaterre <malat@debian.org>.
|
|
With GCC 5.x, the compiler optimises away the dummy load used to
estimate the stack pointer address in GC_approx_sp; it returns
zero. This leads to segfaults when embedding Mono.
Instead, use __builtin_frame_address, which GCC's libgc uses for
the same purpose.
|
|
Remove ChangeLog files from the repo
|
|
|
|
Current Debian packaging puts libtool in its own package (libtool-bin)
leaving only libtoolize in the main package. The mono build process
uses libtoolize not libtool, so during autogen check for libtoolize
not libtool.
|
|
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
|
|
overwrite them.
|
|
Mono create_allocator accesses libgc private *_freelists directly.
These fields have been grouped together into struct
thread_local_freelists in BDWGC v7.
This commit does code refactoring to match the structure of external
GC regarding *_freelists.
* Move GRANULARITY, NFREELISTS (used by *_freelists) out of
GC_Thread_Rep.
* Move ptrfree_freelists, normal_freelists, gcj_freelists from
GC_Thread_Rep to struct thread_local_freelists.
* Add tlfs field (of type struct thread_local_freelists) to
GC_Thread_Rep.
* Update pthread_support.c and boehm-gc.c code accordingly.
|
|
Mono-specific libgc functionality has been recently added to BDWGC.
This commit changes API of included Boehm GC to match that of the
external GC.
* Renaming:
- GCEventType -> GC_EventType
- GC_get_restart_signal -> GC_get_thr_restart_signal
- GC_toggleref_register_callback -> GC_set_toggleref_func
- GC_set_finalizer_notify_proc -> GC_set_await_finalize_proc
* Replace global variable with a setter:
- GC_notify_event -> GC_set_on_collection_event() (acquires GC lock)
* Foreign threads registration:
- add GC_allow_register_threads() (no-op for GC v6, called by
mono_gc_base_init)
- add GC_SUCCESS, GC_DUPLICATE, GC_NO_MEMORY, GC_UNIMPLEMENTED macros
- add struct GC_stack_base
- replace GC_thread_register_foreign(void*) with
GC_register_my_thread(struct GC_stack_base)
- define GC_register_my_thread also for Solaris and Win32
- GC_register_my_thread returns GC_DUPLICATE if already registered
* Toggle-ref callback declaration change:
- add GC_ToggleRefStatus (enum type)
- callback returns GC_ToggleRefStatus instead of int
* Toggle-ref addition status checked:
- GC_toggleref_add return type changed from void to int
- GC_toggleref_add returns GC_SUCCESS or GC_NO_MEMORY
- static ensure_toggleref_capacity() returns FALSE if GC MALLOC failed
- call g_error() if GC_toggleref_add failed
* Conditional public function declaration:
- wrap GC_DllMain declaration into ifdef GC_INSIDE_DLL
- define GC_INSIDE_DLL prior to include gc.h
|
|
This has not been supported for a while, so remove it.
|
|
Makefile defines GC_WIN32_THREADS as 1 but gc_config_macros was
redefining as defined but with no value.
Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk>
|
|
|
|
GNU/kFreeBSD is an experimental OS provided by the Debian project, consisting
of a FreeBSD kernel and GNU userland/libc. For a small number of cases, this
offers advantages over a more common GNU/Linux combination, such as fast
in-kernel support for ZFS storage.
This patch changes various ifdefs, either using __FreeBSD_kernel__ where a
trait from the kernel is what matters, or __GLIBC__ where a trait from the
C library matters.
This patch set has been carried downstream, in one form or another, since
1.2.3.1-1.
https://bugzilla.novell.com/show_bug.cgi?id=321634
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
../../libgc/alloc.c: In function ‘GC_stopped_mark’:
../../libgc/alloc.c:501:9: error: implicit declaration of function ‘GC_cond_register_dynamic_libraries’ [-Werror=implicit-function-declaration]
GC_cond_register_dynamic_libraries();
|
|
Replace GC_free with GC_INTERNAL_FREE. The former might take the GC lock
and deadlock us.
Replace GC_INTERNAL_MALLOC with GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE as
we don't need the rest of the GC messing around with the toggleref array.
|
|
sgen code, so keep them in sync.
|
|
|
|
|
|
|
|
|
|
This is to ensure that if the runtime is compiled for e.g.
ARM v4 or v5, it will use the correct atomics on v6 and v7.
|
|
This only worked by accident before the HAVE_ARMV<N>
changes because __ARM_ARCH_6__ is never defined by
any compiler.
|
|
This defines ARM_VERSION_{5,6,7}. Several of these can be
defined at once. For example ARM_VERSION_5 and ARM_VERSION_6
will both be defined if the target is an ARM v6 CPU.
Previously, we defined HAVE_ARMV6 based on running a program.
This obviously didn't work for cross-compilation. This new
approach does, and detects more cases (v5, v6, v7) than the
previous check (v6).
|