libs icon indicating copy to clipboard operation
libs copied to clipboard

wip: fix(plugin): enforce strict versioning for static plugins

Open gnosek opened this issue 1 year ago • 12 comments

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

gnosek avatar Feb 11 '25 10:02 gnosek

[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

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

poiana avatar Feb 11 '25 10:02 poiana

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

github-actions[bot] avatar Feb 11 '25 10:02 github-actions[bot]

Codecov Report

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

Files with missing lines Patch % Lines
userspace/libsinsp/test/plugins/routines.cpp 0.00% 2 Missing :warning:
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%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Feb 11 '25 10:02 codecov[bot]

/milestone 0.21.0

leogr avatar Feb 11 '25 10:02 leogr

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.

FedeDP avatar Feb 18 '25 08:02 FedeDP

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

FedeDP avatar Apr 16 '25 06:04 FedeDP

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

poiana avatar Jul 15 '25 10:07 poiana

any update on this? :thinking:

leogr avatar Jul 15 '25 10:07 leogr

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

poiana avatar Aug 14 '25 16:08 poiana

/remove-lifecycle rotten

leogr avatar Aug 18 '25 13:08 leogr

/milestone 0.23.0

leogr avatar Sep 02 '25 08:09 leogr

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

poiana avatar Dec 01 '25 10:12 poiana