-
Notifications
You must be signed in to change notification settings - Fork 844
Fix Rocky Linux 8 ASAN plugin tests by suppressing dynamic linker leaks #12675
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
3ae263f to
3558969
Compare
|
Another option is to just compile these unit tests with fast_unwind_on_malloc=0. I will look into the performance differences. |
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.
Pull Request Overview
This PR fixes false-positive memory leak failures in three Rocky Linux 8 unit tests (test_PluginDso, test_PluginFactory, and test_RemapPluginInfo) when running with ASAN enabled. The issue stems from ASAN's fast unwinding not capturing deep enough stack frames to match existing suppressions. The fix adds a targeted suppression for the dynamic linker itself.
Key Changes:
- Adds
leak:ld-linux-x86-64.sosuppression to catch leaks at the dynamic linker level - Reformats existing
leak:call_initsuppression (moved to its own line) - Documents the Rocky Linux 8-specific issue with inline comments
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| leak:call_init | ||
| # On Rocky Linux 8, ASAN reports leaks from the dynamic linker during dlopen | ||
| # These are false positives as we properly call dlclose for each dlopen | ||
| leak:ld-linux-x86-64.so |
Copilot
AI
Nov 19, 2025
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.
The suppression pattern leak:ld-linux-x86-64.so is architecture-specific (x86-64) and may not work on other architectures like ARM64 or i386. Consider using a more portable pattern like leak:ld-linux or documenting that this suppression is x86-64 specific. If Rocky Linux 8 is only supported on x86-64 in CI, this may be acceptable.
| leak:ld-linux-x86-64.so | |
| leak:ld-linux |
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.
It is better to narrow the scope and only fix CI that is x86.
|
[approve ci] |
|
I tried using fast_unwind_on_malloc=0 and it didn't go well. I was getting segfaults and I wasn't getting the symbol names back. |
Add leak suppression for ld-linux-x86-64.so to fix false positive memory leak reports on Rocky Linux 8 when running plugin tests with ASAN enabled. The tests properly call dlclose() for each dlopen(), but ASAN's instrumentation of the dynamic linker reports false positive leaks during plugin initialization. Fixes: test_PluginDso, test_PluginFactory, test_RemapPluginInfo on Rocky Linux 8
3558969 to
819f760
Compare
|
I was able to fix the segfaults, it was a dependency issue that other cmake targets to be build fist. However, with rockylinux 8 we would need to use an external symbolizer to convert the address numbers to symbol names. So the best approach is the modify the suppression file, like this PR does. |
|
[approve ci autest 0] |
Problem
Three unit tests were failing on Rocky Linux 8 with ASAN enabled in CI:
test_PluginDsotest_PluginFactorytest_RemapPluginInfoThe tests were passing all their assertions, but LeakSanitizer was reporting false positive memory leaks from
dlopencalls, causing the tests to fail.Root Cause
On Rocky Linux 8, ASAN's instrumentation of the dynamic linker (
ld-linux-x86-64.so) causes it to report leaks during plugin initialization viadlopen, even though the code properly callsdlclose()for each handle.The leak backtrace shows:
Why Existing Suppressions Didn't Work
The suppression file already had
leak:PluginDso::load, but it wasn't catching these leaks because:PluginDso::loadis at frame Fix list templating #16, so it's not visible in the fast unwindfast_unwind_on_malloc=0would allow the existing suppression to work, but has significant performance overhead. I also had problems with the test segfaulting withfast_unwind_on_malloc=0.Solution
Added
leak:ld-linux-x86-64.soto the suppression file, which catches the leak at frame #4 where the dynamic linker appears in the shallow stack trace.Testing
Tested in Rocky Linux 8 Docker container with ASAN enabled:
Fixes CI failures: https://ci.trafficserver.apache.org/job/master/job/os_build/46636/console