Bug 2065675
| Summary: | glibc: Memory leak in _dl_find_object_update | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Pavel Březina <pbrezina> | ||||
| Component: | glibc | Assignee: | Florian Weimer <fweimer> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 36 | CC: | aoliva, arjun, codonell, dj, fweimer, law, mcermak, mfabian, pfrankli, rth, sipoyare | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | glibc-2.35-5.fc36 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2022-05-10 13:11:35 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Pavel Březina
2022-03-18 12:57:26 UTC
Huh. I see one obvious leak:
diff --git a/elf/dl-find_object.c b/elf/dl-find_object.c
index 2b8df2fd67..b9094a0e17 100644
--- a/elf/dl-find_object.c
+++ b/elf/dl-find_object.c
@@ -798,7 +798,10 @@ _dl_find_object_update (struct link_map *new_map)
map_array[i++] = l;
}
if (count == 0)
- return true;
+ {
+ free (map_array);
+ return true;
+ }
_dl_find_object_link_map_sort (map_array, count);
bool ok = _dl_find_object_update_1 (map_array, count);
However, I'm not quite sure how to reach this code path. Can you put a conditional breakpoint on the if statement for the count == 0 condition, and see what new_map->l_name is at this point? Thanks.
Hi, you can get it in gdb like this: # prepare environment $ podman run --cap-add SYS_ADMIN --cap-add SYS_PTRACE --security-opt seccomp=unconfined --name test --detach quay.io/sssd/ci-client-devel:fedora-36 && podman exec -u ci --workdir /home/ci test git clone https://github.com/SSSD/sssd && podman exec -u ci --workdir /home/ci/sssd test sudo ./contrib/ci/run --deps-only && podman exec -u ci --workdir /home/ci/sssd test /bin/bash -c 'autoreconf -if && ./configure && make && make check' # run test in valgrind $ podman exec -u ci --workdir /home/ci/sssd test valgrind --leak-check=full ./dlopen-tests # get gdb $ podman exec -u ci --workdir /home/ci/sssd test /bin/bash -c 'CK_FORK=no gdb ./dlopen-tests' The last command needs to be: podman exec -i -t -u ci --workdir /home/ci/sssd test /bin/bash -c 'CK_FORK=no gdb ./dlopen-tests' And it only works in SELinux permissive mode. Nevertheless, I have convinced myself that I know understand what is going on, despite unrelated debugging troubles (bug 2074993). I'll fix this upstream and backport. FEDORA-2022-35a1f6fbb0 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-35a1f6fbb0 FEDORA-2022-35a1f6fbb0 has been pushed to the Fedora 36 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-35a1f6fbb0` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-35a1f6fbb0 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2022-35a1f6fbb0 has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report. |