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

Fix BA2027.EnableSourceLink cause ExceptionLoadingPdb #988

Merged
merged 3 commits into from
Mar 29, 2024

Conversation

shaopeng-gh
Copy link
Collaborator

@shaopeng-gh shaopeng-gh commented Feb 29, 2024

Fix BA2027.EnableSourceLink unexpectedly cause ExceptionLoadingPdb error when the PDB file is missing.

Please see details in #986

The cause is this PR [WIP] Add BA2027.EnableSourceLink
missed setting LogPdbLoadException => false. (Pattern found from other rules)
I used the get history version to locate this exact PR changed the behavior.

Fix: add it, and add tests to prevent future new rules missing the same property set.

Additionally, I have question about other existing rules that have this LogPdbLoadException as true.
Are they bugs? What condition we want this true / false? This is a question about original design when we introduce this flag.
Let me know I can create a bug if need fixes.

@@ -18,6 +18,7 @@
* DEP: Update `Sarif.Sdk` submodule from [bc8cb57 to fd6e615](https://github.com/microsoft/sarif-sdk/compare/bc8cb57...fd6e615). Reference [SARIF SDK Release History](https://github.com/microsoft/sarif-sdk/blob/fd6e615/ReleaseHistory.md).
* NEW: Add `--disable-telemetry` argument to disable telemetry collection.
* BUG: Fix `ERR998.ExceptionInAnalyze`: `InvalidOperationException: Unrecognized crypto HRESULT: 0x80096011` for check `BA2022.SignSecurely` when the signature is malformed, by adding missing error code to error description mappings. [969](https://github.com/microsoft/binskim/pull/969)
* BUG: Fix `BA2027.EnableSourceLink` unexpectedly cause `ExceptionLoadingPdb` error when the PDB file is missing. [988](https://github.com/microsoft/binskim/pull/988)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Change "cause" to "causes"
  • Add a period to the end of the line after the 988 link. The BUG above is also missing a period at the end after 969.

Copy link

@stacywray stacywray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting a few minor changes:

  • Change "cause" to "causes".
  • Add period at end of line. The BUG immediately above also needs a period at the end of the line.

@shaopeng-gh shaopeng-gh self-assigned this Feb 29, 2024
Copy link

@stacywray stacywray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

{
public class RulePropertyTests
{
private static readonly string[] ExpectedLogPdbLoadExceptionRules = new string[]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see PR desc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old test was based on BA2027 throw that error, now that is fixed, so need to change to another file triggered by other rules.

@michaelcfanning michaelcfanning merged commit c135a49 into main Mar 29, 2024
3 of 5 checks passed
@michaelcfanning michaelcfanning deleted the users/shaopeng-gh/nopdberror branch March 29, 2024 23:37
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

Successfully merging this pull request may close these issues.

3 participants