Bug 29808

Summary: [nis] ypserv(8) dumps core in yp_find_db
Product: Base System Reporter: cattelan
Component: binAssignee: Marcelo Araujo <araujo>
Status: Closed Not Accepted    
Severity: Affects Only Me CC: araujo
Priority: Normal    
Version: 1.0-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description cattelan 2001-08-17 16:50:01 UTC
This machine is a slave server to an IRIX ypmaster server.
Every once in a while the ypserv process will core with
either qptr or qptr->dbptr being NULL.
The simple fix it so add checks for NULL but 
given this is a circular list how could these
pointers end up NULL?



#0  yp_find_db (name=0xbfbfe3dc "lcse-c/services", key=0x0, size=0)
    at /.amd_mnt/tigris/export/barn/build/src4/usr.sbin/ypserv/yp_dblookup.c:335
335                     if (qptr->dbptr && !strcmp(qptr->dbptr->name, name)) {
(gdb) ping qptr
Undefined command: "ping".  Try "help".
(gdb) print qptr
$1 = (struct circleq_entry *) 0x0
(gdb) list
330     /.amd_mnt/tigris/export/barn/build/src4/usr.sbin/ypserv/yp_dblookup.c: No such file o
r directory.
(gdb) dir /usr/src//usr.sbin/ypserv/
Source directories searched: /usr/src//usr.sbin/ypserv:$cdir:$cwd
(gdb) list
330     {
331             register struct circleq_entry *qptr;
332
333             for (qptr = qhead.cqh_first; qptr != (void *)&qhead;
334                                                     qptr = qptr->links.cqe_next) {
335                     if (qptr->dbptr && !strcmp(qptr->dbptr->name, name)) {
336                             if (size) {
337                                     if (size != qptr->dbptr->size ||
338                                        strncmp(qptr->dbptr->key, key, size))
339                                             continue;
(gdb) quit
Comment 1 Marcelo Araujo freebsd_committer freebsd_triage 2015-10-02 08:28:27 UTC
The same approach was done using TAILQ_FOREACH line 235.
Comment 2 cattelan 2015-10-02 17:49:47 UTC
Wow this is so old it talks about IRIX!