[Spread-users] Re: [PATCH] spread bails when using mod_log_spread

Jonathan Stanton jonathan at cnds.jhu.edu
Tue Jul 10 22:10:31 EDT 2001


Ok. My oops. I missed a race condition when adding the client
authentication to the session management. This can occur when two clients
attempt to connect at the same time. Even then it may not always trigger.

I've attached a small patch that should fix the problem, although I havn't
tested it out myself it is pretty trivial...famous last words I know. The
problem is that the function is passed two values (ses and mbox) which
should be different, but equivelent. However one of them, the ses value,
can change underneath us, so we have to ignore it and use only the mbox to
find the session information.

I think this should fix the problem. 

Note, I have found a few bugs in the new authentciation code released in
3.16.0, so everyone should treat the authentication and access control
stuff like the beta that it is. :-) If you use Spread in its default way
without configuring any authentication, none of the bugs should have any
effect (except the one in this email...).

If you still have the problem after rebuilding with this patch, then what
would really help me debug this is if you can recompile with debugging
enabled (add -g to the CFLAGS define in the makefile) and email me what
happens, what platform you are using and the core file. If not, just tell
me what you can and I'll look at it.

Jonathan

On Tue, Jul 10, 2001 at 05:33:53PM -0400, Neil Mansilla wrote:
> The following error message is received at times when I'm running
> mod_log_spread over spread:
> 
> spread: session.c:681: Sess_recv_client_auth: Assertion `Sessions[ses].mbox == mbox' failed.
> 
> Can anyone help me decipher this error?  The spread process does die after
> it shoots off this error message.  However, when running spread over again
> it may run for minutes before it does this, or heck, even hours.  spread
> is being run by "nobody", spreadlogd being run by "nobody".  mod_log_spread
> works beautifully during spread's normal runtime.
> 
> --Neil
> 
> 
> 
> _______________________________________________
> spread-users mailing list
> spread-users at lists.spread.org
> http://lists.spread.org/mailman/listinfo/spread-users

-- 
-------------------------------------------------------
Jonathan R. Stanton         jonathan at cs.jhu.edu
Dept. of Computer Science   
Johns Hopkins University    
-------------------------------------------------------
-------------- next part --------------
--- session.c	Fri Jun 22 13:53:20 2001
+++ session.c.new	Tue Jul 10 21:53:40 2001
@@ -99,7 +99,7 @@
 
 static	void	Sess_attach_accept(void);
 static	void	Sess_detach_accept(void);
-static  void    Sess_recv_client_auth(mailbox mbox, int ses, void *dummy_p);
+static  void    Sess_recv_client_auth(mailbox mbox, int dummy, void *dummy_p);
 static	void    Sess_accept( mailbox mbox, int domain, void *dummy );
 static	void	Sess_accept_continue( mailbox, int, void * );
 static	void    Sess_read( mailbox mbox, int domain, void *dummy );
@@ -667,18 +667,18 @@
         }
 
         /* Now wait for client reply */
-	E_attach_fd( Sessions[sess_location].mbox, READ_FD, Sess_recv_client_auth, sess_location, NULL, LOW_PRIORITY );	
-	E_attach_fd( Sessions[sess_location].mbox, EXCEPT_FD, Sess_recv_client_auth, sess_location, NULL, LOW_PRIORITY );	
+	E_attach_fd( Sessions[sess_location].mbox, READ_FD, Sess_recv_client_auth, 0, NULL, LOW_PRIORITY );	
+	E_attach_fd( Sessions[sess_location].mbox, EXCEPT_FD, Sess_recv_client_auth, 0n, NULL, LOW_PRIORITY );	
 }
 
-static void    Sess_recv_client_auth(mailbox mbox, int ses, void *dummy_p)
+static void    Sess_recv_client_auth(mailbox mbox, int dummy, void *dummy_p)
 {
-        int         ret, i, ioctl_cmd;
+        int         ret, i, ioctl_cmd, ses;
         char        auth_name[MAX_AUTH_NAME * MAX_AUTH_METHODS];
         void        (*auth_open)(struct session_auth_info *);
         struct session_auth_info *sess_auth_p;
 
-        assert( Sessions[ses].mbox == mbox );
+        ses = Session_index[mbox];
         if (!Is_preauth_session(Sessions[ses].status) )
         {
                 Alarm( EXIT, "Sess_recv_client_auth: BUG! Session is already authorized (status 0x%x)\n", Sessions[ses].status);


More information about the Spread-users mailing list