rust-minidump / rust-minidump

Type definitions, parsing, and analysis for the minidump file format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Write test-cases for the new crash analysis functionality

gabrielesvelto opened this issue · comments

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.

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.

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.

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.