-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Build mono for WebAssembly, but set the suspend mechanism to hybrid or cooperative. Then run an AOT compilation. The runtime will assert at
runtime/src/mono/mono/mini/mini.c
Line 2871 in ea4f5f2
| g_assert (mini_safepoints_enabled ()); |
Because mini_safepoints_enabled is just:
static inline gboolean
mini_safepoints_enabled (void)
{
#if defined (TARGET_WASM)
return FALSE;
#else
return TRUE;
#endif
}but the insert_safepoint function is called when mono_threads_are_safepoints_enabled() returns TRUE - which is dependent on the suspend mode.
This is not a problem for the way we do GC on WebAssembly today in single-threaded mode. And probably not for multi-threaded mode either - since there's no stack walking, stopping at a safepoint is not useful. So this is issue is just for documentation.
We may need to revisit if we do multi-threaded wasm and use the suspend mechanism for non-GC uses which don't need full stack traces.