-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Introduce concept of "test" mode for apps #10042
Comments
I think JIT should be aware of this mode so there is no check at runtime, verification code gets eliminated during jitting. Another issue is that a lot of checks might slow down things quite a bit so it would be nice to enable/disable them on per assembly/feature basis. |
JIT should definitely be made aware of this, but I don't think it would help that much to be honest. Framework code is pre-JITted, and we can't know until runtime what the operating state is. If the check is a simple read of a known memory address, I think that's probably as fast as we're going to get. And presumably these checks wouldn't occur in perf-critical code paths anyway. |
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process. This process is part of our issue cleanup automation. |
This issue will now be closed since it had been marked |
We should consider introducing a test or verification mode for app execution. This would be a special execution mode that can be toggled independently of debug / release, and the Framework could perform more rigorous correctness checks that it otherwise wouldn't perform when the application is running in normal mode.
One example that came up on an internal email thread is that
ArrayPool.Return
could overwrite the returned buffer with random garbage, which may better help detect use after release scenarios.You could also imagine this mode offering more stringent error detection around p/invoke marshaling, SafeHandle usage, and so on.
Detecting at runtime whether we're operating in such a mode needs to be a very cheap check, as we wouldn't want the condition checking logic to show up in profiles when the app is running in normal mode.
The text was updated successfully, but these errors were encountered: