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

Re: Trouble building OpenLDAP CVS with Berkeley DB 4



>>>>> "Ganesan" == Ganesan R <rganesan-ldap@myrealbox.com> writes:

> 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. 

Actually, my problem turned out to be something else. I had installed
Berkeley DB in a non standard location and calling configure after setting
CFLAGS and LDFLAGS. The DB version check was calling cpp without using these
flags and picked up the wrong db.h. I fixed it by setting CPPFLAGS before
calling configure. 

In any case the above code in OL_BERKELEY_DB_TRY is broken. I assume the
db_env_create appeared only in db3 and the call here is only interested so
long as the linking succeeds. The way it is written however, the test
programs will segfault.

Ganesan