-
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
[mono] enable_checked_build_thread trigger warning as error #90362
Comments
when i enable_checked_build_thread flag, it always hit assert, like mono_string_length
runtime/src/mono/mono/metadata/object.c Lines 7900 to 7903 in 09af161
Should we replace @lateralusX ,could you have time to toke look it? |
There are several functions in |
I will take a look at the warnings next time I'm around that code, we don't build the runtime in checked mode on all platforms on CI, so that is why these warnings (treated as errors) have gone undetected. |
could you take time to check this? how to fix it, remove the assert or add gc transition @lambdageek |
and when I enabled build check, we hit
and the thread transitions log:
can you tell me what cause this problem? |
I have tried to dump the stack variable when exception occured. void
mono_invoke_walk_excepction_stack_hook (MonoStackFrameInfo *frame, void *ctx)
{
if (walk_exception_stack_hook) {
MONO_ENTER_GC_SAFE;
walk_exception_stack_hook (frame, ctx, walk_exception_stack_hook_data);
MONO_EXIT_GC_SAFE;
}
} and call in
|
I believe that happens since win32_wait_for_single_object_ex can be called with a coop flag and depending if we are are calling that function in "coop" mode we will transition to GC safe before calling win32_wait_for_single_object_ex_interrupt_checked, but since that function is called from both code paths and anticipate that we have entered GC safe, that will trigger assert. win32_wait_for_single_object_ex is a low level PAL function, that's why it has an option to call WaitForSingleObjectEx without always doing GC SAFE, since it might be called from code already in GC safe mode, or like in this case, called from code that is in the process of entering GC safe mode. Fix is probably something along these lines in runtime\src\mono\mono\utils\mono-os-wait-win32.c (changed from win32_wait_for_single_object_ex_interrupt_checked to WaitForSingleObjectEx in case cooperative is FALSE).
|
ok, thanks
the code from:
i have print the push and pop operator:
how can I found what problem is it? |
hi,could you help me? @lateralusX I found some coop tls push 0x0 not pop, show bellow:
maybe it occured when gc It is diffcult to find the problem due to there are many push/pop operator. |
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(430) : error C2220: the following warning is treated as an error
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(249) : error C2220: the following warning is treated as an error
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(375) : error C2220: the following warning is treated as an error
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(249) : warning C4715: 'mono_threads_transition_detach': not all control paths return a value
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(552) : error C2220: the following warning is treated as an error
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(430) : warning C4715: 'mono_threads_transition_state_poll': not all control paths return a value
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(602) : warning C4715: 'mono_threads_transition_request_pulse': not all control paths return a value
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(375) : warning C4715: 'mono_threads_transition_peek_blocking_suspend_requested': not all control paths return a value
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(552) : warning C4715: 'mono_threads_transition_request_resume': not all control paths return a value
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(655) : warning C4715: 'mono_threads_transition_abort_async_suspend': not all control paths return a value
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(761) : warning C4715: 'mono_threads_transition_do_blocking': not all control paths return a value
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(809) : warning C4715: 'mono_threads_transition_done_blocking': not all control paths return a value
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(709) : warning C4715: 'mono_threads_transition_finish_async_suspend': not all control paths return a value
F:\dotnet\runtime\src\mono\mono\utils\mono-threads-state-machine.c(887) : warning C4715: 'mono_threads_transition_abort_blocking': not all control paths return a value
The text was updated successfully, but these errors were encountered: