Skip to content

Conversation

@thaJeztah
Copy link
Contributor

@thaJeztah thaJeztah requested a review from a team as a code owner January 10, 2025 23:23
@thaJeztah
Copy link
Contributor Author

cc @kevpar if you have permissions to kick CI ❤️

@katiewasnothere
Copy link

@thaJeztah It looks like the CI is still failing

@thaJeztah
Copy link
Contributor Author

Yeah, I noticed; I suspect the other failures may also be with newer go versions, or updated golangci-lint.

I think they're all about integer conversion in generated code; haven't checked if they can be ignored (temporarily) or need fixing;

mode=readonly] in [] ...
  ::high file=wim/lzx/lzx.go,line=137,col=13::G115: integer overflow conversion uint32 -> uint16 (gosec)
  ::high file=wim/lzx/lzx.go,line=191,col=26::G115: integer overflow conversion uint -> uint16 (gosec)
  ::high file=wim/lzx/lzx.go,line=200,col=38::G115: integer overflow conversion int -> uint16 (gosec)
  ::high file=wim/lzx/lzx.go,line=376,col=20::G115: integer overflow conversion uint32 -> uint16 (gosec)
  ::high file=wim/lzx/lzx.go,line=377,col=20::G115: integer overflow conversion uint32 -> uint16 (gosec)
  ::high file=wim/lzx/lzx.go,line=378,col=20::G115: integer overflow conversion uint32 -> uint16 (gosec)
  ::high file=wim/lzx/lzx.go,line=526,col=51::G115: integer overflow conversion int -> uint16 (gosec)

@mat007
Copy link

mat007 commented Jan 30, 2025

I opened a separate PR to fix the «Go Generate» failure: #326

Copy link

@kiashok kiashok left a comment

Choose a reason for hiding this comment

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

CI is still failing

@kiashok
Copy link

kiashok commented Jan 30, 2025

@mat007 @thaJeztah looks like the CIs are still failing

@mat007
Copy link

mat007 commented Jan 31, 2025

Maybe these should be pinned versions? 🤷

GO_VERSION: "oldstable"
GOTESTSUM_VERSION: "latest"
GOLANGCILINT_VERSION: "latest"

@mat007
Copy link

mat007 commented Jan 31, 2025

There are 104 linting errors remaining, all due to conversions. I’ve looked at a few and they all seem to be similar, for instance

ed.writeUint16(uint16(len(values)))
raises

  ::high file=pkg/etw/fieldopt.go,line=165,col=24::G115: integer overflow conversion int -> uint16 (gosec)

What would be best here? To «nolint» them all?

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
It currently produces too many (false) positives in generated code, which
needs to be reviewed. For the time being, exclude this check.

    ::high file=wim/lzx/lzx.go,line=137,col=13::G115: integer overflow conversion uint32 -> uint16 (gosec)
    ::high file=wim/lzx/lzx.go,line=191,col=26::G115: integer overflow conversion uint -> uint16 (gosec)
    ::high file=wim/lzx/lzx.go,line=200,col=38::G115: integer overflow conversion int -> uint16 (gosec)
    ::high file=wim/lzx/lzx.go,line=376,col=20::G115: integer overflow conversion uint32 -> uint16 (gosec)
    ::high file=wim/lzx/lzx.go,line=377,col=20::G115: integer overflow conversion uint32 -> uint16 (gosec)
    ::high file=wim/lzx/lzx.go,line=378,col=20::G115: integer overflow conversion uint32 -> uint16 (gosec)
    ::high file=wim/lzx/lzx.go,line=526,col=51::G115: integer overflow conversion int -> uint16 (gosec)
    ::high file=wim/lzx/lzx.go,line=546,col=23::G115: integer overflow conversion int64 -> int32 (gosec)
    ::high file=wim/lzx/lzx.go,line=547,col=16::G115: integer overflow conversion uint32 -> int32 (gosec)
    ::high file=wim/lzx/lzx.go,line=555,col=53::G115: integer overflow conversion int32 -> uint32 (gosec)
    ::high file=wim/lzx/lzx.go,line=567,col=32::G115: integer overflow conversion int -> uint16 (gosec)
    ::high file=internal/stringbuffer/wstring.go,line=131,col=47::G115: integer overflow conversion int -> uint32 (gosec)
    ::high file=pkg/bindfilter/bind_filter.go,line=231,col=66::G115: integer overflow conversion int -> uint32 (gosec)
    ::high file=pkg/bindfilter/bind_filter.go,line=241,col=16::G115: integer overflow conversion int -> uint32 (gosec)
    ::high file=pkg/process/process.go,line=19,col=23::G115: integer overflow conversion int -> uint32 (gosec)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Comment on lines +75 to +77
gosec:
excludes:
- G115 # G115: integer overflow conversion; TODO: currently too many (false) positives in generated code that need to be verified
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a global ignore for this one for now; I think most of these are likely false positives in generated code, but would have to be reviewed by someone with more understanding of those parts of the code.

@thaJeztah
Copy link
Contributor Author

Pushed some changes, but I don't have a windows machine to verify on locally, but if someone could kick CI again ❤️ @kiashok @katiewasnothere

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.

5 participants