Skip to content

Restore legacy Go version detection for binaries built w/ 1.11 and earlier#2225

Merged
ddelnano merged 3 commits intopixie-io:mainfrom
ddelnano:ddelnano/fix-version-detection-for-go-1.11-and-earlier
Jul 9, 2025
Merged

Restore legacy Go version detection for binaries built w/ 1.11 and earlier#2225
ddelnano merged 3 commits intopixie-io:mainfrom
ddelnano:ddelnano/fix-version-detection-for-go-1.11-and-earlier

Conversation

@ddelnano
Copy link
Copy Markdown
Member

@ddelnano ddelnano commented Jul 3, 2025

Summary: Restore legacy Go version detection for binaries built w/ 1.11 and earlier

This PR reintroduces our original Go version detection logic as a fallback mechanism for edge cases. This was previously removed because it was the source of several bugs:

  1. It caused huge memory allocations for 32-bit binaries
  2. It didn't work for Go 1.20.5 and later

We migrated the version detection to an implementation that was introduced in Go 1.12, supports 32 and 64 bit binaries and is aligned with the Go toolchain. While it's unlikely that end users are running 32 bit, pre Go 1.12 binaries, our existing ProductCatalogServiceTraceTest.Basic test case does.

I opted to test the 32-bit case's failure instead of fixing it because I believe fixing it will require more extensive testing on the eBPF side. The memory allocations are guaranteed to be bounded now, so this is safe.

Relevant Issues: #2210

Type of change: /kind bugfix

Test Plan: Existing and new test cases pass

ddelnano added 2 commits July 8, 2025 15:58
…rlier

Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
@ddelnano ddelnano force-pushed the ddelnano/fix-version-detection-for-go-1.11-and-earlier branch from 713465d to dc549f4 Compare July 8, 2025 15:59
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
@ddelnano ddelnano force-pushed the ddelnano/fix-version-detection-for-go-1.11-and-earlier branch from b648e83 to 443daa3 Compare July 9, 2025 16:39
@ddelnano ddelnano merged commit cce2254 into pixie-io:main Jul 9, 2025
40 of 42 checks passed
@ddelnano ddelnano deleted the ddelnano/fix-version-detection-for-go-1.11-and-earlier branch July 9, 2025 18:01
ddelnano added a commit to k8sstormcenter/pixie that referenced this pull request Feb 25, 2026
…rlier (pixie-io#2225)

Summary: Restore legacy Go version detection for binaries built w/ 1.11
and earlier

This PR reintroduces our original Go version detection logic as a
fallback mechanism for edge cases. This was previously removed because
it was the source of several bugs:

1. It caused huge memory allocations for 32-bit binaries
2. It didn't work for Go 1.20.5 and later

We migrated the version detection to an implementation that was
introduced in Go 1.12, supports 32 and 64 bit binaries and is aligned
with the Go toolchain. While it's unlikely that end users are running 32
bit, pre Go 1.12 binaries, our existing
[ProductCatalogServiceTraceTest.Basic](https://github.com/pixie-io/pixie/blob/3cc2cc19f5a15619d41d59a88b35037f20bcea88/src/stirling/source_connectors/socket_tracer/http2_trace_bpf_test.cc#L186-L190)
test case does.

I opted to test the 32-bit case's failure instead of fixing it because I
believe fixing it will require more extensive testing on the eBPF side.
The memory allocations are guaranteed to be bounded now, so this is
safe.

Relevant Issues: pixie-io#2210

Type of change: /kind bugfix

Test Plan: Existing and new test cases pass

---------

Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
ddelnano added a commit to k8sstormcenter/pixie that referenced this pull request Feb 25, 2026
…rlier (pixie-io#2225)

Summary: Restore legacy Go version detection for binaries built w/ 1.11
and earlier

This PR reintroduces our original Go version detection logic as a
fallback mechanism for edge cases. This was previously removed because
it was the source of several bugs:

1. It caused huge memory allocations for 32-bit binaries
2. It didn't work for Go 1.20.5 and later

We migrated the version detection to an implementation that was
introduced in Go 1.12, supports 32 and 64 bit binaries and is aligned
with the Go toolchain. While it's unlikely that end users are running 32
bit, pre Go 1.12 binaries, our existing
[ProductCatalogServiceTraceTest.Basic](https://github.com/pixie-io/pixie/blob/3cc2cc19f5a15619d41d59a88b35037f20bcea88/src/stirling/source_connectors/socket_tracer/http2_trace_bpf_test.cc#L186-L190)
test case does.

I opted to test the 32-bit case's failure instead of fixing it because I
believe fixing it will require more extensive testing on the eBPF side.
The memory allocations are guaranteed to be bounded now, so this is
safe.

Relevant Issues: pixie-io#2210

Type of change: /kind bugfix

Test Plan: Existing and new test cases pass

---------

Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
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.

2 participants