Skip to content
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

Closed
GrabYourPitchforks opened this issue Mar 27, 2018 · 4 comments
Closed

Introduce concept of "test" mode for apps #10042

GrabYourPitchforks opened this issue Mar 27, 2018 · 4 comments
Labels
area-Meta design-discussion Ongoing discussion about design without consensus

Comments

@GrabYourPitchforks
Copy link
Member

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.

@pakrym
Copy link
Contributor

pakrym commented Mar 27, 2018

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.

@GrabYourPitchforks
Copy link
Member Author

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.

Copy link
Contributor

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.

@dotnet-policy-service dotnet-policy-service bot added backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity labels Dec 26, 2024
Copy link
Contributor

This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

@dotnet-policy-service dotnet-policy-service bot removed this from the Future milestone Jan 9, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 2025
@dotnet-policy-service dotnet-policy-service bot removed no-recent-activity backlog-cleanup-candidate An inactive issue that has been marked for automated closure. labels Feb 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Meta design-discussion Ongoing discussion about design without consensus
Projects
No open projects
Development

No branches or pull requests

5 participants