Closed cuishuang closed 1 month ago
Thanks for the PR. Right now it indeed seems that we initialize the nodes differently. I'll further check if we don't somehow assume that first len(prof.Location)
values are there for inserting something, but currently it looks like not.
Thanks for the PR. Right now it indeed seems that we initialize the nodes differently. I'll further check if we don't somehow assume that first
len(prof.Location)
values are there for inserting something, but currently it looks like not.
I have searched many Go repositories, and this is a common issue. I am trying to solve it at the Go toolchain level
Thanks for the PR. Right now it indeed seems that we initialize the nodes differently. I'll further check if we don't somehow assume that first
len(prof.Location)
values are there for inserting something, but currently it looks like not.I have searched many Go repositories, and this is a common issue. I am trying to solve it at the Go toolchain level
Interesting! Imo it is a very good find. Indeed we have based our profiling implementation on the Go standard one, but capturing different metrics.
Thanks for the PR. Right now it indeed seems that we initialize the nodes differently. I'll further check if we don't somehow assume that first
len(prof.Location)
values are there for inserting something, but currently it looks like not.I have searched many Go repositories, and this is a common issue. I am trying to solve it at the Go toolchain level
Interesting! Imo it is a very good find. Indeed we have based our profiling implementation on the Go standard one, but capturing different metrics.
Thank you for your recognition!
I am preparing to add a detection item in go vet to avoid this issue. In the future, it may only be necessary to update the Go version, as there will be relevant detection items in the latest toolchain
I checked - in gnark this code path is never called and cannot be called without modifying the internal implementation. And even if it is initalized incorrectly, then later in selectNodesForGraph
the nil entries are filtered out. But the issue is valid in any case.
Thanks for reporting!
Description
The intention here should be to initialize a slice with a capacity of
len(prof.Location)
rather than initializing the length of this slice.The online demo: https://go.dev/play/p/q1BcVCmvidW
Type of change
How has this been tested?
How has this been benchmarked?
Checklist:
golangci-lint
does not output errors locally