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

Fixing crash in dump-events #2717

Merged
merged 4 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ReleaseHistory.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SARIF Package Release History (SDK, Driver, Converters, and Multitool)
## **v4.3.3** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/v4.3.3) | [Driver](https://www.nuget.org/packages/Sarif.Driver/v4.3.3) | [Converters](https://www.nuget.org/packages/Sarif.Converters/v4.3.3) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/v4.3.3) | [Multitool Library](https://www.nuget.org/packages/Sarif.Multitool.Library/v4.3.3)
* BUG: Update `dump-events` command to be resilient in cases where the thread id changes between artifact enumeration start/stop event pairs.
* BUG: Resolve trace parsing 'InvalidOperationException' by updating 'dump-events' command to process 'PartitionInfoExtension' session event as we do 'PartitionInfoExtensionV2'.

## **v4.3.2** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/v4.3.2) | [Driver](https://www.nuget.org/packages/Sarif.Driver/v4.3.2) | [Converters](https://www.nuget.org/packages/Sarif.Converters/v4.3.2) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/v4.3.2) | [Multitool Library](https://www.nuget.org/packages/Sarif.Multitool.Library/v4.3.2)
* BUG: Correct multitool query OR logic [#2709](https://github.com/microsoft/sarif-sdk/issues/2709)
Expand Down
5 changes: 3 additions & 2 deletions src/Sarif.Driver/DumpEventsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public int Run(DumpEventsOptions options)

case "RuleFired":
{
FailureLevel level = (FailureLevel)(int)(uint)traceEvent.PayloadByName("level");
var level = (FailureLevel)(int)(uint)traceEvent.PayloadByName("level");
data1 = level;
data2 = traceEvent.PayloadByName("matchIdentifier");
ruleId = (string)traceEvent.PayloadByName(nameof(ruleId));
Expand Down Expand Up @@ -297,8 +297,9 @@ public int Run(DumpEventsOptions options)
case "ManifestData":
{
return;

}

case "EventTrace/PartitionInfoExtension":
Copy link
Member

Choose a reason for hiding this comment

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

PartitionInfoExtension

well, okey-doke. :) you collected the legacy form, it appears.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it's obvious what I did to trigger legacy form mode instead of V2, I'd love to be corrected. This is the command I'm using. [1]

[1] Sarif.PatternMatcher.cli.exe analyze ..\..\..\..\..\..\AzureDevOps\ --recurse true --max-file-size-in-kb 999999999 --output .\ado.sarif --level "Error;Warning;Note" --plugin ".\SEC101.SecurePlaintextSecretsInternal.json" --log ForceOverwrite --insert ContextRegionSnippets --etw .\ADO-Run.etl

case "EventTrace/PartitionInfoExtensionV2":
{
eventName = "SessionStarted";
Expand Down
Loading