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
VM: Missing test coverage for code GC #17614
Comments
There are two flags that control code collection: --code_collection_interval_in_us, which you can set to 0, and --always_drop_code, which causes code to be dropped regardless of the functions use count. Do you encounter the same problem when you run with those flags? Added NeedsInfo label. |
Yes, I know. None of our tests are run with these flags. |
I found this test code_collection_test.dart, but it seems that overwriting the code with a random value on GC does not make it crash as it should. |
Could you explain a bit more what you mean by "overwriting the code with a random value on GC", or maybe paste a small patch here? Thanks. |
I tried the following diff: I think the test does not actually call foo after code GC happened. Othwerwise, it would fine 123 as the code pointer. I do get a crash when running test.py with --vm-options="--code_collection_interval_in_us=0", but that flag in not on by default. Index: runtime/vm/gc_marker.cc --- runtime/vm/gc_marker.cc (revision 34110)
--- tests/standalone/io/code_collection_test.dart (revision 34110)
|
Any updates on this? |
Florian, apparently you did have a test setup that was covering the problem. Why did you not submit that version of the test? It seems that the test is not checking the return code of the dart process it spawned. Added Accepted label. |
I don't remember precisely, but I don't think I have a fixed version of the test (or I can't find it anymore). The patch set above just illustrates the issue (i.e. foo is not called after code GC) |
The test is now checking the exit code of the spawned process, and has otherwise been hardened. |
Our tests do not reliably cover code collection. E.g. I tried running tests with deliberately resetting the Function's code-pointer with a random integer on a code collection and there is no crash.
The text was updated successfully, but these errors were encountered: