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(pkg/cgo): solve data races when assigning/deleting and accessing handles #85

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

jasondellaluce
Copy link
Contributor

What type of PR is this?

/kind bug

/kind cleanup

Any specific area of the project related to this PR?

/area plugin-sdk

What this PR does / why we need it:

Due to how shared object loading works in Linux and in the falcosecurity libs, I discovered that concurrent (and legitimate, as per generalized non-Falco libs consumers) operations to plugins written in Go led to panics and segfaults caused by data races in case of many workers.

So far my research led to discovering that this kind of issues disappear when re-working the cgo.Handle primitives to support proper synchronization.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix(pkg/cgo): solve data races when assigning/deleting and accessing handles

Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

Good catch! 👍

@poiana
Copy link

poiana commented Jun 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jasondellaluce, leogr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [jasondellaluce,leogr]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana
Copy link

poiana commented Jun 11, 2024

LGTM label has been added.

Git tree hash: f587a2dd6637a357c6ac975c28939f730ce508ef

@poiana poiana merged commit 40ff9af into main Jun 11, 2024
3 checks passed
@poiana poiana deleted the fix/data-races-in-sdk branch June 11, 2024 13:04
@jasondellaluce jasondellaluce restored the fix/data-races-in-sdk branch June 11, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants