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

fix: cannot lazily link against GLS accessors #127

Merged
merged 7 commits into from
Jul 15, 2024

Conversation

RomainMuller
Copy link
Contributor

@RomainMuller RomainMuller commented Jun 28, 2024

In order to be able to lazily link against GLS accessors, these need to be declared as variables instead of functions. This allows creation of bindings on the other side that can be conditionally satisffied by the existence of initialized declarations somewhere else.

Adds an integration test to demonstrate it is possible to build programs with and without the runtime modification using this technique.

Enables: DataDog/dd-trace-go#2761

JIRA: APPSEC-53654

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

Attention: Patch coverage is 27.27273% with 8 lines in your changes missing coverage. Please review.

Project coverage is 52.47%. Comparing base (66b7af5) to head (a38eb5c).

Files Patch % Lines
_integration-tests/gls/access.go 27.27% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
- Coverage   52.53%   52.47%   -0.07%     
==========================================
  Files          86       87       +1     
  Lines        4492     4503      +11     
==========================================
+ Hits         2360     2363       +3     
- Misses       1886     1892       +6     
- Partials      246      248       +2     
Flag Coverage Δ
ARM64 45.06% <ø> (ø)
Linux 54.36% <27.27%> (-0.08%) ⬇️
Windows 44.17% <ø> (ø)
X64 52.47% <27.27%> (-0.07%) ⬇️
generator 41.48% <ø> (ø)
go1.21 52.74% <27.27%> (-0.08%) ⬇️
go1.22 42.63% <27.27%> (-0.04%) ⬇️
go1.23 42.26% <27.27%> (-0.04%) ⬇️
integration 44.56% <ø> (ø)
macOS 45.06% <ø> (ø)
unit 30.86% <27.27%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from romain.marcadier/linbug to main June 28, 2024 13:40
In order to be able to lazily link against GLS accessors, these need to
be declared as variables instead of functions. This allows creation of
bindings on the other side that can be conditionally satisffied by the
existence of initialized declarations somewhere else.

Adds an integration test to demonstrate it is possible to build programs
with and without the runtime modification using this technique.
@RomainMuller RomainMuller force-pushed the romain.marcadier/gls-enablement branch from b6fc3f9 to 9fd7dde Compare July 3, 2024 12:30
eliottness and others added 3 commits July 3, 2024 15:31
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
Signed-off-by: github-actions on behalf of eliottness <github-actions@github.com>
Copy link
Member

@felixge felixge left a comment

Choose a reason for hiding this comment

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

LGTM.

My main question is: Should g.__dd_gls be automatically inherited by child goroutines like g.labels? This PR can merged without addressing this question, but I'd like this to be discussed and written down somewhere.

…enablement

# Conflicts:
#	.github/workflows/tests.yml
@RomainMuller RomainMuller added this pull request to the merge queue Jul 15, 2024
Merged via the queue into main with commit 7d606d2 Jul 15, 2024
21 checks passed
@RomainMuller RomainMuller deleted the romain.marcadier/gls-enablement branch July 15, 2024 09:23
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.

None yet

3 participants