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

Trouble building OpenLDAP CVS with Berkeley DB 4



Hi,

I haven't built OpenLDAP CVS for a long time since db4 packages were not
available for Debian Linux. I finally gave up waiting and installed a local
copy of db4 and tried to build OpenLDAP and immediately ran into
trouble. The configure script is breaking in the check for the DB version
compatibility. Further investigation shows that the test program is
segfaulting. 

I think the problem is with build/openldap.m4. In the OL_BERKELEY_DB_TRY
macro, the following code fragment causes the core dump

-----
#if DB_VERSION_MAJOR > 2
        db_env_create( NULL, 0 );
#elif DB_VERSION_MAJOR > 1
        db_appexit( NULL );
#else
        (void) dbopen( NULL, 0, 0, 0, NULL);
#endif
------

DB 4 does not support a NULL parameter to be passed is as a first argument
to db_env_create. There is no check in db_env_create() if the first
parameter is NULL, it blindly assigns a value to the variable. 

I am surprised nobody ran into this problem before.

Ganesan