-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[interp] inlining a wrapper with a MINT_LDSTR_TOKEN instruction aborts #88694
Comments
Tagging subscribers to this area: @BrzVlad, @kotlarmilos Issue DetailsIf the runtime creates a wrapper whose entire body is just If this wrapper is then inlined into its caller, we end up here: runtime/src/mono/mono/mini/interp/interp.c Lines 5580 to 5587 in eabea90
Normally, if the wrapper is not inlined But if the wrapper is inlined we end up in the Found in an early iteration of #88626
|
/cc @BrzVlad |
Actually it might not have anythign to do with inlining. It has to do with the fact that runtime/src/mono/mono/mini/interp/transform.c Lines 11404 to 11419 in 14e8b82
Here even if we do so if any of those wrappers used |
I'm pretty sure, in general, for wrapper methods |
MINT_LDSTR_DYNAMIC for dynamic methods. the data item is an index into the DynamicMethod:method.method_data which stores pointers to MonoString objects that are held by the managed DynamicMethod. MINT_LDSTR_CSTR for ilgen wrappers. the data item is a raw C string that is global, or was allocated by malloc Fixes dotnet#88694 by allowing MINT_LDSTR_CSTR in any method since we no longer depend on mono_method_get_wrapper_data at execution time. And at transform time we have access to the actual wrapper method.
MINT_LDSTR_DYNAMIC for dynamic methods. the data item is an index into the DynamicMethod:method.method_data which stores pointers to MonoString objects that are held by the managed DynamicMethod. MINT_LDSTR_CSTR for ilgen wrappers. the data item is a raw C string that is global, or was allocated by malloc Fixes #88694 by allowing MINT_LDSTR_CSTR in any method since we no longer depend on mono_method_get_wrapper_data at execution time. And at transform time we have access to the actual wrapper method.
If the runtime creates a wrapper whose entire body is just
mono_mb_emit_exception_full(mb, "System", "NotImplementedException", "some case in this wrapper is unimplemented")
then the interpreter will emit anMINT_LDSTR_TOKEN
instruction for theconst char* msg
argument.If this wrapper is then inlined into its caller, we end up here:
runtime/src/mono/mono/mini/interp/interp.c
Lines 5580 to 5587 in eabea90
Normally, if the wrapper is not inlined
MonoMethod *method = frame->imethod->method
will be the wrapper, and we end up in themethod->wrapper_type != MONO_WRAPPER_NONE
case.But if the wrapper is inlined we end up in the
else g_assert_not_reached()
case and crash.Found in an early iteration of #88626
The text was updated successfully, but these errors were encountered: