Skip to content

Feature/Bug Flag parsing from csv issues #496

@Tbusk

Description

@Tbusk

What Happened?

While creating some tests, I noticed that the parse flags method fails for the following cases:

k8,"Opteron, Athlon64"
avx512_bitalg,"Support for VPOPCNT[B,W] and VPSHUF-BITQMB instructions"
fsgsbase,"RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions"
msbds_only,CPU is only affected by the  MSDBS variant of BUG_MDS

They should be cleaned and result as

k8 -> Opteron, Athlon64
avx512_bitalg -> Support for VPOPCNT[B,W] and VPSHUF-BITQMB instructions
fsgsbase -> RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions
msbds_only -> CPU is only affected by the MSDBS variant of BUG_MDS // note extra space in between

You can also view the parsing failure in the popup in features/bugs

Image

To fix this, additional replace () methods will need to be called to get rid of extra spaces and double quotes as well as the string split method needs to be replaced with a manual spit into two sections based on the first comma position.

Steps to Reproduce

  • Print out what is stored in a new Monitor.CPU object as cpu.features.values and compare it to what is stored in the csv files.
  • Find the features/bugs specified above and check for values that contain commas inside double quotes.
  • There is a test in https://github.com/Tbusk/monitor/tree/feature/tests that can be ran to show this

Expected Behavior

The parsing should account for only one comma and remove extra spaces and double quotes.

OS Version

Other Linux

OS Architecture

amd64 (on most hardwares)

Session Type

Secure Session (Wayland)

Software Version

Compiled from git

Log Output

Hardware Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions