bug-cvs
[Top][All Lists]
Advanced

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

Re: TEST AAA


From: Mark D. Baushke
Subject: Re: TEST AAA
Date: Mon, 06 Oct 2003 08:55:19 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Edwards <address@hidden> writes:

> "Pierre" <address@hidden> wrote in message news:address@hidden
> > Here is the result (at first try) :
> >
> > stage 1, old fp f0004c00 new fp f0004c20
> > fstat of 4 is 0
> > stage 8, old fp f0004c00 new fp f0004c20
> > fstat of 4 is 0
> > stage 9, old fp f0004c00 new fp f0004c20
> > fstat of 4 is -1
> > stage 10, old fp f0004c00 new fp f0004c20
> > fstat of 4 is -1
> > after close, fstat of 4 is -1
> > Le sous-programme assert a �chou� : fstat ( fileno (bc->fp), &s ) != -1, 
> > fichier
> >  buffer.c, ligne 1385
> > cvs [login aborted]: received abort signal
> 
> Ok, so what's happening is a call of the format
> 
> shutdown(3, 1);
> 
> attempting to shut down fileno 3, is for some reason screwing up
> fileno 4.
> 
> I'm not sure what "shutdown" is, I assume it is some Unix call.

The shutdown function is a IEEE Std 1003.1g-2000 (aka POSIX.1) function.

Here is a FreeBSD man page on the function:

   http://www.gsp.com/cgi-bin/man.cgi?section=2&topic=shutdown

int shutdown(int socket_fd, int how);

Typical values of the SHUT_* macros used for the 'how' variable are:

#define SHUT_RD 0     /* further receives will be disallowed */
#define SHUT_WR 1     /* further sends will be disallowed */
#define SHUT_RDWR 2   /* further sends and receives will be disallowed */

The shutdown() function returns 0 if successful; otherwise the value -1 is
returned and the global variable errno is set to indicate the error.

The shutdown() call fails if:

     [EBADF]        The s argument is not a valid file descriptor.

     [EINVAL]           The how argument is invalid.

     [ENOTCONN]         The socket is not connected.

     [ENOTSOCK]         The s argument does not refer to a socket.

The cvs source code probably really should be using the macro names
instead of literal constants. You may wish to verify the values of the
SHUT_* macros under the AIX you are using. An AIX 4.3 system around here has

% cd /usr/include/sys
% grep SHUT_ *.h
socket.h:#define SHUT_RD         0       /* shut down for reading */
socket.h:#define SHUT_WR         1       /* shut down for writing */
socket.h:#define SHUT_RDWR       2       /* shut down for read & write */
%

The AIX 4.3 man page on shutdown() says that the subroutine is part of
Base Operating System (BOS) Runtime and also says:

     All applications containing the shutdown subroutine must be
     compiled with _BSD set to a specific value. Acceptable values are
     43 and 44. In addition, all socket applications must include the
     BSD libbsd.a library.

So, it may be desirable to know how the _BSD macro is set on the
particular AIX system being used as well as if the libbsd.a library
is being included in the link.

> (Would someone more familiar with this like to do a
> 
> grep shutdown buffer.c | grep 1
> 
> and tell me what implications there are surrounding that shutdown
> call?

I believe that Derek wrote that part of buffer.c, so it would be best
if he answered your question.

> I can imagine two things at this stage:
> 
> 1. A problem with AIX that is causing the shutdown to shut down
> all resource related to a fileno, without keeping a count of how many
> other filenos are using those same resources.
> 
> 2. After the client issues the shutdown call, the server is inspired
> to shut down itself, and the other socket that the client has open
> suddenly disappears.
> 
> I think (2) is more likely because this problem is timing sensitive.
> 
> But because it is timing sensitive, all you need is a sleep(1) at the
> right spot in the server, and that will circumvent the problem,
> without getting to the heart of the problem.
> 
> The heart of the problem is either:
> 
> 1. The server has no right to close the socket just because the
> client does.
> 
> 2. AIX has no right to close a socket, or render it inoperative,
> just because the other side of the link has closed down.
> 
> I think (2) is most likely here.
> 
> To prove (2) requires either indepth knowledge of Posix
> requirements for sockets, or it requires testing with another
> system to lend evidence to "standard Unix" behaviour.
> 
> If someone would like to try putting a "sleep(5)" after the
> above shutdown call, and test it out on a non-AIX system
> (e.g. Linux), and set up a client/server on same machine,
> and do a "cvs login", that would be helpful.  I don't have
> easy access to do that myself.
> 
> I will confirm whether "shutdown" is part of Unix, and if so,
> I'll try to find somewhere to put a "sleep(1)" in the server
> which will hopefully be sufficient for your purpose.
> 
> As well, I'd like you to try another test, TEST CCC.
> 
> TEST CCC is to use the unmodified 1.11.6 and define
> NO_SOCKET_TO_FD
> and see what happens.
> 
> BFN.  Paul.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/gZBn3x41pRYZE/gRAr/SAKDCF1vCFe822nJoZnk4qLqrv6DXAACfWYor
TSm9n5N5AuJZMi4vqMTxmf4=
=3esU
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]