From 6f43cab8de4a4582b157ef7c637c3c982b7c9a75 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 16 Nov 2020 13:35:11 -0500 Subject: [PATCH 01/13] Ifdef out removed icalls on netcore --- src/mono/mono/metadata/icall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c index 727889bd45675f..77f8c05ee0ea35 100644 --- a/src/mono/mono/metadata/icall.c +++ b/src/mono/mono/metadata/icall.c @@ -6061,7 +6061,6 @@ ves_icall_RuntimeType_get_core_clr_security_level (MonoReflectionTypeHandle rfie return_val_if_nok (error, -1); return mono_security_core_clr_class_level (klass); } -#endif int ves_icall_RuntimeFieldInfo_get_core_clr_security_level (MonoReflectionFieldHandle rfield, MonoError *error) @@ -6076,6 +6075,7 @@ ves_icall_RuntimeMethodInfo_get_core_clr_security_level (MonoReflectionMethodHan MonoMethod *method = MONO_HANDLE_GETVAL (rfield, method); return mono_security_core_clr_method_level (method, TRUE); } +#endif MonoStringHandle ves_icall_System_Reflection_RuntimeAssembly_get_fullname (MonoReflectionAssemblyHandle assembly, MonoError *error) @@ -6818,11 +6818,13 @@ mono_icall_module_get_hinstance (MonoImage *image) } #endif /* HOST_WIN32 */ +#ifndef ENABLE_NETCORE gpointer ves_icall_System_Reflection_RuntimeModule_GetHINSTANCE (MonoImage *image, MonoError *error) { return mono_icall_module_get_hinstance (image); } +#endif void ves_icall_System_Reflection_RuntimeModule_GetPEKind (MonoImage *image, gint32 *pe_kind, gint32 *machine, MonoError *error) From 24c090b0d6ab3dfd2b2f22ba8341ae183c87bf86 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 16 Nov 2020 13:35:42 -0500 Subject: [PATCH 02/13] Fix format string for cross builds desc here is based on the pointer size of the target, whereas void* is based on the host --- src/mono/mono/sgen/sgen-descriptor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/sgen/sgen-descriptor.c b/src/mono/mono/sgen/sgen-descriptor.c index a959d2ecbe02ed..ad5d7e5de8ad9d 100644 --- a/src/mono/mono/sgen/sgen-descriptor.c +++ b/src/mono/mono/sgen/sgen-descriptor.c @@ -129,7 +129,7 @@ mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size) } if (first_set < 0) { - SGEN_LOG (6, "Ptrfree descriptor %p, size: %ld", (void*)desc, (long)stored_size); + SGEN_LOG (6, "Ptrfree descriptor %llu, size: %zu", (guint64)desc, stored_size); if (stored_size <= MAX_RUNLEN_OBJECT_SIZE && stored_size <= SGEN_MAX_SMALL_OBJ_SIZE) return DESC_TYPE_SMALL_PTRFREE | stored_size; return DESC_TYPE_COMPLEX_PTRFREE; @@ -142,7 +142,7 @@ mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size) /* we know the 2-word header is ptr-free */ if (last_set < BITMAP_NUM_BITS + OBJECT_HEADER_WORDS && stored_size <= SGEN_MAX_SMALL_OBJ_SIZE) { desc = DESC_TYPE_BITMAP | ((*bitmap >> OBJECT_HEADER_WORDS) << LOW_TYPE_BITS); - SGEN_LOG (6, "Largebitmap descriptor %p, size: %ld, last set: %d", (void*)desc, (long)stored_size, last_set); + SGEN_LOG (6, "Largebitmap descriptor %llu, size: %zu, last set: %d", (guint64)desc, stored_size, last_set); return desc; } @@ -153,7 +153,7 @@ mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size) */ if (first_set < 256 && num_set < 256 && (first_set + num_set == last_set + 1)) { desc = DESC_TYPE_RUN_LENGTH | stored_size | (first_set << 16) | (num_set << 24); - SGEN_LOG (6, "Runlen descriptor %p, size: %ld, first set: %d, num set: %d", (void*)desc, (long)stored_size, first_set, num_set); + SGEN_LOG (6, "Runlen descriptor %llu, size: %zu, first set: %d, num set: %d", (guint64)desc, stored_size, first_set, num_set); return desc; } } From c8b408226afbe1f4ebf758b003b67ff021935eca Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 16 Nov 2020 13:36:14 -0500 Subject: [PATCH 03/13] Re-enable -WError on CI for OSX and Wasm This got lost in the CMake transition --- src/mono/mono.proj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index d8bc2918024408..8eba951d106c1a 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -60,6 +60,11 @@ + + + <_MonoCMakeArgs Include="-DENABLE_WERROR=1"/> + + From 123425a24731715f794974648d8a71aafcaf7d9e Mon Sep 17 00:00:00 2001 From: lateralusX Date: Fri, 20 Nov 2020 16:05:37 +0100 Subject: [PATCH 04/13] Improve ep_rt_thread_id_t handling. --- src/mono/mono/eventpipe/ep-rt-mono.h | 27 +++++++++++++++++----- src/mono/mono/eventpipe/ep-rt-types-mono.h | 2 ++ src/native/eventpipe/ds-server.c | 2 +- src/native/eventpipe/ep-buffer.c | 2 +- src/native/eventpipe/ep-event-instance.c | 2 +- src/native/eventpipe/ep-json-file.c | 3 ++- src/native/eventpipe/ep-rt.h | 12 ++++++++-- src/native/eventpipe/ep-sample-profiler.c | 2 +- src/native/eventpipe/ep-session.c | 2 +- 9 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/mono/mono/eventpipe/ep-rt-mono.h b/src/mono/mono/eventpipe/ep-rt-mono.h index a70bb119940748..6cc6636a5a1848 100644 --- a/src/mono/mono/eventpipe/ep-rt-mono.h +++ b/src/mono/mono/eventpipe/ep-rt-mono.h @@ -313,7 +313,6 @@ prefix_name ## _rt_ ## type_name ## _ ## func_name typedef MonoThreadStart ep_rt_thread_start_func; typedef mono_thread_start_return_t ep_rt_thread_start_func_return_t; -typedef MonoNativeThreadId ep_rt_thread_id_t; typedef EventPipeThreadHolder * (*ep_rt_thread_holder_alloc_func)(void); typedef void (*ep_rt_thread_holder_free_func)(EventPipeThreadHolder *thread_holder); @@ -1376,13 +1375,13 @@ ep_rt_processors_get_count (void) static inline -size_t +ep_rt_thread_id_t ep_rt_current_thread_get_id (void) { #ifdef EP_RT_MONO_USE_STATIC_RUNTIME - return MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ()); + return mono_native_thread_id_get (); #else - return MONO_NATIVE_THREAD_ID_TO_UINT (ep_rt_mono_func_table_get ()->ep_rt_mono_native_thread_id_get ()); + return ep_rt_mono_func_table_get ()->ep_rt_mono_native_thread_id_get (); #endif } @@ -1848,10 +1847,26 @@ ep_rt_thread_get_handle (void) static inline -size_t +ep_rt_thread_id_t ep_rt_thread_get_id (ep_rt_thread_handle_t thread_handle) { - return MONO_NATIVE_THREAD_ID_TO_UINT (mono_thread_info_get_tid (thread_handle)); + return mono_thread_info_get_tid (thread_handle); +} + +static +inline +uint64_t +ep_rt_thread_id_t_to_uint64_t (ep_rt_thread_id_t thread_id) +{ + return (uint64_t)MONO_NATIVE_THREAD_ID_TO_UINT (thread_id); +} + +static +inline +ep_rt_thread_id_t +ep_rt_uint64_t_to_thread_id_t (uint64_t thread_id) +{ + return MONO_UINT_TO_NATIVE_THREAD_ID (thread_id); } static diff --git a/src/mono/mono/eventpipe/ep-rt-types-mono.h b/src/mono/mono/eventpipe/ep-rt-types-mono.h index 916c7378de2926..8fde364ef3fa4d 100644 --- a/src/mono/mono/eventpipe/ep-rt-types-mono.h +++ b/src/mono/mono/eventpipe/ep-rt-types-mono.h @@ -134,5 +134,7 @@ typedef struct _rt_mono_event_internal_t ep_rt_wait_event_handle_t; typedef struct _rt_mono_lock_internal_t ep_rt_lock_handle_t; typedef ep_rt_lock_handle_t ep_rt_spin_lock_handle_t; +typedef MonoNativeThreadId ep_rt_thread_id_t; + #endif /* ENABLE_PERFTRACING */ #endif /* __EVENTPIPE_RT_TYPES_MONO_H__ */ diff --git a/src/native/eventpipe/ds-server.c b/src/native/eventpipe/ds-server.c index ffc35bbba24e5a..ac1900caf1a736 100644 --- a/src/native/eventpipe/ds-server.c +++ b/src/native/eventpipe/ds-server.c @@ -209,7 +209,7 @@ ds_server_init (void) ds_rt_auto_trace_init (); ds_rt_auto_trace_launch (); - ep_rt_thread_id_t thread_id = 0; + ep_rt_thread_id_t thread_id = ep_rt_uint64_t_to_thread_id_t (0); if (!ep_rt_thread_create ((void *)server_thread, NULL, EP_THREAD_TYPE_SERVER, (void *)&thread_id)) { // Failed to create IPC thread. diff --git a/src/native/eventpipe/ep-buffer.c b/src/native/eventpipe/ep-buffer.c index 1bf06c81aa4f54..186eef25d8fdec 100644 --- a/src/native/eventpipe/ep-buffer.c +++ b/src/native/eventpipe/ep-buffer.c @@ -110,7 +110,7 @@ ep_buffer_write_event ( (EventPipeEventInstance *)buffer->current, ep_event, proc_number, - (thread == NULL) ? ep_rt_current_thread_get_id () : ep_rt_thread_get_id (thread), + ep_rt_thread_id_t_to_uint64_t((thread == NULL) ? ep_rt_current_thread_get_id () : ep_rt_thread_get_id (thread)), data_dest, ep_event_payload_get_size (payload), (thread == NULL) ? NULL : activity_id, diff --git a/src/native/eventpipe/ep-event-instance.c b/src/native/eventpipe/ep-event-instance.c index d609e7ef0458c6..826ecdbb4d2adf 100644 --- a/src/native/eventpipe/ep-event-instance.c +++ b/src/native/eventpipe/ep-event-instance.c @@ -208,7 +208,7 @@ ep_event_instance_serialize_to_json_file ( ep_event_get_event_version (ep_event_instance->ep_event)); if (characters_written > 0 && characters_written < EP_ARRAY_SIZE (buffer)) - ep_json_file_write_event_data (json_file, ep_event_instance->timestamp, (ep_rt_thread_id_t)(ep_event_instance->thread_id), buffer, &ep_event_instance->stack_contents); + ep_json_file_write_event_data (json_file, ep_event_instance->timestamp, ep_rt_thread_id_t_to_uint64_t (ep_event_instance->thread_id), buffer, &ep_event_instance->stack_contents); } #else void diff --git a/src/native/eventpipe/ep-json-file.c b/src/native/eventpipe/ep-json-file.c index fe7b9296a18517..d2674af0a5d169 100644 --- a/src/native/eventpipe/ep-json-file.c +++ b/src/native/eventpipe/ep-json-file.c @@ -9,6 +9,7 @@ #include "ep.h" #include "ep-event-instance.h" #include "ep-rt.h" +#include #ifdef EP_CHECKED_BUILD @@ -134,7 +135,7 @@ ep_json_file_write_event_data ( json_file_write_string (json_file, buffer); } - characters_written = ep_rt_utf8_string_snprintf (buffer, EP_ARRAY_SIZE (buffer), "\"Thread (%ld)\"]},", (uint64_t)thread_id); + characters_written = ep_rt_utf8_string_snprintf (buffer, EP_ARRAY_SIZE (buffer), "\"Thread (%" PRIu64 ")\"]},", ep_rt_thread_id_t_to_uint64_t (thread_id)); if (characters_written > 0 && characters_written < EP_ARRAY_SIZE (buffer)) json_file_write_string (json_file, buffer); } diff --git a/src/native/eventpipe/ep-rt.h b/src/native/eventpipe/ep-rt.h index cbe82dc95944a1..52d65e61a31c2d 100644 --- a/src/native/eventpipe/ep-rt.h +++ b/src/native/eventpipe/ep-rt.h @@ -468,7 +468,7 @@ uint32_t ep_rt_processors_get_count (void); static -size_t +ep_rt_thread_id_t ep_rt_current_thread_get_id (void); static @@ -690,9 +690,17 @@ ep_rt_thread_handle_t ep_rt_thread_get_handle (void); static -size_t +ep_rt_thread_id_t ep_rt_thread_get_id (ep_rt_thread_handle_t thread_handle); +static +uint64_t +ep_rt_thread_id_t_to_uint64_t (ep_rt_thread_id_t thread_id); + +static +ep_rt_thread_id_t +ep_rt_uint64_t_to_thread_id_t (uint64_t thread_id); + static bool ep_rt_thread_has_started (ep_rt_thread_handle_t thread_handle); diff --git a/src/native/eventpipe/ep-sample-profiler.c b/src/native/eventpipe/ep-sample-profiler.c index 0bbea13ea87849..615ceeac9727da 100644 --- a/src/native/eventpipe/ep-sample-profiler.c +++ b/src/native/eventpipe/ep-sample-profiler.c @@ -210,7 +210,7 @@ sample_profiler_enable (void) if (!ep_rt_wait_event_is_valid (&_thread_shutdown_event)) EP_ASSERT (!"Unable to create sample profiler event."); - ep_rt_thread_id_t thread_id = 0; + ep_rt_thread_id_t thread_id = ep_rt_uint64_t_to_thread_id_t (0); if (!ep_rt_thread_create (sampling_thread, NULL, EP_THREAD_TYPE_SAMPLING, &thread_id)) EP_ASSERT (!"Unable to create sample profiler thread."); diff --git a/src/native/eventpipe/ep-session.c b/src/native/eventpipe/ep-session.c index 72214042929416..02a3bce5976883 100644 --- a/src/native/eventpipe/ep-session.c +++ b/src/native/eventpipe/ep-session.c @@ -94,7 +94,7 @@ session_create_ipc_streaming_thread (EventPipeSession *session) if (!ep_rt_wait_event_is_valid (&session->rt_thread_shutdown_event)) EP_ASSERT (!"Unable to create IPC stream flushing thread shutdown event."); - ep_rt_thread_id_t thread_id = 0; + ep_rt_thread_id_t thread_id = ep_rt_uint64_t_to_thread_id_t (0); if (!ep_rt_thread_create ((void *)streaming_thread, (void *)session, EP_THREAD_TYPE_SESSION, &thread_id)) EP_ASSERT (!"Unable to create IPC stream flushing thread."); } From c1f7bd1a9bc8e79025e434656393b3b5ec0c8640 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Fri, 20 Nov 2020 13:18:36 -0500 Subject: [PATCH 05/13] Make types_str local to mono_fdhandle_insert --- src/mono/mono/metadata/fdhandle.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mono/mono/metadata/fdhandle.c b/src/mono/mono/metadata/fdhandle.c index 39e531b514c5ba..33f9132a13c5f0 100644 --- a/src/mono/mono/metadata/fdhandle.c +++ b/src/mono/mono/metadata/fdhandle.c @@ -8,14 +8,6 @@ static MonoCoopMutex fds_mutex; static MonoFDHandleCallback fds_callback[MONO_FDTYPE_COUNT]; static mono_lazy_init_t fds_init = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED; -static const gchar *types_str[] = { - "File", - "Console", - "Pipe", - "Socket", - NULL -}; - static void fds_remove (gpointer data) { @@ -67,6 +59,14 @@ mono_fdhandle_init (MonoFDHandle *fdhandle, MonoFDType type, gint fd) void mono_fdhandle_insert (MonoFDHandle *fdhandle) { + static const gchar *types_str[] = { + "File", + "Console", + "Pipe", + "Socket", + NULL + }; + mono_coop_mutex_lock (&fds_mutex); if (g_hash_table_lookup_extended (fds, GINT_TO_POINTER(fdhandle->fd), NULL, NULL)) From 538833b50869264e99285e728b4b038e9e23cfe3 Mon Sep 17 00:00:00 2001 From: lateralusX Date: Fri, 20 Nov 2020 19:34:39 +0100 Subject: [PATCH 06/13] Fix OSX build error. --- src/native/eventpipe/ep-config.c | 2 +- src/native/eventpipe/ep-thread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/native/eventpipe/ep-config.c b/src/native/eventpipe/ep-config.c index d840959ffcaae2..30335b0d490d67 100644 --- a/src/native/eventpipe/ep-config.c +++ b/src/native/eventpipe/ep-config.c @@ -383,7 +383,7 @@ ep_config_build_event_metadata_event ( instance = ep_event_metdata_event_alloc ( config->metadata_event, ep_rt_current_processor_get_number (), - ep_rt_current_thread_get_id (), + ep_rt_thread_id_t_to_uint64_t (ep_rt_current_thread_get_id ()), instance_payload, instance_payload_size, NULL /* pActivityId */, diff --git a/src/native/eventpipe/ep-thread.c b/src/native/eventpipe/ep-thread.c index 33e246ffcdc1d7..9632ce775d966c 100644 --- a/src/native/eventpipe/ep-thread.c +++ b/src/native/eventpipe/ep-thread.c @@ -35,7 +35,7 @@ ep_thread_alloc (void) ep_rt_spin_lock_alloc (&instance->rt_lock); ep_raise_error_if_nok (ep_rt_spin_lock_is_valid (&instance->rt_lock)); - instance->os_thread_id = ep_rt_current_thread_get_id (); + instance->os_thread_id = ep_rt_thread_id_t_to_uint64_t (ep_rt_current_thread_get_id ()); memset (instance->session_state, 0, sizeof (instance->session_state)); EP_SPIN_LOCK_ENTER (&_ep_threads_lock, section1) From 2de71daec47ef9f9e56447ed79a6c3bbb947a1f5 Mon Sep 17 00:00:00 2001 From: lateralusX Date: Fri, 20 Nov 2020 20:12:04 +0100 Subject: [PATCH 07/13] Align os thread id to uint64_t. --- src/native/eventpipe/ep-buffer-manager.c | 2 +- src/native/eventpipe/ep-event-instance.c | 2 +- src/native/eventpipe/ep-thread.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/native/eventpipe/ep-buffer-manager.c b/src/native/eventpipe/ep-buffer-manager.c index b767f9b668daa7..9c6e9c289c0a75 100644 --- a/src/native/eventpipe/ep-buffer-manager.c +++ b/src/native/eventpipe/ep-buffer-manager.c @@ -1161,7 +1161,7 @@ ep_buffer_manager_write_all_buffers_to_file_v4 ( if (buffer_manager->current_event == NULL) break; - size_t capture_thread_id = ep_thread_get_os_thread_id (ep_buffer_get_writer_thread (buffer_manager->current_buffer)); + uint64_t capture_thread_id = ep_thread_get_os_thread_id (ep_buffer_get_writer_thread (buffer_manager->current_buffer)); EventPipeBufferList *buffer_list = buffer_manager->current_buffer_list; diff --git a/src/native/eventpipe/ep-event-instance.c b/src/native/eventpipe/ep-event-instance.c index 826ecdbb4d2adf..d640438dbcfc1e 100644 --- a/src/native/eventpipe/ep-event-instance.c +++ b/src/native/eventpipe/ep-event-instance.c @@ -208,7 +208,7 @@ ep_event_instance_serialize_to_json_file ( ep_event_get_event_version (ep_event_instance->ep_event)); if (characters_written > 0 && characters_written < EP_ARRAY_SIZE (buffer)) - ep_json_file_write_event_data (json_file, ep_event_instance->timestamp, ep_rt_thread_id_t_to_uint64_t (ep_event_instance->thread_id), buffer, &ep_event_instance->stack_contents); + ep_json_file_write_event_data (json_file, ep_event_instance->timestamp, ep_rt_uint64_t_to_thread_id_t (ep_event_instance->thread_id), buffer, &ep_event_instance->stack_contents); } #else void diff --git a/src/native/eventpipe/ep-thread.h b/src/native/eventpipe/ep-thread.h index d982e33d73ca11..1f62102a24a0ca 100644 --- a/src/native/eventpipe/ep-thread.h +++ b/src/native/eventpipe/ep-thread.h @@ -37,7 +37,7 @@ struct _EventPipeThread_Internal { ep_rt_spin_lock_handle_t rt_lock; // This is initialized when the Thread object is first constructed and remains // immutable afterwards. - size_t os_thread_id; + uint64_t os_thread_id; // The EventPipeThreadHolder maintains one count while the thread is alive // and each session's EventPipeBufferList maintains one count while it // exists. @@ -69,7 +69,7 @@ ep_thread_get_activity_id_cref (ep_rt_thread_activity_id_handle_t activity_id_ha EP_DEFINE_GETTER(EventPipeThread *, thread, EventPipeSession *, rundown_session); EP_DEFINE_SETTER(EventPipeThread *, thread, EventPipeSession *, rundown_session); EP_DEFINE_GETTER_REF(EventPipeThread *, thread, ep_rt_spin_lock_handle_t *, rt_lock); -EP_DEFINE_GETTER(EventPipeThread *, thread, size_t, os_thread_id); +EP_DEFINE_GETTER(EventPipeThread *, thread, uint64_t, os_thread_id); EP_DEFINE_GETTER_REF(EventPipeThread *, thread, int32_t *, ref_count); EventPipeThread * From cadb503b69507e9b9f781727cd6615aaa80fb735 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Fri, 20 Nov 2020 14:55:13 -0500 Subject: [PATCH 08/13] Update src/mono/mono/sgen/sgen-descriptor.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aleksey Kliger (λgeek) --- src/mono/mono/sgen/sgen-descriptor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/sgen/sgen-descriptor.c b/src/mono/mono/sgen/sgen-descriptor.c index ad5d7e5de8ad9d..ab07d6dcdb7d1f 100644 --- a/src/mono/mono/sgen/sgen-descriptor.c +++ b/src/mono/mono/sgen/sgen-descriptor.c @@ -129,7 +129,7 @@ mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size) } if (first_set < 0) { - SGEN_LOG (6, "Ptrfree descriptor %llu, size: %zu", (guint64)desc, stored_size); + SGEN_LOG (6, "Ptrfree descriptor %" PRIu64 ", size: %zu", (uint64_t)desc, stored_size); if (stored_size <= MAX_RUNLEN_OBJECT_SIZE && stored_size <= SGEN_MAX_SMALL_OBJ_SIZE) return DESC_TYPE_SMALL_PTRFREE | stored_size; return DESC_TYPE_COMPLEX_PTRFREE; From 7512b625c640b3221dc2ade328be19a9e6e97133 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Fri, 20 Nov 2020 14:55:21 -0500 Subject: [PATCH 09/13] Update src/mono/mono/sgen/sgen-descriptor.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aleksey Kliger (λgeek) --- src/mono/mono/sgen/sgen-descriptor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/sgen/sgen-descriptor.c b/src/mono/mono/sgen/sgen-descriptor.c index ab07d6dcdb7d1f..e5d47c375c742f 100644 --- a/src/mono/mono/sgen/sgen-descriptor.c +++ b/src/mono/mono/sgen/sgen-descriptor.c @@ -142,7 +142,7 @@ mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size) /* we know the 2-word header is ptr-free */ if (last_set < BITMAP_NUM_BITS + OBJECT_HEADER_WORDS && stored_size <= SGEN_MAX_SMALL_OBJ_SIZE) { desc = DESC_TYPE_BITMAP | ((*bitmap >> OBJECT_HEADER_WORDS) << LOW_TYPE_BITS); - SGEN_LOG (6, "Largebitmap descriptor %llu, size: %zu, last set: %d", (guint64)desc, stored_size, last_set); + SGEN_LOG (6, "Largebitmap descriptor %" PRIu64 ", size: %zu, last set: %d", (uint64_t)desc, stored_size, last_set); return desc; } From 6b5449fe1b00c9339ec09f869761404251a01b87 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Fri, 20 Nov 2020 14:55:29 -0500 Subject: [PATCH 10/13] Update src/mono/mono/sgen/sgen-descriptor.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aleksey Kliger (λgeek) --- src/mono/mono/sgen/sgen-descriptor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/sgen/sgen-descriptor.c b/src/mono/mono/sgen/sgen-descriptor.c index e5d47c375c742f..df72b4e692ed2c 100644 --- a/src/mono/mono/sgen/sgen-descriptor.c +++ b/src/mono/mono/sgen/sgen-descriptor.c @@ -153,7 +153,7 @@ mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size) */ if (first_set < 256 && num_set < 256 && (first_set + num_set == last_set + 1)) { desc = DESC_TYPE_RUN_LENGTH | stored_size | (first_set << 16) | (num_set << 24); - SGEN_LOG (6, "Runlen descriptor %llu, size: %zu, first set: %d, num set: %d", (guint64)desc, stored_size, first_set, num_set); + SGEN_LOG (6, "Runlen descriptor %" PRIu64 ", size: %zu, first set: %d, num set: %d", (uint64_t)desc, stored_size, first_set, num_set); return desc; } } From 4ac4672f222e2db5c42bb43319245a0d65ed4bb6 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Fri, 20 Nov 2020 13:18:36 -0500 Subject: [PATCH 11/13] Revert "Make types_str local to mono_fdhandle_insert" This reverts commit 04f56efcb8e9d33dca12f831f9c05591c649678c. --- src/mono/mono/metadata/fdhandle.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mono/mono/metadata/fdhandle.c b/src/mono/mono/metadata/fdhandle.c index 33f9132a13c5f0..39e531b514c5ba 100644 --- a/src/mono/mono/metadata/fdhandle.c +++ b/src/mono/mono/metadata/fdhandle.c @@ -8,6 +8,14 @@ static MonoCoopMutex fds_mutex; static MonoFDHandleCallback fds_callback[MONO_FDTYPE_COUNT]; static mono_lazy_init_t fds_init = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED; +static const gchar *types_str[] = { + "File", + "Console", + "Pipe", + "Socket", + NULL +}; + static void fds_remove (gpointer data) { @@ -59,14 +67,6 @@ mono_fdhandle_init (MonoFDHandle *fdhandle, MonoFDType type, gint fd) void mono_fdhandle_insert (MonoFDHandle *fdhandle) { - static const gchar *types_str[] = { - "File", - "Console", - "Pipe", - "Socket", - NULL - }; - mono_coop_mutex_lock (&fds_mutex); if (g_hash_table_lookup_extended (fds, GINT_TO_POINTER(fdhandle->fd), NULL, NULL)) From 85ea6fa88cecc68d6c108dc4e941a5c1f14071ab Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Fri, 20 Nov 2020 16:27:50 -0500 Subject: [PATCH 12/13] Put types_str under appropriate ifdef --- src/mono/mono/metadata/fdhandle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mono/mono/metadata/fdhandle.c b/src/mono/mono/metadata/fdhandle.c index 39e531b514c5ba..fd41505b8b666e 100644 --- a/src/mono/mono/metadata/fdhandle.c +++ b/src/mono/mono/metadata/fdhandle.c @@ -8,6 +8,7 @@ static MonoCoopMutex fds_mutex; static MonoFDHandleCallback fds_callback[MONO_FDTYPE_COUNT]; static mono_lazy_init_t fds_init = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED; +#ifndef DISABLE_ASSERT_MESSAGES static const gchar *types_str[] = { "File", "Console", @@ -15,6 +16,7 @@ static const gchar *types_str[] = { "Socket", NULL }; +#endif static void fds_remove (gpointer data) From 9a46919cf42c6b71f46342a31ea7135c149cd6bc Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Wed, 25 Nov 2020 11:46:38 -0500 Subject: [PATCH 13/13] Disable Werror on wasm --- src/mono/mono.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 8eba951d106c1a..20262c32a7587d 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -61,7 +61,7 @@ - + <_MonoCMakeArgs Include="-DENABLE_WERROR=1"/>