Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: nss_winbind Segmentation fault -



Hello Christos,

Thank you for your tip - I have come a little further. Am I correctly interpreting the debugger output that the memory address of the integer pointer from groupc points to empty/unallocated memory?

-------------------------------------------------------------------------
test10# gdb /usr/bin/id id.core
GNU gdb (GDB) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
	<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/id...
Reading symbols from /usr/libdata/debug//usr/bin/id.debug...
[New process 5161]
Core was generated by `id'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007617ee803dcf in netbsdwinbind_getgroupmembership (nsrv=0x0, nscb=0x0, ap=0x7f7fff209688) at ../../nsswitch/winbind_nss_netbsd.c:203 203 for (dupc = 0; dupc < MIN(maxgrp, *groupc); dupc++) {
(gdb) br netbsdwinbind_getgroupmembership
Breakpoint 1 at 0x7617ee803aac: file ../../nsswitch/winbind_nss_netbsd.c, line 176.
(gdb) run Administrator
Starting program: /usr/bin/id Administrator

Breakpoint 1, netbsdwinbind_getgroupmembership (nsrv=0x0, nscb=0x0, ap=0x7f7fff3af948) at ../../nsswitch/winbind_nss_netbsd.c:176
176     {
(gdb) s
177             int             *result = va_arg(ap, int *);
(gdb) s
178             const char      *uname  = va_arg(ap, const char *);
(gdb) s
179             gid_t           *groups = va_arg(ap, gid_t *);
(gdb) s
180             int              maxgrp = va_arg(ap, int);
(gdb) s
181             int             *groupc = va_arg(ap, int *);
(gdb) s
183             struct winbindd_request request = {
(gdb) p uname
$1 = 0x73209820ce60 <_winbind_passwdbuf> "MPNET\\administrator"
(gdb) x 0x73209820ce60
0x73209820ce60 <_winbind_passwdbuf>:        "MPNET\\administrator"
(gdb) p groupc
$2 = (int *) 0x732000000011
(gdb) x 0x732000000011
0x732000000011:   <error: Cannot access memory at address 0x732000000011>
-------------------------------------------------------------------------

The further backtrace looks like this:

-------------------------------------------------------------------------
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x0000732098003dcf in netbsdwinbind_getgroupmembership (nsrv=0x0, nscb=0x0, ap=0x7f7fff3af948) at ../../nsswitch/winbind_nss_netbsd.c:203 203 for (dupc = 0; dupc < MIN(maxgrp, *groupc); dupc++) {
(gdb) bt
#0 0x0000732098003dcf in netbsdwinbind_getgroupmembership (nsrv=0x0, nscb=0x0, ap=0x7f7fff3af948) at ../../nsswitch/winbind_nss_netbsd.c:203 #1 0x0000732098b5a375 in _nsdispatch (retval=retval@entry=0x0, disp_tab=disp_tab@entry=0x732098de0de0, database=database@entry=0x732098ba0849 "group", method=method@entry=0x732098b96a4e "getgroupmembership", defaults=0x732098de5ec0 <__nsdefaultcompat>) at /home/source/ab/HEAD/src/lib/libc/net/nsdispatch.c:670 #2 0x0000732098aa25f9 in _getgroupmembership (_uname=_uname@entry=0x73209820ce60 <_winbind_passwdbuf> "MPNET\\administrator", agroup=agroup@entry=100, groups=groups@entry=0x7320991f2050, maxgrp=17, groupc=groupc@entry=0x7f7fff3afb2c) at /home/source/ab/HEAD/src/lib/libc/gen/getgroupmembership.c:396 #3 0x0000732098a72d40 in _getgrouplist (_uname=0x73209820ce60 <_winbind_passwdbuf> "MPNET\\administrator", agroup=100, groups=0x7320991f2050, grpcnt=0x7f7fff3afb88)
	at /home/source/ab/HEAD/src/lib/libc/gen/getgrouplist.c:67
#4 0x0000000086001792 in user (pw=0x73209820ce00 <_winbind_passwd>) at /home/source/ab/HEAD/src/usr.bin/id/id.c:272 #5 main (argc=<optimized out>, argv=<optimized out>) at /home/source/ab/HEAD/src/usr.bin/id/id.c:167
-------------------------------------------------------------------------

I then unpacked the appropriate current sources under /home/source... so that I am at least technically able to continue debugging. However, my understanding just stops here and I have to take more time to think myself into it. Can you see anything obvious from the output of gdb?

Kind regards
Matthias


Am 21.07.2020 um 01:29 schrieb Christos Zoulas:
groupc must be NULL. You probably want to install the debug sets
so that you can also see how libc is calling nsdispatch.

christos

On Jul 20, 2020, at 7:24 PM, Matthias Petermann <mp%petermann-it.de@localhost <mailto:mp%petermann-it.de@localhost>> wrote:

)



Home | Main Index | Thread Index | Old Index