-
Notifications
You must be signed in to change notification settings - Fork 3.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] always require GC Unsafe mode in exception checkpoint #17016
Conversation
Overall the code is a little fishy when it comes to this unsafe checking. Normally the wrapper does all the necessary transitions and we would know when to check and when not to check for exception inside the wrapper (I think this is how it works on jit). In the interpreter, I think we use this opcode for multiple scenarios, some of which require exception checking, some of which must not (and therefore the bug from the other PR). Regardless, we should probably have a separate define, that does the state check, only for these icall opcodes. The check is redundant for other uses of EXCEPTION_CHECKPOINT (since we are by definition in unsafe state) and it might also confuse readers of code. |
You are right, the wrapper could do it: Lines 3447 to 3449 in aeca4a6
mono/mono/metadata/marshal-ilgen.c Lines 2073 to 2074 in aeca4a6
It looks like it would do the thread interruption regardless of the GC state? mono/mono/metadata/marshal-ilgen.c Lines 1188 to 1218 in aeca4a6
Not sure how this can work in the JIT then. Anyway, we specifically ask to not do generate those checks when building the wrapper for interpreter uses: mono/mono/mini/interp/interp.c Line 510 in aeca4a6
mono/mono/mini/interp/interp.c Line 1683 in aeca4a6
mono/mono/mini/interp/interp.c Line 3460 in aeca4a6
Edit: and in transform.c :mono/mono/mini/interp/transform.c Line 1702 in aeca4a6
mono/mono/mini/interp/transform.c Line 1707 in aeca4a6
mono/mono/mini/interp/transform.c Line 6720 in aeca4a6
|
47a5d55
to
e2b2149
Compare
@monojenkins squash |
…mono#17016) [interp] always require GC Unsafe mode in exception checkpoint Follow-up for mono/mono#16955 /cc @BrzVlad Commit migrated from mono/mono@c81b6f5
Follow-up for #16955
/cc @BrzVlad