There is a compatibility issue with older versions of google.golang.org/genproto/googleapis/rpc/status in the offset_results.json file #1226
Description
The google.golang.org/genproto/googleapis/rpc/status
is defined within the google.golang.org/genproto
package. Although it is included by the google.golang.org/grpc
package during program compilation, there is no explicit definition of the google.golang.org/genproto
version. However, as google.golang.org/genproto
is a dependency, its version information is included in the Go ELF binary file at compile time and can be retrieved by parsing Go module data.
Starting from google.golang.org/grpc v1.15.0
, go.mod
was introduced, so regardless of when the source code is compiled, the version pulled in is fixed.
However, for binaries compiled with google.golang.org/grpc v1.8.0 - v1.14.0
, due to the lack of a go.mod
file, the actual version of google.golang.org/genproto
pulled in during compilation is the latest release at that time.
For example:
If an application requiring google.golang.org/grpc v1.14.0
is compiled in 2024, the version pulled in might be google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38
.
If the same code is compiled in 2023, the version pulled in might be google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98
.
This can lead to mismatches in the offsets of google.golang.org/genproto/googleapis/rpc/status
between offset_results.json
and the actual binary for grpc v1.8.0 - v1.14.0
.
Consider the following suggestions please:
-
Retain the
google.golang.org/genproto/googleapis/rpc/status
version definition in thegoogle.golang.org/grpc
group, but set the offset values forv1.8.0 - v1.14.0
tonull
to ensure that incorrect offsets aren’t read at runtime. -
Move the version definition for
google.golang.org/genproto/googleapis/rpc/status
to a newgoogle.golang.org/genproto
group, allowing the correct offsets to be obtained using the version information fromgoogle.golang.org/genproto
.