php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5418 Bug in detection of dbm causes conflict with Sybase dbopen()
Submitted: 2000-07-06 22:31 UTC Modified: 2001-05-14 21:55 UTC
From: dean dot bennett at home dot com Assigned:
Status: Closed Package: Sybase (dblib) related
PHP Version: 4.0.1pl2 OS: Digital Unix 4.0
Private report: No CVE-ID: None
 [2000-07-06 22:31 UTC] dean dot bennett at home dot com
The configure script checks for dbm by linking a conftest.c program with a dbm_open call against -lgdbm, then -ldb, then -lc and finally -ldbm.

On Digital Unix, the link succeeds against -ldb, because there is a /usr/lib/libdb.a, but dbm_open is really in libc (and also in libdbm.a) and not in libdb.  

This causes a problem when you try to build --with-sybase, as the sybase dbopen() function is superceeded by the dbopen() in libdb.a.  The -ldb is before -lsybdb in the link command.

Configure should not be picking -ldb as the DBM_LIB value, as that is not the location of dbm_open.  If I install gdbm, it works fine, as it checks for that library first.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-27 22:13 UTC] waldschrott@php.net
Please verify that it?s still happening using the latest version from CVS or snaps.php.net.
 [2000-07-27 23:59 UTC] dean dot bennett at home dot com
Yes it is.

The fix would be to change the order of the AC_CHECK_LIB's in ext/db/config.m4.  I think that the order should be gdbm, c, dbm, db.

As someone else reported, there is also no way to disable linking against dbm.

 [2000-07-28 11:24 UTC] waldschrott@php.net
checking out
 [2001-05-14 12:37 UTC] kalowsky@php.net
attempted at a patch, sent to user.  awaiting a response.  
 [2001-05-14 12:45 UTC] joey@php.net
There are 2 seperate bugs here:

1) The configure issue (IE, order of 'db' libs) and 

2) The conflict with Sybase's dbopen(). 

The second may have been solved (IIUC)by  /ext/sybase/php_sybase_db.c 1.14. 
This was committed right after 4.0.5, 
so it should be in snaps and in 4.0.6.

I think Dan has a suggestion on #1 that he said
he would forward on to you. Please let us know
if either (or both) of these solve this one, Dean.
 [2001-05-14 15:20 UTC] dean dot bennett at home dot com
I stopped seeing this problem because someone fixed the automatic enabling of --with-db, which used to have no way to disable it.

If I add --with-db to configure now, the check in ext/db/config.m4 is still invalid.  It adds -ldb to EXTRA_LIBS when it is not needed, as the dbm_* functions are in libc.

On DU4.0, libdb is not ndbm, and you cannot link against both libdb and libsybdb as they both contain dbopen().

If I either use gdbm, or remove the -ldb from EXTRA_LIBS, the Sybase and dbm functions can co-exist quite nicely.

So the fix is still the order of checks in ext/db/config.m4 - gdbm, libc, dbm, ndbm(db)
 [2001-05-14 21:55 UTC] sniper@php.net
Fixed in CVS.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 30 22:01:28 2024 UTC