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 abort() call on appsec helper unload #2900

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Conversation

cataphract
Copy link
Contributor

Description

runner was living too long (until shared library unload) due to a static shared pointer used for RC notifications. Plus, the destructor would have a call to shared_for_this(), which would try to revive the shared pointer being destroyed, which raise an exception due to there being no shared pointer anymore. We would catch this and abort().

Instead, destroy the runner earlier (when its own thread finishes). Reset the static shared pointer just before that.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.20%. Comparing base (f5c5729) to head (5aeceb1).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2900      +/-   ##
============================================
- Coverage     78.21%   78.20%   -0.02%     
  Complexity     2526     2526              
============================================
  Files           173      173              
  Lines         18749    18749              
  Branches        988      988              
============================================
- Hits          14664    14662       -2     
- Misses         3544     3546       +2     
  Partials        541      541              
Flag Coverage Δ
appsec-extension 68.37% <ø> (ø)
tracer-extension 78.10% <ø> (ø)
tracer-php 82.07% <ø> (-0.02%) ⬇️

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

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5c5729...5aeceb1. Read the comment docs.

@pr-commenter
Copy link

pr-commenter bot commented Oct 17, 2024

Benchmarks [ appsec ]

Benchmark execution time: 2024-10-17 11:42:48

Comparing candidate commit 5aeceb1 in PR branch glopes/abort-on-shutdown with baseline commit f5c5729 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics.

@cataphract cataphract force-pushed the glopes/abort-on-shutdown branch from 5aeceb1 to 38e3959 Compare October 18, 2024 16:36
runner was living too long (until shared library unload) due to a static
shared pointer used for RC notifications. Plus, the destructor would
have a call to shared_for_this(), which would try to revive the shared
pointer being destroyed, which raise an exception due to there being no
shared pointer anymore. We would catch this and abort().

Instead, destroy the runner earlier (when its own thread finishes).
Reset the static shared pointer just before that.
@cataphract cataphract force-pushed the glopes/abort-on-shutdown branch from 38e3959 to aec4aed Compare October 18, 2024 16:37
@cataphract cataphract merged commit 16b0255 into master Oct 18, 2024
11 of 15 checks passed
@cataphract cataphract deleted the glopes/abort-on-shutdown branch October 18, 2024 16:37
@github-actions github-actions bot added the profiling Relates to the Continuous Profiler label Oct 18, 2024
@github-actions github-actions bot added this to the 1.5.0 milestone Oct 18, 2024
@bwoebi bwoebi modified the milestones: 1.5.0, 1.4.2 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:asm profiling Relates to the Continuous Profiler tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants