Closed c-kruse closed 1 year ago
Change https://go.dev/cl/514036 mentions this issue: debug/buildinfo: fix module info not read when buildinfo section length exceeds 64KB
$ wc -c otelcol-sumo-0.81.0-sumo-0-linux_amd64
186216448 otelcol-sumo-0.81.0-sumo-0-linux_amd64
$ grep -a -b -o -F 'Go buildinf:' otelcol-sumo-0.81.0-sumo-0-linux_amd64
183476226:Go buildinf:
Its unfortunate that DataStart() API does not return segment size (maybe its not known in some platforms though hard to imagine) - otherwise it could be used as a limit instead of 64k https://github.com/golang/go/blob/457721cd52008146561c80d686ce1bb18285fe99/src/debug/buildinfo/buildinfo.go#L151-L157
Change https://go.dev/cl/514075 mentions this issue: debug/buildinfo: read full data segment to lookup buildinfo magic
For the record, it looks like the problem is that the .go.buildinfo
section is 66144 bytes, whereas we only read 65536 bytes.
For the record, it looks like the problem is that the .go.buildinfo section is 66144 bytes
yes:
$ objdump -h otelcol-sumo-0.81.0-sumo-0-linux_amd64
otelcol-sumo-0.81.0-sumo-0-linux_amd64: file format elf64-x86-64
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 04d2f438 0000000000401000 0000000000401000 00001000 2**5
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .rodata 02c242f5 0000000005131000 0000000005131000 04d31000 2**5
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .typelink 00054518 0000000007d553a0 0000000007d553a0 079553a0 2**5
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .itablink 00017e88 0000000007da98c0 0000000007da98c0 079a98c0 2**5
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .gosymtab 00000000 0000000007dc1748 0000000007dc1748 079c1748 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .gopclntab 03537c68 0000000007dc1760 0000000007dc1760 079c1760 2**5
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .go.buildinfo 00010260 000000000b2fa000 000000000b2fa000 0aefa000 2**4
CONTENTS, ALLOC, LOAD, DATA
7 .noptrdata 001ebdb2 000000000b30a260 000000000b30a260 0af0a260 2**5
CONTENTS, ALLOC, LOAD, DATA
8 .data 000a08d0 000000000b4f6020 000000000b4f6020 0b0f6020 2**5
CONTENTS, ALLOC, LOAD, DATA
9 .bss 000698e0 000000000b596900 000000000b596900 0b196900 2**5
ALLOC
10 .noptrbss 000163d0 000000000b6001e0 000000000b6001e0 0b2001e0 2**5
ALLOC
11 .note.go.buildid 00000064 0000000000400f9c 0000000000400f9c 00000f9c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Y
What operating system and processor architecture are you using (
go env
)?linux amd64
go env
OutputWhat did you do?
When running
go version -m
on the latest release of the sumologic open telemetry collector distro.ex:
What did you expect to see?
I had expected to see module information as I did for the previous release. E.g.
What did you see instead?
A condensed buildinfo summary with only the go build version.
otelcol-sumo-0.81.0-sumo-0-linux_amd64: go1.20.5
Apparent Root Cause
Digging into the suspect binary it appears that the module info expected is embedded in the
.go.buildinfo
section. It looks to me like there could be an oversight here - where we read the first 64KB of the section, then give up when the encoded module info blob length exceeds the bounds.