[Auditbeat] Cherry-pick #11628 to 6.7: Package: Nullify Librpm's rpmsqEnable #11665
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #11628 to 6.7 branch. Original message:
We've had a number of problems with Librpm's use of signal traps (#10633). We've tried to fix it by using Librpm functions to disable them (#10694), but there is still the occasional test failure that seems related to it. I've also seen it happen at least once locally.
Now I've started testing the dataset on OpenSUSE and found our fix prevents it from working at all. The Python system test will reliably fail, with the Auditbeat test process shown as terminated by an uncaught
SIGTERM
. If I remove our disabling logic it works, but only on OpenSUSE, and again not on CentOS. I don't know exactly what in Librpm or our use of it is causing the behavior on OpenSUSE, my assumption is that something is going wrong with how we try to unset the signal traps, with the original ones not being restored.So I'm proposing a more radical solution - overriding the
rpmsqEnable
function in Librpm that sets and unsets signal traps. This is possible since wedlopen/dlsym
the library into the process, so any functions that are already defined will be used instead of what the library comes with. In a way, this is exactly what therpmsqSetInterruptSafety
function does in newer versions of Librpm (see rpm-software-management/rpm@56f49d7). It is also what gdb did with this patch following their bug report. I should have investigated their fix more closely the last time around.Hopefully, this will eliminate the residual test failures.
I'll open another PR to enable the OS family
suse
for the package dataset that depends on this.