From owner-freebsd-current Thu Nov 7 16:31:31 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA20031 for current-outgoing; Thu, 7 Nov 1996 16:31:31 -0800 (PST) Received: from vader.cs.berkeley.edu (vader.CS.Berkeley.EDU [128.32.38.234]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id QAA20021 for ; Thu, 7 Nov 1996 16:31:26 -0800 (PST) Received: (from asami@localhost) by vader.cs.berkeley.edu (8.8.2/8.7.3) id QAA07049; Thu, 7 Nov 1996 16:29:51 -0800 (PST) Date: Thu, 7 Nov 1996 16:29:51 -0800 (PST) Message-Id: <199611080029.QAA07049@vader.cs.berkeley.edu> To: wpaul@skynet.ctr.columbia.edu CC: current@FreeBSD.ORG In-reply-to: <199611071653.LAA07481@skynet.ctr.columbia.edu> (message from Bill Paul on Thu, 7 Nov 1996 11:53:13 -0500 (EST)) Subject: Re: yp_next failure From: asami@FreeBSD.ORG (Satoshi Asami) Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk I was wrong about the patch making no difference, it did indeed turn off the messages. (So instead of seeing "oh my gosh...yp_next isn't feeling well...segmentation fault", it's simply seg faults.) By the way, I recompiled sendmail with -g and this is what I got. ------- (gdb) run -q Starting program: /usr/obj/a/src/usr.sbin/sendmail/src/sendmail -q Program received signal SIGSEGV, Segmentation fault. 0x2008ebc6 in _yp_dobind () (gdb) bt #0 0x2008ebc6 in _yp_dobind () #1 0x2008f458 in yp_first () #2 0x2007ac62 in endpwent () #3 0x2007a48f in endpwent () #4 0x2007a21a in getpwuid () #5 0x6e80 in sm_getpwuid (uid=0) at /a/src/usr.sbin/sendmail/src/conf.c:4081 #6 0x17fbe in main (argc=2, argv=0xefbfc2ac, envp=0xefbfc2b8) at /a/src/usr.sbin/sendmail/src/main.c:284 ------- So you were right about yp_dobind() getting confused. I recompiled the yp part of libc with -g too, and here is a more detailed report: ------- (gdb) run -q Starting program: /usr/obj/a/src/usr.sbin/sendmail/src/sendmail -q Program received signal SIGSEGV, Segmentation fault. 0x2008f036 in _yp_dobind (dom=0x200c88b0 "mammoth", ypdb=0xefbf9e60) at /a/src/lib/libc/yp/yplib.c:269 269 clnt_destroy(ysd->dom_client); (gdb) p ysd $1 = (struct dom_binding *) 0x5c000 (gdb) p *ysd $2 = {dom_pnext = 0x0, dom_domain = "mammoth", '\000' , dom_server_addr = {sin_len = 16 '\020', sin_family = 2 '\002', sin_port = 6659, sin_addr = {s_addr = 421929088}, sin_zero = "\000\000\000\000\000\000\000"}, dom_server_port = 6659, dom_socket = -1, dom_client = 0x0, dom_local_port = 14083, dom_vers = -1} ------- Since clnt_destroy is a macro that takes a pointer and deferences it, I guess that's the problem. Line 269 is this: ------- sock = ysd->dom_socket; save = dup(ysd->dom_socket); clnt_destroy(ysd->dom_client); <=== ysd->dom_vers = 0; ysd->dom_client = NULL; sock = dup2(save, sock); ------- in case the patch has shifted things around a bit. So, I changed this to: ------- sock = ysd->dom_socket; save = dup(ysd->dom_socket); if (ysd->dom_client) clnt_destroy(ysd->dom_client); ysd->dom_vers = 0; ysd->dom_client = NULL; sock = dup2(save, sock); ------- (hey, stop laughing). Now things seem to have "calmed down", at least sendmail/ssh/from/mailq don't seg fault any more. I'll have to beat on it a little more, I'm now going to reboot the machine with the new libc and see how it goes. Satoshi