Bug 142258

Summary: [patch] rtld(1): add ability to log or print rtld errors
Product: Base System Reporter: Peter Jeremy <peterjeremy>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: 8.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

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