Skip to content

Mono WebAssembly AOT asserts if hybrid or cooperative suspend is used #47080

@lambdageek

Description

@lambdageek

Build mono for WebAssembly, but set the suspend mechanism to hybrid or cooperative. Then run an AOT compilation. The runtime will assert at

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions