Created attachment 6299 [details] proposed patch Original report: http://sourceware.org/ml/libc-alpha/2012-03/msg00080.html Reproduces with current git: commit 3ff4252677ff55a0dd4ded5b5cbccda25812ba12 Author: Paul Pluzhnikov <ppluzhnikov@google.com> Date: Fri Mar 23 09:47:03 2012 -0700 cat t.c #include <sys/types.h> #include <pwd.h> int main() { struct passwd *pw = getpwnam("root"); return 0; } gcc -g -L. -static t.c gdb -q ./a.out Reading symbols from /tmp/build-static-nss/a.out...done. (gdb) r Program received signal SIGSEGV, Segmentation fault. 0x0000000000410878 in __nss_lookup_function (ni=0x6e5f50, fct_name=0x4af0df "getpwnam_r") at nsswitch.c:460 460 size_t namlen = (5 + strlen (ni->library->name) + 1 (gdb) bt #0 0x0000000000410878 in __nss_lookup_function (ni=0x6e5f50, fct_name=0x4af0df "getpwnam_r") at nsswitch.c:460 #1 0x0000000000410a6e in __nss_lookup (ni=0x7fffffffd4e8, fct_name=0x4af0df "getpwnam_r", fct2_name=0x0, fctp=0x7fffffffd4e0) at nsswitch.c:161 #2 0x000000000040e416 in __getpwnam_r (name=0x4abf84 "root", resbuf=0x6e0ce0, buffer=0x6e5840 "", buflen=1024, result=0x7fffffffd538) at ../nss/getXXbyYY_r.c:202 #3 0x000000000040e12c in getpwnam (name=0x4abf84 "root") at ../nss/getXXbyYY.c:116 #4 0x0000000000400e76 in main () at t.c:6 (gdb) p ni.library $1 = (service_library *) 0x0 (gdb) p ni.name $2 = 0x6e5f80 "files"
Fixed by http://sourceware.org/git/?p=glibc.git;a=commit;h=62470f605ed931f88fb1993f4440d5bb02afa2b1