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

Write test-cases for the new crash analysis functionality #792

Open
gabrielesvelto opened this issue Jan 20, 2023 · 3 comments
Open

Write test-cases for the new crash analysis functionality #792

gabrielesvelto opened this issue Jan 20, 2023 · 3 comments

Comments

@gabrielesvelto
Copy link
Collaborator

We've added several bits of functionality to analyze crashes which include the following:

  • NULL pointer + offset detection
  • Fixing up direct jumps to non-canonical addresses
  • Fixing up indirect jumps to non-canonical addresses

We don't have test coverage for these though, and as this functionality grows we need coverage to keep it working. We relied on testing on actual production minidumps ATM but we cannot include them in the tests for obvious reasons. We should prepare some ad-hoc test-cases and add them.

@luser
Copy link
Collaborator

luser commented Jan 20, 2023

It looks like all of these changes are within op_analysis.rs, right? If so it seems like we ought to be able to write unit tests for them using the patterns in the existing tests in that file, which is a lot less effort than crafting test-specific minidumps.

@luser
Copy link
Collaborator

luser commented Jan 20, 2023

If you do want to have more thorough tests using checked-in sample minidumps, you can explore using something like sadness-generator to crash in very specific ways. I wrote a number of tests like that for Breakpad ages ago.

@gabrielesvelto
Copy link
Collaborator Author

It looks like all of these changes are within op_analysis.rs, right? If so it seems like we ought to be able to write unit tests for them using the patterns in the existing tests in that file, which is a lot less effort than crafting test-specific minidumps.

Good point, unit-tests should be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants