Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Sample reproducer:
"""
cat > lib.c << EOF
int TOTO = 42;
EOF
cat > toto.c << EOF
#include <stdio.h>
int main() {
printf("started\n");
int* i = 0;
*i = 42;
}
EOF
LIBS=""
for i in `seq 2000`; do
[[ -f liba$i.so ]] || gcc -shared -fPIC -o liba$i.so lib.c -D TOTO=var$i &
LIBS="${LIBS} -la$i"
done
wait
echo libs built
gcc -o toto toto.c -L. -Wl,-rpath,$(pwd) ${LIBS}
echo running binary
ulimit -c unlimited
time ./toto
"""
This will trigger systemd-coredump (forking and calling itself sd-parse-elf)
calling elf_gfetdata_rawchunk from elfutils, that does a linear search
(could be better). Then, for every chunk parsed earliersd-parse-elf calls again
elf_getdata_rawchunk, making it of O(N^2) complexity. That is already bad.
See https://sourceware.org/pipermail/elfutils-devel/2023q2/006225.html for
a sample/proposed patch for systemd-coredump, that would turn the quadratic
performance issue into a linear one. The above link also shows that while
elf_gfetdata_rawchunk could be made better, systemd-coredump is not using it
correctly.
The possible performance issue in elfutils is https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=8db849976f07046d27b4217e9ebd08d5623acc4f
Note that the systemd upstream patch seems to fix the performance issue by reducing the calls to elfutils libelf elf_getdata_rawchunk.
But there was indeed also a performance issue in elf_getdata_rawchunk. Proposed patch for that is:
https://inbox.sourceware.org/elfutils-devel/3465f95ee22b1ac433f1268f113e3813430be70a.camel@klomp.org/
We can also try to backport that one. The systemd fix seems easier though, and has a bigger performance impact.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (systemd bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2023:6640
Sample reproducer: """ cat > lib.c << EOF int TOTO = 42; EOF cat > toto.c << EOF #include <stdio.h> int main() { printf("started\n"); int* i = 0; *i = 42; } EOF LIBS="" for i in `seq 2000`; do [[ -f liba$i.so ]] || gcc -shared -fPIC -o liba$i.so lib.c -D TOTO=var$i & LIBS="${LIBS} -la$i" done wait echo libs built gcc -o toto toto.c -L. -Wl,-rpath,$(pwd) ${LIBS} echo running binary ulimit -c unlimited time ./toto """ This will trigger systemd-coredump (forking and calling itself sd-parse-elf) calling elf_gfetdata_rawchunk from elfutils, that does a linear search (could be better). Then, for every chunk parsed earliersd-parse-elf calls again elf_getdata_rawchunk, making it of O(N^2) complexity. That is already bad. See https://sourceware.org/pipermail/elfutils-devel/2023q2/006225.html for a sample/proposed patch for systemd-coredump, that would turn the quadratic performance issue into a linear one. The above link also shows that while elf_gfetdata_rawchunk could be made better, systemd-coredump is not using it correctly. The possible performance issue in elfutils is https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=8db849976f07046d27b4217e9ebd08d5623acc4f