This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/13895] New: SIGSEGV in __nss_lookup_function for static binary when configured with --enable-static-nss


http://sourceware.org/bugzilla/show_bug.cgi?id=13895

             Bug #: 13895
           Summary: SIGSEGV in __nss_lookup_function for static binary
                    when configured with --enable-static-nss
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: unassigned@sourceware.org
        ReportedBy: ppluzhnikov@google.com
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


Created attachment 6299
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6299
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"

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]