Bug 1085549
Summary: | glibc: [RFE][LLNL 7.4 Bug] ldd misreports error | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Ben Woodard <woodard> | ||||
Component: | glibc | Assignee: | glibc team <glibc-bugzilla> | ||||
Status: | CLOSED UPSTREAM | QA Contact: | qe-baseos-tools-bugs | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 8.1 | CC: | ashankar, codonell, dj, fweimer, jbastian, mnewsome, pfrankli, tgummels, woodard | ||||
Target Milestone: | pre-dev-freeze | Keywords: | FutureFeature, Patch, Triaged | ||||
Target Release: | 8.1 | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2020-05-14 19:59:53 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: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1599298 | ||||||
Attachments: |
|
Description
Ben Woodard
2014-04-08 22:07:12 UTC
(In reply to Ben Woodard from comment #0) > I don't see where it sets any value that could be gleaned to figure out the > actual source of the error. We need a reduced test case that shows the problem. On glibc 2.17 or newer I see the following: [carlos@koi ~]$ ulimit -v 5000 [carlos@koi ~]$ /usr/bin/ldd /lib64/libc.so.6 /usr/bin/bash: error while loading shared libraries: libdl.so.2: failed to map segment from shared object: Cannot allocate memory Which looks exactly like what I would expect. Thus this will get fixed as our users upgrade to the next version of RHEL. To answer your technical question, glibc uses setjmp/longjmp around dlopen to handle errors and the error code returned is the error returned by the kernel and reported to the user. We are already propagating this errors for ENOMEM and passing that up via _dl_signal_error. There might be a case we missed? Oh, hrm, I wonder if the latter failure was not in ldd, but in ld.so getting reach to run itself... (In reply to Carlos O'Donell from comment #3) > Oh, hrm, I wonder if the latter failure was not in ldd, but in ld.so getting > reach to run itself... Either way, we need a test case. Created attachment 884276 [details] bz1085549.diff I like your patch, I think it will solve the problem. I was looking in the same location but got misled by the "continuable error" part in the comment preceding _dl_signal_error and didn't recognize it as the entry point which stashed away the error code. I was looking for some other "non-continuable" error that could also jump into _dl_catch_error and kind of got lost. I don't know how to make a test that would be reproducible across all possible platforms. The original bug report wasn't with ulimit: "A user on aztec3 had a process which top(1) showed to be consuming 91.8% of memory. Meanwhile another user was trying to run a simple dynamically built serial code and file(1) on the executable said: <executable>: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped but ldd(1) said in the same 10-second period: not a dynamic executable which was false information, and there was no error message such as, "Could not load the executable to review its shared objects", or some such. can we please get some [useful] error messages out of this? ---- I could probably reproduce it in virtual machine or maybe with a cgroup container but I don't know exactly how to make a very linux specific platform. err garbled my last comment: I could probably reproduce it in virtual machine or maybe with a cgroup container but I don't know exactly how to make a general reproducer like what is in the test suite both virtual machines and containers are very specific to the RHEL platform. (In reply to Ben Woodard from comment #7) > err garbled my last comment: > I could probably reproduce it in virtual machine or maybe with a cgroup > container but I don't know exactly how to make a general reproducer like > what is in the test suite both virtual machines and containers are very > specific to the RHEL platform. Use systemtap and inject a NULL return for mmmap. See: https://sourceware.org/glibc/wiki/Testing/WhiteBox I've moved this to rhel-7.2. While it's possible we could have tackled this in rhel-6, I just don't see the customer demand for the change. The tricky part is that ld.so has to return new error codes, and we want to be conservative about that in rhel-6, thus the move to rhel-7.2. Upstream commit: commit e7c8ffe4ec059da1523c093d6a240cd87d154df2 Author: Florian Weimer <fweimer> Date: Tue Oct 15 16:41:51 2019 +0200 ldd: Print "not a dynamic executable" on standard error [BZ #24150] Tested with the testsuite on x86_64-linux-gnu, and manually. *** Bug 1817111 has been marked as a duplicate of this bug. *** We are actively tracking this issue upstream here: Bug 25991 - ldd should print "insufficient memory" in certain cases https://sourceware.org/bugzilla/show_bug.cgi?id=25991 When we make upstream progress on the bug we can review the CLOSED/UPSTREAM bugs and reopen for backport consideration. The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days |