Date: Thu, 7 Nov 1996 11:53:13 -0500 (EST) From: Bill Paul <wpaul@skynet.ctr.columbia.edu> To: asami@FreeBSD.ORG (Satoshi Asami) Cc: current@FreeBSD.ORG Subject: Re: yp_next failure Message-ID: <199611071653.LAA07481@skynet.ctr.columbia.edu> In-Reply-To: <199611070754.XAA29424@silvia.HIP.Berkeley.EDU> from "Satoshi Asami" at Nov 6, 96 11:54:42 pm
next in thread | previous in thread | raw e-mail | index | archive | help
Of all the gin joints in all the towns in all the world, Satoshi Asami
had to walk into mine and say:
> * Unfortunately, I haven't run into this sort of thing much myself.
> * Without being able to reliably duplicate the problem, I can't easily
> * debug it.
>
> Well, I don't know what is wrong but I really think something has gone
> wrong recently. "make world" just died:
>
> =====
> ===> ISO
> install -c -o bin -g bin -m 444 ISOamsa ISOamsb ISOamsc ISOamsn ISOamso ISOamsr ISObox ISOcyr1 ISOcyr2 ISOdia ISOgrk1 ISOgrk2 ISOgrk3 ISOgrk4 ISOlat1 ISOlat2 ISOnum ISOpub ISOtech /usr/share/sgml/ISO
> yp_first: clnt_call: RPC: Timed out
>
> *** Signal 11
>
> Stop.
> =====
>
> I've never had an "install" die on me like that.
>
> Satoshi
Well I haven't changed the NIS client code recently. However, we may as
well try something, if you're up to it. I've got a patch for you to test
for me. Actually, other people can test this for me too if only to help
save my sanity. This is for -current or RELENG_2_2, but _not_ 2.1.x.
I'm assuming you are using -current; the yplib code in 2.1.x still uses
the old 'set up and tear down the RPC connection on each call' method.
This patch does 2 things: it turns off a lot of error message printing
by hiding the clnt_perror() calls under #ifdefs, and it adds the same
socket descriptor sanity checking from _yp_dobind() to _yp_unbind().
Turning off the error messages may be overkill; you can #define YP_MESSAGES
to turn them back on again. I'm more interested in the change to
_yp_unbind(). Note that you need to rebuild libc for this. I think you
can get away with just replacing libc.so for testing purposes since
the programs that puked all appeared to be dynamically linked.
Apply this to src/lib/libc/yp/yplib.c, make a new libc.so and see
what happens.
-Bill
--
=============================================================================
-Bill Paul (212) 854-6020 | System Manager, Master of Unix-Fu
Work: wpaul@ctr.columbia.edu | Center for Telecommunications Research
Home: wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
=============================================================================
"If you're ever in trouble, go to the CTR. Ask for Bill. He will help you."
=============================================================================
*** yplib.c Thu Nov 7 11:24:35 1996
--- /home2/wpaul/yplib/yp/yplib.c Thu Nov 7 11:50:45 1996
***************
*** 28,34 ****
*/
#ifndef LINT
! static char *rcsid = "$Id: yplib.c,v 1.24 1996/07/13 20:23:13 wpaul Exp $";
#endif
#include <sys/param.h>
--- 28,34 ----
*/
#ifndef LINT
! static char *rcsid = "$Id: yplib.c,v 1.6 1996/11/07 16:50:35 wpaul Exp $";
#endif
#include <sys/param.h>
***************
*** 354,359 ****
--- 354,360 ----
client = clnttcp_create(&clnt_sin, YPBINDPROG, YPBINDVERS, &clnt_sock,
0, 0);
if(client==NULL) {
+ #ifdef YP_MESSAGES
/*
* These conditions indicate ypbind just isn't
* alive -- we probably don't want to shoot our
***************
*** 364,369 ****
--- 365,371 ----
(rpc_createerr.cf_stat != RPC_SYSTEMERROR &&
rpc_createerr.cf_error.re_errno == ECONNREFUSED))
clnt_pcreateerror("clnttcp_create");
+ #endif
if(new)
free(ysd);
return (YPERR_YPBIND);
***************
*** 433,439 ****
--- 435,443 ----
ysd->dom_client = clntudp_create(&ysd->dom_server_addr,
YPPROG, YPVERS, tv, &ysd->dom_socket);
if(ysd->dom_client==NULL) {
+ #ifdef YP_MESSAGES
clnt_pcreateerror("clntudp_create");
+ #endif
ysd->dom_vers = -1;
goto again;
}
***************
*** 472,479 ****
_yp_unbind(ypb)
struct dom_binding *ypb;
{
! if (ypb->dom_client)
! clnt_destroy(ypb->dom_client);
ypb->dom_client = NULL;
ypb->dom_socket = -1;
ypb->dom_vers = -1;
--- 476,500 ----
_yp_unbind(ypb)
struct dom_binding *ypb;
{
! struct sockaddr_in check;
! int checklen = sizeof(struct sockaddr_in);
!
! if (ypb->dom_client) {
! /* Check the socket -- may have been hosed by the caller. */
! if (getsockname(ypb->dom_socket, (struct sockaddr *)&check,
! &checklen) == -1 || check.sin_family != AF_INET ||
! check.sin_port != ypb->dom_local_port) {
! int save, sock;
!
! sock = ypb->dom_socket;
! save = dup(ypb->dom_socket);
! clnt_destroy(ypb->dom_client);
! sock = dup2(save, sock);
! close(save);
! } else
! clnt_destroy(ypb->dom_client);
! }
!
ypb->dom_client = NULL;
ypb->dom_socket = -1;
ypb->dom_vers = -1;
***************
*** 561,567 ****
--- 582,590 ----
r = clnt_call(ysd->dom_client, YPPROC_MATCH,
xdr_ypreq_key, &yprk, xdr_ypresp_val, &yprv, tv);
if(r != RPC_SUCCESS) {
+ #ifdef YP_MESSAGES
clnt_perror(ysd->dom_client, "yp_match: clnt_call");
+ #endif
_yp_unbind(ysd);
goto again;
}
***************
*** 631,637 ****
--- 654,662 ----
r = clnt_call(ysd->dom_client, YPPROC_FIRST,
xdr_ypreq_nokey, &yprnk, xdr_ypresp_key_val, &yprkv, tv);
if(r != RPC_SUCCESS) {
+ #ifdef YP_MESSAGES
clnt_perror(ysd->dom_client, "yp_first: clnt_call");
+ #endif
_yp_unbind(ysd);
goto again;
}
***************
*** 693,699 ****
--- 718,726 ----
r = clnt_call(ysd->dom_client, YPPROC_NEXT,
xdr_ypreq_key, &yprk, xdr_ypresp_key_val, &yprkv, tv);
if(r != RPC_SUCCESS) {
+ #ifdef YP_MESSAGES
clnt_perror(ysd->dom_client, "yp_next: clnt_call");
+ #endif
_yp_unbind(ysd);
goto again;
}
***************
*** 759,765 ****
--- 786,794 ----
if (clnt_call(clnt, YPPROC_ALL,
xdr_ypreq_nokey, &yprnk,
xdr_ypresp_all_seq, &status, tv) != RPC_SUCCESS) {
+ #ifdef YP_MESSAGES
clnt_perror(ysd->dom_client, "yp_next: clnt_call");
+ #endif
clnt_destroy(clnt);
_yp_unbind(ysd);
goto again;
***************
*** 806,812 ****
--- 835,843 ----
r = clnt_call(ysd->dom_client, YPPROC_ORDER,
xdr_ypreq_nokey, &yprnk, xdr_ypresp_order, &ypro, tv);
if(r != RPC_SUCCESS) {
+ #ifdef YP_MESSAGES
clnt_perror(ysd->dom_client, "yp_order: clnt_call");
+ #endif
_yp_unbind(ysd);
goto again;
}
***************
*** 851,857 ****
--- 882,890 ----
r = clnt_call(ysd->dom_client, YPPROC_MASTER,
xdr_ypreq_nokey, &yprnk, xdr_ypresp_master, &yprm, tv);
if(r != RPC_SUCCESS) {
+ #ifdef YP_MESSAGES
clnt_perror(ysd->dom_client, "yp_master: clnt_call");
+ #endif
_yp_unbind(ysd);
goto again;
}
***************
*** 890,896 ****
--- 923,931 ----
r = clnt_call(ysd->dom_client, YPPROC_MAPLIST,
xdr_domainname,(char *)&indomain,xdr_ypresp_maplist,&ypml,tv);
if (r != RPC_SUCCESS) {
+ #ifdef YP_MESSAGES
clnt_perror(ysd->dom_client, "yp_maplist: clnt_call");
+ #endif
_yp_unbind(ysd);
goto again;
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611071653.LAA07481>
