ld-elf.so.1 records errors via _rtld_error() and can return the latest error to the application via dlerror(). If the application doesn't choose to report the error to the user, it can be almost impossible to determine why a program is failing - eg if a symbol if undefined. The attached patch provides two mechanisms to access error messages independent of the application: 1) A new environment variable LD_PRINT_ERROR causes _rtld_error() to automatically log any message. 2) Messages logged via _rtld_error() are passed to utrace() if tracing is enabled (via LD_UTRACE). How-To-Repeat: With the patch in place: server% LD_PRINT_ERROR=x sh -c 'ls ~fred' RTLD Error: Shared object "nss_files.so.1" not found, required by "sh" RTLD Error: Shared object "nss_files.so.1" not found, required by "sh" RTLD Error: Shared object "nss_dns.so.1" not found, required by "sh" RTLD Error: Shared object "nss_dns.so.1" not found, required by "sh" RTLD Error: Shared object "nss_dns.so.1" not found, required by "sh" RTLD Error: Undefined symbol "_nss_cache_cycle_prevention_function" ls: ~fred: No such file or directory server% (Note that the duplicated messages appear to be caused by multiple identical calls to _rtld_error()).
Responsible Changed From-To: freebsd-bugs->eadler I'll take it.
Responsible Changed From-To: eadler->freebsd-bugs I won't be dealing with this PR for some time, so give it back to the pool
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped