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

Re: OpenLDAP dumps core (on SMP system) (ITS#1319)



--=====================_128171080==_
Content-Type: text/plain; charset="us-ascii"

On Fri, Sep 07, Carsten Hoeger wrote:

And now the missing attachment...

-- 
mit freundlichen Gruessen,

Carsten Hoeger  - SuSE The Linux Experts -

SuSE GmbH,        Schanzaeckerstr. 10,      90443 Nuernberg, Germany
Tel: +49-911-7405331      http://suse.com      Fax: +49-911-74053674

Key fingerprint = E3B6 7FDB 4800 0F22 DC09  EB2B 7988 B6A8 6691 C94A


--=====================_128171080==_
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: attachment; filename="idl_check.dif"

--- ldap/servers/slapd/back-ldbm/idl.c	Sun Jul 22 04:28:29 2001
+++ ldap.SuSE/servers/slapd/back-ldbm/idl.c	Fri Sep  7 16:54:54 2001
@@ -45,6 +45,21 @@
 	ch_free( cont->dptr );
 }
 
+#ifdef LDBM_DEBUG_IDL
+static void check_idl(ID_BLOCK *idl)
+{
+  int i;
+  ID_BLOCK last;
+
+  if (ID_BLOCK_INDIRECT(idl) || ID_BLOCK_ALLIDS(idl) || ID_BLOCK_NIDS(idl) <= 1)
+    return;
+
+  last = ID_BLOCK_ID(idl, 0);
+  for (i = 1; i < ID_BLOCK_NIDS(idl); last = ID_BLOCK_ID(idl, i), i++)
+    assert (last < ID_BLOCK_ID(idl, i));
+}
+#endif
+
 /* Allocate an ID_BLOCK with room for nids ids */
 ID_BLOCK *
 idl_alloc( unsigned int nids )
@@ -210,6 +225,10 @@
 	}
 	free( (char *) tmp );
 
+#ifdef LDBM_DEBUG_IDL
+	check_idl(idl);
+#endif
+
 	Debug( LDAP_DEBUG_TRACE, "<= idl_fetch %ld ids (%ld max)\n",
 	       ID_BLOCK_NIDS(idl), ID_BLOCK_NMAX(idl), 0 );
 	return( idl );
@@ -229,6 +248,10 @@
 	Datum	data;
 	struct ldbminfo *li = (struct ldbminfo *) be->be_private;
 
+#ifdef LDBM_DEBUG_IDL
+	check_idl(idl);
+#endif
+
 	ldbm_datum_init( data );
 
 	/* Debug( LDAP_DEBUG_TRACE, "=> idl_store\n", 0, 0, 0 ); */
@@ -293,6 +316,11 @@
 	    (char *) &ID_BLOCK_ID(b, nr),
 		nl * sizeof(ID) );
 	ID_BLOCK_NIDS(*left) = nl + (nr == 0 ? 0 : 1);
+
+#ifdef LDBM_DEBUG_IDL
+	check_idl(*right);
+	check_idl(*left);
+#endif
 }
 
 
@@ -703,6 +731,10 @@
 		'\0',
 	    (ID_BLOCK_NMAX(*idl) - ID_BLOCK_NIDS(*idl)) * sizeof(ID) );
 
+#ifdef LDBM_DEBUG_IDL
+	check_idl(*idl);
+#endif
+
 	return( i == 0 ? 1 : 0 );	/* inserted - first id changed or not */
 }
 
@@ -837,6 +869,10 @@
 		(char *) idl,
 		(ID_BLOCK_NMAX(idl) + ID_BLOCK_IDS_OFFSET) * sizeof(ID) );
 
+#ifdef LDBM_DEBUG_IDL
+	check_idl(new);
+#endif
+
 	return( new );
 }
 
@@ -874,6 +910,11 @@
 
 	n = idl_dup( idl_min( a, b ) );
 
+#ifdef LDBM_DEBUG_IDL
+	check_idl(a);
+	check_idl(b);
+#endif
+
 	for ( ni = 0, ai = 0, bi = 0; ai < ID_BLOCK_NIDS(a); ai++ ) {
 		for ( ;
 			bi < ID_BLOCK_NIDS(b) && ID_BLOCK_ID(b, bi) < ID_BLOCK_ID(a, ai);
@@ -897,6 +938,10 @@
 	}
 	ID_BLOCK_NIDS(n) = ni;
 
+#ifdef LDBM_DEBUG_IDL
+	check_idl(n);
+#endif
+
 	return( n );
 }
 
@@ -924,6 +969,11 @@
 		return( idl_allids( be ) );
 	}
 
+#ifdef LDBM_DEBUG_IDL
+	check_idl(a);
+	check_idl(b);
+#endif
+
 	if ( ID_BLOCK_NIDS(b) < ID_BLOCK_NIDS(a) ) {
 		n = a;
 		a = b;
@@ -956,6 +1006,10 @@
 	}
 	ID_BLOCK_NIDS(n) = ni;
 
+#ifdef LDBM_DEBUG_IDL
+	check_idl(n);
+#endif
+
 	return( n );
 }
 
@@ -1032,6 +1086,10 @@
 		ID_BLOCK_ID(n, ni++) = ID_BLOCK_ID(a, ai);
 	}
 	ID_BLOCK_NIDS(n) = ni;
+
+#ifdef LDBM_DEBUG_IDL
+	check_idl(n);
+#endif
 
 	return( n );
 }

--=====================_128171080==_
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: attachment; filename="Re OpenLDAP dumps core (on SMP1"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.5 (GNU/Linux)
Comment: Weitere Infos: siehe http://www.gnupg.org

iD8DBQE7mOVDeYi2qGaRyUoRAoebAJ9YqMlM8AMxVvgJ8IPrrLiWm6bZigCdFecq
OpjUQCbOtK/CrR8gqrWcJiQ=
=Pc83
-----END PGP SIGNATURE-----

--=====================_128171080==_--