-
Notifications
You must be signed in to change notification settings - Fork 167
Fix spurious appsec munmaps in ZTS mode #3590
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
Conversation
Once any ZTS thread shuts down, _shared_state is munmap'ped(). It will be unmapped and any other later mapping may happen at that same place through bad luck. If another thread shuts down, it will munmap this again and accesses to the later mapping are now crashing. Signed-off-by: Bob Weinand <[email protected]>
1dac74b to
367c476
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In essence, the previous code was doing a per-thread shutdown, but this mapping is global, not thread-scoped. The fix is clear and makes sense, unlike the symptoms observed while debugging this thing. If this fix is not totally right, it seems clearly in the right direction.
|
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (80.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #3590 +/- ##
==========================================
- Coverage 62.00% 61.91% -0.09%
==========================================
Files 140 140
Lines 13311 13312 +1
Branches 1762 1762
==========================================
- Hits 8253 8242 -11
- Misses 4270 4280 +10
- Partials 788 790 +2
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Benchmarks [ appsec ]Benchmark execution time: 2026-01-20 18:47:07 Comparing candidate commit 367c476 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. |
Once any ZTS thread shuts down, _shared_state is munmap'ped(). It will be unmapped and any other later mapping may happen at that same place through bad luck. If another thread shuts down, it will munmap this again and accesses to the later mapping are now crashing.
Fixes #3511.