Bug 142258 - [patch] rtld(1): add ability to log or print rtld errors
Summary: [patch] rtld(1): add ability to log or print rtld errors
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 8.0-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-03 07:10 UTC by Peter Jeremy
Modified: 2017-12-31 22:29 UTC (History)
0 users

See Also:


Attachments
file.diff (3.44 KB, patch)
2010-01-03 07:10 UTC, Peter Jeremy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Jeremy 2010-01-03 07:10:00 UTC
	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()).
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2012-03-25 04:32:27 UTC
Responsible Changed
From-To: freebsd-bugs->eadler

I'll take it.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2012-11-08 20:54:35 UTC
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
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:28 UTC
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