Skip to content

Conversation

@gnosek
Copy link
Contributor

@gnosek gnosek commented Feb 11, 2025

Statically linked plugins have stricter version requirements, since they rely on the layout of the plugin_api struct. So, when loading a statically linked plugin, we enforce the plugin API to be exactly equal (up to the patch level) to the framework API.

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@poiana
Copy link
Contributor

poiana commented Feb 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gnosek

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

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

@github-actions
Copy link

github-actions bot commented Feb 11, 2025

Perf diff from master - unit tests

     0.98%     +1.43%  [.] sinsp::fetch_next_event
     3.86%     +1.31%  [.] next_event_from_file
     6.46%     -0.76%  [.] sinsp_parser::reset
     6.01%     -0.38%  [.] sinsp::next
    35.61%     -0.32%  [.] sinsp_thread_manager::create_thread_dependencies
     0.23%     +0.30%  [.] scap_next
     1.49%     +0.28%  [.] is_conversion_needed
     0.78%     -0.24%  [.] sinsp_parser::event_cleanup
     1.08%     -0.21%  [.] user_group_updater::~user_group_updater
     4.46%     -0.21%  [.] sinsp_thread_manager::find_thread

Heap diff from master - unit tests

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Benchmarks diff from master

Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark                                                         Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean                                            -0.0290         -0.0291           147           143           147           143
BM_sinsp_split_median                                          -0.0309         -0.0310           148           143           148           143
BM_sinsp_split_stddev                                          -0.3575         -0.3579             2             1             2             1
BM_sinsp_split_cv                                              -0.3383         -0.3387             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0873         +0.0872            52            56            52            56
BM_sinsp_concatenate_paths_relative_path_median                +0.0936         +0.0935            51            56            51            56
BM_sinsp_concatenate_paths_relative_path_stddev                -0.2031         -0.2030             1             1             1             1
BM_sinsp_concatenate_paths_relative_path_cv                    -0.2671         -0.2669             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0456         -0.0457            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_median                   -0.0467         -0.0468            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.3332         -0.3318             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.3014         -0.2999             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0172         +0.0171            51            52            51            52
BM_sinsp_concatenate_paths_absolute_path_median                +0.0248         +0.0248            51            52            51            52
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.7841         -0.7831             1             0             1             0
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.7878         -0.7868             0             0             0             0

@codecov
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.17%. Comparing base (98970de) to head (c062ec7).
⚠️ Report is 605 commits behind head on master.

Files with missing lines Patch % Lines
userspace/libsinsp/test/plugins/routines.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2278      +/-   ##
==========================================
+ Coverage   77.16%   77.17%   +0.01%     
==========================================
  Files         226      226              
  Lines       30161    30187      +26     
  Branches     4611     4611              
==========================================
+ Hits        23274    23298      +24     
- Misses       6887     6889       +2     
Flag Coverage Δ
libsinsp 77.17% <92.30%> (+0.01%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leogr
Copy link
Member

leogr commented Feb 11, 2025

/milestone 0.21.0

@poiana poiana added this to the 0.21.0 milestone Feb 11, 2025
@gnosek gnosek force-pushed the static-plugin-api-compat branch 2 times, most recently from 478bf4b to 6cfa7ba Compare February 17, 2025 15:22
@poiana poiana added size/XL and removed size/M labels Feb 17, 2025
@gnosek gnosek force-pushed the static-plugin-api-compat branch 3 times, most recently from dc3a941 to 815dc2d Compare February 17, 2025 16:25
@FedeDP
Copy link
Contributor

FedeDP commented Feb 18, 2025

Format code / format code 🐲 (pull_request) Failing after 30s

You should add userspace/plugin/plugin_abi.h to clang-format-ignore since it is autogenerated.

gnosek added 4 commits March 21, 2025 12:13
`extract_plugin_abi.py` parses the output from pahole describing
the `plugin_api` struct (with the offsets and sizes of all fields)
and generates a `plugin_abi.h` header with static asserts to ensure
the ABI is up to date (on x86_64/Linux).

`diff_plugin_abi.py` takes two copies of the generated plugin_abi.h
files (presumably, one from the repo and a freshly generated one)
and raises an error if:
 * a struct member has been moved/removed without ABI version bump
 * the ABI version has been increased without breaking changes

Note: adding a field at the end of the plugin_api struct does not
count as a breaking change.

Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
The current ABI is arbitrarily chosen as v3 (to match the major API
version).

Note: when making incompatible ABI changes, this file will prevent
the build from succeeding. When you're making ABI changes on purpose,
the easiest way is to remove everything but the ABI version `#define`
from plugin_abi.h and once everything builds, regenerate plugin_abi.h

(see tools/plugin_abi/extract_plugin_abi.py)

Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Introduce an explicit ABI version field to plugin_api, as well as
a size field. This allows us to explicitly detect incompatible
ABIs, but also to detect struct changes within an ABI version.

The size field is actually pretty important (maybe more than
the actual version field, as long as get_api_version can be easily
found), because it's the only way to know how big the plugin-provided
struct actually is. With plugins targeting older API versions,
we're doing a basically guaranteed out of bounds read otherwise
(if the plugin_api struct in the framework is larger than what
the plugin exports).

Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
@gnosek gnosek force-pushed the static-plugin-api-compat branch from a69bd1f to c062ec7 Compare March 21, 2025 11:13
@FedeDP
Copy link
Contributor

FedeDP commented Apr 16, 2025

Moving to next milestone, no need to hurry for the current one.
/milestone 0.22.0

@poiana poiana removed this from the 0.21.0 milestone Apr 16, 2025
@poiana poiana added this to the 0.22.0 milestone Apr 16, 2025
@poiana
Copy link
Contributor

poiana commented Jul 15, 2025

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

@leogr
Copy link
Member

leogr commented Jul 15, 2025

any update on this? 🤔

@poiana
Copy link
Contributor

poiana commented Aug 14, 2025

Stale issues rot after 30d of inactivity.

Mark the issue as fresh with /remove-lifecycle rotten.

Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle rotten

@leogr
Copy link
Member

leogr commented Aug 18, 2025

/remove-lifecycle rotten

@leogr
Copy link
Member

leogr commented Sep 2, 2025

/milestone 0.23.0

@poiana poiana modified the milestones: 0.22.0, 0.23.0 Sep 2, 2025
@poiana
Copy link
Contributor

poiana commented Dec 1, 2025

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

@ekoops
Copy link
Contributor

ekoops commented Dec 19, 2025

/remove-lifecycle stale

@ekoops ekoops modified the milestones: 0.23.0, 0.24.0 Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

5 participants