Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Nov 1996 16:29:51 -0800 (PST)
From:      asami@FreeBSD.ORG (Satoshi Asami)
To:        wpaul@skynet.ctr.columbia.edu
Cc:        current@FreeBSD.ORG
Subject:   Re: yp_next failure
Message-ID:  <199611080029.QAA07049@vader.cs.berkeley.edu>
In-Reply-To: <199611071653.LAA07481@skynet.ctr.columbia.edu> (message from Bill Paul on Thu, 7 Nov 1996 11:53:13 -0500 (EST))

next in thread | previous in thread | raw e-mail | index | archive | help
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' <repeats 57 times>, 
  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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611080029.QAA07049>