agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Tom R.Hageman <tom@basil.icce.rug.nl>
To: POSTGRES mailing list <postgres@postgres.Berkeley.EDU>
Subject: [4.2] regression test (fstest) failure
Date: Wed, 12 Oct 94 17:02:51 +0100
Message-ID: <9410121602.AA00292@basil.icce.rug.nl> (raw)

Well, I've nearly finished my port of postgres 4.2 to NeXTSTEP except for a  
small (yeah:-) nit.

It --sometimes, not always-- fails to pass the regression test, with the  
following error message:

#
# - relative prmdir
#
prmdir relative_dir \
	|| exit 1
p_rmdir: p_errno=1, relative_dir: Error 0
the Inversion file system test causes an error

Symptoms:
- When run repeatedly it failed 70 out of 500 times on my machine (33MHz m68k).   
- On a slower machine it seems to fails more often.
- When I add "sleep 1" before the prmdir the test runs fine.

All this suggests a timing problem (in postmaster?) so I added some code to  
block SIGCHLD signals when a request is being handled in  
postmaster/postmaster.c.  This didn't help (although it should prevent the  
occasional postmaster hangups that I was experiencing.  It is a good idea  
anyway since the SIGCHLD handler manipulates (and frees) global  
datastructures...) so now I'm stumped.

Any ideas?

BTW this is plain 4.2 with aoki's postmaster patches applied.

Thanks in advance,
Tom.

FYI here are my changes to the postmaster:

*** %postmaster.c	Fri Sep  9 01:55:25 1994
--- postmaster.c	Sat Oct  8 15:23:48 1994
*************** ServerLoop(serverFd)
*** 354,357 ****
--- 354,358 ----
      int		nSockets, nSelected, status, newFd;
      PortNode	*prev, *curr;
+     int		orgsigmask = sigblock(0);	/* XXX[TRH] portability */
  

      nSockets = ServerSock + 1;
*************** ServerLoop(serverFd)
*** 360,363 ****
--- 361,365 ----
  

      for (;;) {
+ 	sigsetmask(orgsigmask);			/* XXX[TRH] portability */
  	newFd = -1;
  	bcopy((char *) &basemask, (char *) &rmask, sizeof(fd_set));
*************** ServerLoop(serverFd)
*** 372,375 ****
--- 374,385 ----
  	    return(STATUS_ERROR);
  	}
+ 	/* [TRH  8-Oct-94]
+ 	 * To avoid race conditions, block SIGCHLD signals while we are
+ 	 * handling the request. (both reaper() and ConnCreate()
+ 	 * manipulate the BackEnd list, and reaper() calls free() which is
+ 	 * usually non-reentrant.)
+ 	 */
+ 	sigblock(sigmask(SIGCHLD));		/* XXX[TRH] portability */
+ 

  	if (DebugLvl > 1) {
  	    fprintf(stderr, "%s: ServerLoop: %d sockets pending\n",

--
__/__/__/__/  Tom Hageman   <tom@basil.icce.rug.nl>   [NeXTMail accepted]
  __/ __/_/
 __/__/__/          "...to baldly go where no one has gone before."
__/  _/_/                                             -- star trek TNG

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: tom@basil.icce.rug.nl
  Subject: Re: [4.2] regression test (fstest) failure
  In-Reply-To: <9410121602.AA00292@basil.icce.rug.nl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox