[Date Prev][Date Next] [Chronological] [Thread] [Top]

FW: slapd abort in (ITS#1655)



Looks like swapping the two statements in connection_get (ber_sockbuf_ctrl
with if) would be a smart thing to do. Any comments?

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

-----Original Message-----
From: owner-openldap-bugs@OpenLDAP.org
[mailto:owner-openldap-bugs@OpenLDAP.org]On Behalf Of akeller@inform.ch
Sent: Wednesday, March 20, 2002 10:50 AM
To: openldap-its@OpenLDAP.org
Subject: slapd abort in (ITS#1655)


Full_Name: Alfred Keller
Version: 2.0.23
OS: Win 2000
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (195.134.131.162)


When a slapd client opens and closes connections to slapd in short
intervals,
then slapd frequently aborts at the following code line:

ber_sockbuf_ctrl( Sockbuf *sb, int opt, void *arg )
{
	Sockbuf_IO_Desc		*p;
	int			ret = 0;

	assert( sb != NULL );                <<<<<<<<<<<<<<< here
	assert( SOCKBUF_VALID( sb ) );
--- snip ----

The calling function is:

static Connection* connection_get( ber_socket_t s )
{
  ....

  for(i=0; i<dtblsize; i++) {
    ber_sockbuf_ctrl( connections[i].c_sb,
			LBER_SB_OPT_GET_FD, &sd );     <<<<<<<< called here

    if( connections[i].c_struct_state == SLAP_C_UNINITIALIZED ) {
      assert( connections[i].c_conn_state == SLAP_C_INVALID );
      assert( connections[i].c_sb == 0 );               <<<<<<<< look here !
      break;
    }
----- snip -----

Something is wrong here because at 'look here' you see that under some
conditions connections[i].c_cb is expected to be 0, but in the call to
ber_sockbuf_ctrl a few lines above the value of connections[i].c_cb may
never be
0??? (assert in ber_sockbuf_ctrl).

By the way, our application runs fine when we call ber_sockbuf_ctrl *after*
the
'if'-block in function connection_get. Be we can't say if this is the
correct
way to fix the problem.