https://bugs.openldap.org/show_bug.cgi?id=9449

          Issue ID: 9449
           Summary: When the "lockdetect" is setted in slapd.conf, the db
                    deadlock detected policy  is setted incorrected
           Product: OpenLDAP
           Version: 2.4.57
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: ---
         Component: slapd
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

I have the "lockdetect random" setted in slapd.conf,the expected deadlock
detected policy is "DB_LOCK_RANDOM" but I got the valude "DB_LOCK_EXPIRE".

After many search of the source file, the lockdetect  parse source is found on
openldap-2.4.57\servers\slapd\back-bdb\config.c :Line 894-903
---------------------
case BDB_LOCKD:
        rc = verb_to_mask( c->argv[1], bdb_lockd );
        if ( BER_BVISNULL(&bdb_lockd[rc].word) ) {
                fprintf( stderr, "%s: "
                        "bad policy (%s) in \"lockDetect <policy>\" line\n",
                        c->log, c->argv[1] );
                return 1;
        }
        bdb->bi_lock_detect = (u_int32_t)rc;
        break;
---------------------

After analyse the verb_to_mask's return value, the "rc" is the index of the
bdb_lockd's setting items. So it can't be passwd to bi_lock_detect.
The right value is The "bdb_lockd[rc].mask".
I think it is a bug, my recommendation fix is like the next.

bdb->bi_lock_detect = (u_int32_t)rc;
->
bdb->bi_lock_detect = bdb_lockd[rc].mask;

-- 
You are receiving this mail because:
You are on the CC list for the issue.

Reply via email to