-
Notifications
You must be signed in to change notification settings - Fork 492
Fix Go 1.24 tracing issues caused by http2bufferedWriter struct changes
#2223
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| DOCKER_IMAGE_TAG=202504142133 | ||
| LINTER_IMAGE_DIGEST=0129dd524203f95a25f4343ec4499919db4434752375624a4cdbd51d463acdaf | ||
| DEV_IMAGE_DIGEST=f669bf0bc9db3ce03a48365a41e87de1a8e3e9be01bc5a1e10816412c671665e | ||
| DEV_IMAGE_WITH_EXTRAS_DIGEST=65535207f2fb805d45bb7997cf0a71abbd756cf8763db02c57838f8ee18f0c66 | ||
| DOCKER_IMAGE_TAG=202506270326 | ||
| LINTER_IMAGE_DIGEST=05aeeb210dec4b5753e55376aef7df013bb136a3ad70524fa1dff24f832b5c4e | ||
| DEV_IMAGE_DIGEST=f0a0c803733d6ad8c9104f745378ab9d7a95263a3f8882fc28f11c79c1200d1f | ||
| DEV_IMAGE_WITH_EXTRAS_DIGEST=17c8ce9c4bd4dba40cdd6e40bdee726237336dbd6581deca864ebe9302cff569 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module px.dev/pixie | ||
|
|
||
| go 1.24.0 | ||
| go 1.24.4 | ||
|
|
||
| require ( | ||
| cloud.google.com/go v0.81.0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,13 +174,25 @@ static __inline int32_t get_fd_from_conn_intf_core(struct go_interface conn_intf | |
| REQUIRE_SYMADDR(symaddrs->FD_Sysfd_offset, kInvalidFD); | ||
|
|
||
| if (conn_intf.type == symaddrs->internal_syscallConn) { | ||
| // TODO(ddelnano): The 4.14 verifier has stricter bounds checking limits when reading memory | ||
| // offsets. Without this check, the verifier rejects the program. This can be removed when 4.14 | ||
| // kernel support is dropped. | ||
| if (symaddrs->syscallConn_conn_offset < 0 || symaddrs->syscallConn_conn_offset > 1024) { | ||
| return kInvalidFD; | ||
| } | ||
|
Comment on lines
+180
to
+182
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I arbitrarily picked 1024 for this bounds check. From the opentelemetry-go-instrumentation offset file, I don't see this offset found for any version of the |
||
| REQUIRE_SYMADDR(symaddrs->syscallConn_conn_offset, kInvalidFD); | ||
| const int kSyscallConnConnOffset = 0; | ||
| bpf_probe_read(&conn_intf, sizeof(conn_intf), | ||
| conn_intf.ptr + symaddrs->syscallConn_conn_offset); | ||
| } | ||
|
|
||
| if (conn_intf.type == symaddrs->tls_Conn) { | ||
| // TODO(ddelnano): The 4.14 verifier has stricter bounds checking limits when reading memory | ||
| // offsets. Without this check, the verifier rejects the program. This can be removed when 4.14 | ||
| // kernel support is dropped. | ||
| if (symaddrs->tlsConn_conn_offset < 0 || symaddrs->tlsConn_conn_offset > 1024) { | ||
| return kInvalidFD; | ||
| } | ||
|
Comment on lines
+193
to
+195
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I arbitrarily picked 1024 for this bounds check. From the opentelemetry-go-instrumentation offset file, this offset has been 0 from Go 1.19 to 1.24 (source). |
||
| REQUIRE_SYMADDR(symaddrs->tlsConn_conn_offset, kInvalidFD); | ||
| bpf_probe_read(&conn_intf, sizeof(conn_intf), conn_intf.ptr + symaddrs->tlsConn_conn_offset); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * Copyright 2018- The Pixie Authors. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "src/common/testing/test_environment.h" | ||
| #include "src/common/testing/test_utils/container_runner.h" | ||
|
|
||
| namespace px { | ||
| namespace stirling { | ||
| namespace testing { | ||
|
|
||
| class Go1_24_GRPCClientContainer : public ContainerRunner { | ||
| public: | ||
| Go1_24_GRPCClientContainer() | ||
| : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, | ||
| kReadyMessage) {} | ||
|
|
||
| private: | ||
| static constexpr std::string_view kBazelImageTar = | ||
| "src/stirling/testing/demo_apps/go_grpc_tls_pl/client/golang_1_24_grpc_tls_client.tar"; | ||
| static constexpr std::string_view kContainerNamePrefix = "grpc_client"; | ||
| static constexpr std::string_view kReadyMessage = ""; | ||
| }; | ||
|
|
||
| } // namespace testing | ||
| } // namespace stirling | ||
| } // namespace px |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * Copyright 2018- The Pixie Authors. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "src/common/testing/test_environment.h" | ||
| #include "src/common/testing/test_utils/container_runner.h" | ||
|
|
||
| namespace px { | ||
| namespace stirling { | ||
| namespace testing { | ||
|
|
||
| class Go1_24_GRPCServerContainer : public ContainerRunner { | ||
| public: | ||
| Go1_24_GRPCServerContainer() | ||
| : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, | ||
| kReadyMessage) {} | ||
|
|
||
| static constexpr std::string_view kBazelImageTar = | ||
| "src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_24_grpc_tls_server.tar"; | ||
|
|
||
| private: | ||
| static constexpr std::string_view kContainerNamePrefix = "grpc_server"; | ||
| static constexpr std::string_view kReadyMessage = "Starting HTTP/2 server"; | ||
| }; | ||
|
|
||
| } // namespace testing | ||
| } // namespace stirling | ||
| } // namespace px |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider just dropping 4.14 support since it is EOL already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #2224 to track this.