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/12491] Calling getpwuid in a statically linked program should return an error, not a seg fault.


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

--- Comment #1 from Geir Johansen <geir at cray dot com> 2011-03-04 23:55:15 UTC ---
Here is where the problem looks like it starts to occur:

(gdb) x/30i 0x00000000004284c2
0x4284c2 <get_mapping+674>:    je     0x4284d3 <get_mapping+691>
0x4284c4 <get_mapping+676>:    mov    $0xffffffff,%eax
0x4284c9 <get_mapping+681>:    lock xadd %eax,0x18(%rdi)
0x4284ce <get_mapping+686>:    sub    $0x1,%eax
0x4284d1 <get_mapping+689>:    je     0x428500 <get_mapping+736>
0x4284d3 <get_mapping+691>:    lea    -0x28(%rbp),%rsp
0x4284d7 <get_mapping+695>:    mov    %rbx,%rax
0x4284da <get_mapping+698>:    pop    %rbx
0x4284db <get_mapping+699>:    pop    %r12
0x4284dd <get_mapping+701>:    pop    %r13
0x4284df <get_mapping+703>:    pop    %r14
0x4284e1 <get_mapping+705>:    pop    %r15
0x4284e3 <get_mapping+707>:    leaveq 
0x4284e4 <get_mapping+708>:    retq   
0x4284e5 <get_mapping+709>:    nopl   (%rax)
0x4284e8 <get_mapping+712>:    mov    -0x144(%rbp),%edi
0x4284ee <get_mapping+718>:    mov    $0xffffffffffffffff,%rbx
0x4284f5 <get_mapping+725>:    callq  0x422410 <close>
0x4284fa <get_mapping+730>:    jmp    0x42849b <get_mapping+635>
0x4284fc <get_mapping+732>:    nopl   0x0(%rax)
0x428500 <get_mapping+736>:    callq  0x4281e0 <__nscd_unmap>
0x428505 <get_mapping+741>:    nopl   (%rax)
0x428508 <get_mapping+744>:    jmp    0x4284d3 <get_mapping+691>
0x42850a <get_mapping+746>:    nopw   0x0(%rax,%rax,1)
0x428510 <get_mapping+752>:    mov    -0x38(%rbp),%rsi
0x428514 <get_mapping+756>:    mov    %r12,%rdi
0x428517 <get_mapping+759>:    mov    $0xffffffffffffffff,%rbx
0x42851e <get_mapping+766>:    callq  0x423530 <munmap>
0x428523 <get_mapping+771>:    nopl   0x0(%rax,%rax,1)
0x428528 <get_mapping+776>:    jmpq   0x428485 <get_mapping+613>
(gdb) bt 
#0  0x00000000004284e3 in get_mapping (type=<value optimized out>, 
    key=<value optimized out>, mappedp=0x6a28b8) at nscd_helper.c:419
#1  0x0000000000428697 in __nscd_get_map_ref (type=GETFDPW, 
    name=0x476c3f "passwd", mapptr=0x6a28b0, gc_cyclep=0x7fffffffb4ac)
    at nscd_helper.c:450
#2  0x0000000000425e65 in nscd_getpw_r (key=0x7fffffffb506 "10682", keylen=6, 
    type=GETPWBYUID, resultbuf=0x6a1c00, 
    buffer=0x6e75722f7261762f <Address 0x6e75722f7261762f out of bounds>, 
    buflen=1, result=0x7fffffffb5d0) at nscd_getpw_r.c:97
#3  0x0000000000426236 in __nscd_getpwuid_r (uid=<value optimized out>, 
    resultbuf=0x6a1c00, buffer=0x6a59e0 "", buflen=1024, result=0x7fffffffb5d0)
    at nscd_getpw_r.c:65
#4  0x0000000000421a85 in __getpwuid_r (uid=10682, resbuf=0x6a1c00, 
    buffer=0x6a59e0 "", buflen=1024, result=0x7fffffffb5d0)
    at ../nss/getXXbyYY_r.c:191
#5  0x00000000004217fd in getpwuid (uid=10682) at ../nss/getXXbyYY.c:116
#6  0x0000000000400353 in main () at getpwuid.c:10
(gdb) stepi
Cannot access memory at address 0x8
(gdb) bt
#0  0x00000000004284e4 in get_mapping (type=<value optimized out>, 
Cannot access memory at address 0xfffffffffffffea8
Cannot access memory at address 0x8
    key=<value optimized out>, mappedp=) at nscd_helper.c:419
(gdb)

-- 
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]