Commit cce2254
authored
Restore legacy Go version detection for binaries built w/ 1.11 and earlier (#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: #2210
Type of change: /kind bugfix
Test Plan: Existing and new test cases pass
---------
Signed-off-by: Dom Del Nano <[email protected]>1 parent 3a7e3fe commit cce2254
File tree
5 files changed
+74
-1
lines changed- src/stirling/obj_tools
- testdata/go
5 files changed
+74
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
71 | 106 | | |
72 | 107 | | |
73 | 108 | | |
| |||
161 | 196 | | |
162 | 197 | | |
163 | 198 | | |
164 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
165 | 207 | | |
166 | 208 | | |
167 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
186 | 189 | | |
187 | 190 | | |
188 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
189 | 210 | | |
190 | 211 | | |
191 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| |||
Binary file not shown.
0 commit comments