-
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
WIP: Initial provisions for semantic Crossgen2 PDB validation #75172
Conversation
This Quality Week work item is motivated by my findings from a few months back that Crossgen2 PDB generator had been producing bogus symbol files for almost half a year due to a trivial bug and no testing in place was able to catch that. This change adds initial provisions for semantic PDB validation. In this initial commit I'm adding a new managed app PdbChecker that uses the DIA library to read a given PDB and optionally check it for the presence of given symbols. In parallel I'm making test infra changes that enable selective PDB validation support in individual tests including checks for the presence of expected symbols. This change by itself introduces rudimentary PR / CI validation of PDB files produced by Crossgen2. As next step I plan to introduce additional provisions for running this logic for all tests to be added to one of the Crossgen2-specific pipelines, and validation of PDBs produced during compilation of the framework assemblies. Thanks Tomas
Tagging subscribers to this area: @hoyosjs Issue DetailsThis Quality Week work item is motivated by my findings from a few months back that Crossgen2 PDB generator had been producing bogus symbol files for almost half a year due to a trivial bug and no testing in place was able to catch that. This change adds initial provisions for semantic PDB validation. In this initial commit I'm adding a new managed app PdbChecker that uses the DIA library to read a given PDB and optionally check it for the presence of given symbols. In parallel I'm making test infra changes that enable selective PDB validation support in individual tests including checks for the presence of expected symbols. This change by itself introduces rudimentary PR / CI validation of PDB files produced by Crossgen2. As next step I plan to introduce additional provisions for running this logic for all tests to be added to one of the Crossgen2-specific pipelines, and validation of PDBs produced during compilation of the framework assemblies. Thanks Tomas
|
Fixes: #13134 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we do these tests as unit tests like https://github.com/dotnet/runtime/tree/main/src/coreclr/tools/aot/ILCompiler.Compiler.Tests instead of layering this on top of our runtime test suite?
If not, what type of failures/bugs do we think we’ll test by having this as part of the runtime test tree as compared to having it as unit tests?
@jkoritzinsky - my thinking has been that adding the optional PDB check step after Crossgen2 compilation gives us more freedom w.r.t. extent of the testing. AFAIK the ILCompiler tests are typically small unit tests targeting particular components of the compiler like the dependency analyzer or type system using a handwritten set of individual cases to test; by being able to run the PDB check on arbitrary compiled tests and ultimately the framework we should be able to test many more PDBs that more closely resemble end customer apps including a wide variety of constructs like different generic instantiations and a broad range of executable and PDB sizes. @cshung is working on a similar mechanism using R2RDump to disassemble the various Crossgen2-produced binaries to test its robustness. If you think I misunderstood your original suggestion or if you have additional arguments to support it, please elaborate. |
FYI, my proposed change to add r2rdump is already out for PR as part of the hot-cold splitting upstreaming change here. This is considered part of the quality week work. In particular, I changed src/tests/Common/CLRTest.CrossGen.targets to include an execution of the R2RDump tool, as well as the The idea is that when some invariants ca statically checked, checking them statically is way cheaper than executing the tests many times and hoping that when the list is not sorted then sometimes the binary search might fail. @EugenioPena who authored the |
I'm just wondering how much benefit we're actually getting by just throwing new phases and types of testing at the src/tests suite instead of deliberately authoring tests to cover the various scenarios we support. Especially with a tightening test budget, we should be more deliberate about our testing instead of just throwing everything at the wall and seeing what sticks. I get that this is the easiest way to cover a wide range of scenarios, but even for that, we know the src/tests tree doesn't cover everything. The JIT team runs the libraries tests against JitStress to catch bugs that the src/tests tree doesn't. Additionally, each new test variation that we add to the runtime test scripts adds more complexity and makes them more difficult to understand to anyone that we want to onboard to the infra team. I'm fine with us starting here, but I strongly feel that we should add deliberate testing instead of just pointing at these tests and hoping that we get enough coverage that way. I also think that adding unit tests for "did we order this collection correctly" would be a better (and likely cheaper over time) test mechanism for the hot-cold splitting work as well. The asserts in |
Thanks Jeremy for your additional feedback. I think I mostly agree with you on the following accounts:
My personal feeling regarding the PDB testing from these perspectives is as follows:
For now I'm inclined to continue working on this PR unless it turns out to be somehow detrimental to overall lab perf (which I deem improbable) as it has the potential to introduce at least some PDB testing to our system that is long overdue. I can try to experiment with leveraging ILCompiler tests for this purpose but I'm afraid it's going to be at least as complicated as this proposed change for the following reasons:
Thanks Tomas |
That all makes sense, and since this isn't adding a new pipeline or scenario flavor, I think that this is okay to add. Your reasoning around hooking up the underlying platform logic for DIA also is quite convincing. Let's go with this for now and we can look back in the future to decide if changing this is worthwhile. |
@trylek, this is a year old. Should it be closed? |
Sure, makes sense, I'll reopen this once I get to figuring out the problem that makes it still fail in the lab. |
This Quality Week work item is motivated by my findings from a few months back that Crossgen2 PDB generator had been producing bogus symbol files for almost half a year due to a trivial bug and no testing in place was able to catch that. This change adds initial provisions for semantic PDB validation.
In this initial commit I'm adding a new managed app PdbChecker that uses the DIA library to read a given PDB and optionally check it for the presence of given symbols. In parallel I'm making test infra changes that enable selective PDB validation support in individual tests including checks for the presence of expected symbols.
This change by itself introduces rudimentary PR / CI validation of PDB files produced by Crossgen2. As next step I plan to introduce additional provisions for running this logic for all tests to be added to one of the Crossgen2-specific pipelines, and validation of PDBs produced during compilation of the framework assemblies.
Thanks
Tomas