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

support stripped binaries built wit CGO_ENABLED #1641

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

RonFed
Copy link
Contributor

@RonFed RonFed commented Jan 18, 2025

Resolves #1637 and improves our support for stripped binaries.

  • The .gosymtab section is not required to parse the pcln table as stated in https://pkg.go.dev/debug/gosym#NewTable
  • When calling NewLineTable, we need to pass the value of runtime.text symbol from the instrumented binary. For binaries not including C code, this is the same as the start of the .text section. However for those that use C code, this value will differ. This caused incorrect offsets to get probed when instrumenting a stripped binary that uses a CGO lib. An example of this is our DB example and test which uses the go-sqlite3 library.

@RonFed RonFed marked this pull request as ready for review January 19, 2025 11:06
@RonFed RonFed requested a review from a team as a code owner January 19, 2025 11:06
.PHONY: sample-app/nethttp sample-app/gin sample-app/databasesql sample-app/nethttp-custom sample-app/otelglobal sample-app/autosdk sample-app/kafka-go
.PHONY: sample-app/%
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not expanded in a .PHONY target. It removes the functionality and completion of this target. It should not be changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current version of the Makefile is not working for me for the fixture targets. The sample-app targets are not executed.

make sample-app/nethttp
make: Nothing to be done for `sample-app/nethttp'.

This change fixed that, I'm not sure why.

Copy link
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Looks great!

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.

"error":"Malformed version: (devel)","dependency"
3 participants