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

keep getting errors on this DSA



Perhaps it's the data itself that is corrupted - I just don't see it.

I dump and reload...

cd /usr/local/var/openldap-data
mv DB_CONFIG ../
rm -fr *
rm -fr ../openldap-logs/*
/usr/local/sbin/slapadd -l /root/slapcat.ldif


# /usr/local/bin/db_verify __db.001
db_verify: Page 0: bad magic number 0
db_verify: Page 0: bad page size 0
db_verify: DB->verify: __db.001: DB_VERIFY_BAD: Database verification
failed

and more/other errors for db_verify __db.002 > 005

I know that I have properly patched db-4.2.52 with all patches...but
just to make sure, I ran each of the patches - listed below (2 patches
for db4 and 1 transaction patch)

If anyone can give me a clue here, I would appreciate it.

for clarity, I have added more info below.

Thanks

Craig

to be sure that I had db4 installed correctly...

I went to build folder of db4
cd db-4.2.52/build_unix
make realclean
# cat Config
CFLAGS='-O2'
CXXFLAGS='-O2'
../dist/configure \
        --prefix=/usr/local \
        --enable-compat185
# ./Config
# make
# make test
# make install

then I downloaded openldap-2.2.23 and 'untarred'

I went to build folder of openldap-2.2.23
# cat Config
#!/bin/sh
export LDFLAGS="-L/usr/local/lib -R/usr/local/lib"
export CPPFLAGS="-I/usr/local/ssl/include"
export LD_LIBRARY_PATH=/usr/local/lib
export LD_RUN_PATH=/usr/local/lib
export LANG=en_US
./configure \
    --prefix=/usr/local \
    --disable-ipv6 \
    --with-cyrus-sasl \
    --with-kerberos \
    --with-tls \
    --enable-monitor \
    --enable-dynamic \
    --enable-phonetic \
    --enable-slapd \
    --enable-spasswd \
    --enable-rlookups \
    --enable-wrappers \
    --enable-crypt \
    --enable-hdb \
    --with-dyngroup=yes \
    --with-proxycache=yes
# make
# make test
# make install

****
patched with transaction.diff

# cat transactions.diff.1
--- openldap-2.2.15/servers/slapd/back-bdb/cache.c.orig 2004-09-09
18:34:48.701487000 -0700
+++ openldap-2.2.15/servers/slapd/back-bdb/cache.c      2004-09-09
18:35:30.722007000 -0700
@@ -1186,7 +1186,7 @@

        if ( ldap_pvt_thread_pool_getkey( ctx, ((char *)env)+1, &data,
NULL ) ) {
                for ( i=0, rc=1; rc != 0 && i<4; i++ ) {
-                       rc = TXN_BEGIN( env, NULL, txn, 0 );
+                       rc = TXN_BEGIN( env, NULL, txn,
DB_TXN_NOT_DURABLE );
                        if (rc) ldap_pvt_thread_yield();
                }
                if ( rc != 0) {

****
db4-4.2.52
patched with transaction.diff
# cat transactions.diff
--- db4-4.2.52/dbinc/db.in.orig 2004-09-09 18:29:17.987387000 -0700
+++ db4-4.2.52/dbinc/db.in      2004-09-09 18:30:00.547903000 -0700
@@ -839,6 +839,7 @@
#define        TXN_NOWAIT      0x040           /* Do not wait on locks.
*/
#define        TXN_RESTORED    0x080           /* Transaction has been
restored. */
#define        TXN_SYNC        0x100           /* Sync on prepare and
commit. */
+#define        TXN_NOLOG       0x200           /* Do not log this
transaction. */
        u_int32_t       flags;
};

--- db4-4.2.52/txn/txn.c.orig   2004-09-09 18:30:36.348345000 -0700
+++ db4-4.2.52/txn/txn.c        2004-09-09 18:32:14.559561000 -0700
@@ -127,7 +127,7 @@
        if ((ret = __db_fchk(dbenv,
            "txn_begin", flags,
            DB_DIRTY_READ | DB_TXN_NOWAIT |
-           DB_TXN_NOSYNC | DB_TXN_SYNC)) != 0)
+           DB_TXN_NOSYNC | DB_TXN_SYNC | DB_TXN_NOT_DURABLE )) != 0)
                return (ret);
        if ((ret = __db_fcchk(dbenv,
            "txn_begin", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0)
@@ -193,6 +193,8 @@
                F_SET(txn, TXN_SYNC);
        if (LF_ISSET(DB_TXN_NOWAIT))
                F_SET(txn, TXN_NOWAIT);
+       if (LF_ISSET(DB_TXN_NOT_DURABLE))
+               F_SET(txn, TXN_NOLOG);

        if ((ret = __txn_begin_int(txn, 0)) != 0)
                goto err;
@@ -328,7 +330,7 @@
         * We should set this value when we write the first log record,
not
         * here.
         */
-       if (DBENV_LOGGING(dbenv))
+       if (DBENV_LOGGING(dbenv) && !F_ISSET(txn, TXN_NOLOG))
                __log_txn_lsn(dbenv, &begin_lsn, NULL, NULL);
        else
                ZERO_LSN(begin_lsn);

# cat patch.4.2.52.*
*** mp/mp_fget.c.orig   25 Sep 2003 02:15:16 -0000      11.81
--- mp/mp_fget.c        9 Dec 2003 19:06:28 -0000       11.82
***************
*** 440,446 ****
                c_mp->stat.st_pages--;
                alloc_bhp = NULL;
                R_UNLOCK(dbenv, &dbmp->reginfo[n_cache]);
-               MUTEX_LOCK(dbenv, &hp->hash_mutex);

                /*
                 * We can't use the page we found in the pool if
DB_MPOOL_NEW
--- 440,445 ----
***************
*** 455,460 ****
--- 454,462 ----
                        b_incr = 0;
                        goto alloc;
                }
+
+               /* We can use the page -- get the bucket lock. */
+               MUTEX_LOCK(dbenv, &hp->hash_mutex);
                break;
        case SECOND_MISS:
                /*
*** mp/mp_fput.c.orig   30 Sep 2003 17:12:00 -0000      11.48
--- mp/mp_fput.c        13 Dec 2003 00:08:29 -0000      11.49
***************
*** 285,290 ****
--- 285,291 ----
                    bhp != NULL; bhp = SH_TAILQ_NEXT(bhp, hq, __bh))
                        if (bhp->priority != UINT32_T_MAX &&
                            bhp->priority > MPOOL_BASE_DECREMENT)
+                               bhp->priority -= MPOOL_BASE_DECREMENT;
                MUTEX_UNLOCK(dbenv, &hp->hash_mutex);
        }
  }
*** lock/lock.c.save    2004-01-30 10:48:33.000000000 -0800
--- lock/lock.c 2004-01-30 10:55:58.000000000 -0800
***************
*** 2216,2226 ****
                                        dp = (u_int8_t *)dp +
\
                                            sizeof(db_pgno_t);
\
                                } while (0)
! #define COPY_OBJ(dp, obj)     do {
\
!                                       memcpy(dp, obj->data, obj-
>size);  \
!                                       dp = (u_int8_t *)dp +
\
!                                            ALIGN(obj->size,
\
!                                            sizeof(u_int32_t));
\
                                } while (0)

  #define GET_COUNT(dp, count)  do {
\
--- 2216,2227 ----
                                        dp = (u_int8_t *)dp +
\
                                            sizeof(db_pgno_t);
\
                                } while (0)
! #define COPY_OBJ(dp, obj)     do {
\
!                                       memcpy(dp,
\
!                                           (obj)->data, (obj)->size);
\
!                                       dp = (u_int8_t *)dp +
\
!                                            ALIGN((obj)->size,
\
!                                           sizeof(u_int32_t));
\
                                } while (0)

  #define GET_COUNT(dp, count)  do {
\
***************
*** 2339,2345 ****
                for (i = 0; i < nlocks; i = j) {
                        PUT_PCOUNT(dp, obj[i].ulen);
                        PUT_SIZE(dp, obj[i].size);
!                       COPY_OBJ(dp, obj);
                        lock = (DB_LOCK_ILOCK *)obj[i].data;
                        for (j = i + 1; j <= i + obj[i].ulen; j++) {
                                lock = (DB_LOCK_ILOCK *)obj[j].data;
--- 2340,2346 ----
                for (i = 0; i < nlocks; i = j) {
                        PUT_PCOUNT(dp, obj[i].ulen);
                        PUT_SIZE(dp, obj[i].size);
!                       COPY_OBJ(dp, &obj[i]);
                        lock = (DB_LOCK_ILOCK *)obj[i].data;
                        for (j = i + 1; j <= i + obj[i].ulen; j++) {
                                lock = (DB_LOCK_ILOCK *)obj[j].data;