Skip to content
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

Memory corruption or data race access in the collector #11350

Closed
bogdandrutu opened this issue Oct 4, 2024 · 0 comments · Fixed by #11349
Closed

Memory corruption or data race access in the collector #11350

bogdandrutu opened this issue Oct 4, 2024 · 0 comments · Fixed by #11349
Labels
bug Something isn't working

Comments

@bogdandrutu
Copy link
Member

Here are the logs:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x482b20]
goroutine 1067423 [running]:
errors.(*errorString).Error(0xc0165a8340?)
	GOROOT/src/errors/errors.go:71
go.opentelemetry.io/collector/receiver/receiverhelper.(*ObsReport).endOp(0xc00aabf8c0, {0x7b71800, 0xc0165a69c0}, {0x6e1de63, 0x6}, 0x1, {0x7af0d00, 0x0}, {{0x6e24372, 0x7}})
	external/io_opentelemetry_go_collector_receiver/receiverhelper/obsreport.go:190 +0x5c2
go.opentelemetry.io/collector/receiver/receiverhelper.(*ObsReport).EndMetricsOp(...)
	external/io_opentelemetry_go_collector_receiver/receiverhelper/obsreport.go:122
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver.(*reporter).OnMetricsProcessed(0xc00a883350?, {0x7b71800?, 0xc0165a69c0?}, 0x1?, {0x7af0d00?, 0x0?})
	external/com_github_open_telemetry_opentelemetry_collector_contrib_receiver_carbonreceiver/reporter.go:81 +0x2a5
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/transport.(*tcpServer).handleConnection(0xc0027b00c0, {0x7af1fc0, 0xc007a30000}, {0x7b1cc88, 0xc00a5f3290}, {0x7b9e2d8, 0xc01515e1e0})
	external/com_github_open_telemetry_opentelemetry_collector_contrib_receiver_carbonreceiver/internal/transport/tcp_server.go:163 +0x7a8
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/transport.(*tcpServer).ListenAndServe.func1({0x7b9e2d8, 0xc01515e1e0})
	external/com_github_open_telemetry_opentelemetry_collector_contrib_receiver_carbonreceiver/internal/transport/tcp_server.go:70 +0x58
created by github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/transport.(*tcpServer).ListenAndServe in goroutine 114
	external/com_github_open_telemetry_opentelemetry_collector_contrib_receiver_carbonreceiver/internal/transport/tcp_server.go:69 +0x2fb
@bogdandrutu bogdandrutu added the bug Something isn't working label Oct 4, 2024
jackgopack4 pushed a commit to jackgopack4/opentelemetry-collector that referenced this issue Oct 8, 2024
…s Undefined Behavior (open-telemetry#11349)

The main issue is that after
open-telemetry#10910 the
err variable is shared between requests because it uses the same address
as the err defined outside the func.

This is an UB because we are overwriting memory and will cause crashes
like
open-telemetry#11335,
where the check for not nil happens then gets overwrite with nil and
crashes.

Fixes
open-telemetry#11350

---------

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant